From 5558fd0a6d343a0ea0c35b4a64429eccb9af8e42 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 11 Apr 2011 23:00:56 +0000 Subject: Make `paredit-in-char-p' work recursively. Ignore-this: 32164dfb4309af09754d8a6ed0749f0d It's basically an alias for `paredit-in-string-escape-p' now. Replacing one by the other would make too big a diff. darcs-hash:20110411230056-00fcc-d2838af6bff48ed698f596abfc345453f1bfad63 --- paredit.el | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/paredit.el b/paredit.el index cdb7ce9..e8a794c 100644 --- a/paredit.el +++ b/paredit.el @@ -2458,18 +2458,11 @@ This assumes that `paredit-in-string-p' has already returned true." (backward-char))) oddp)) -(defun paredit-in-char-p (&optional argument) - "True if the point is immediately after a character literal. -A preceding escape character, not preceded by another escape character, - is considered a character literal prefix. (This works for elisp, - Common Lisp, and Scheme.) -Assumes that `paredit-in-string-p' is false, so that it need not handle - long sequences of preceding backslashes in string escapes. (This - assumes some other leading character token -- ? in elisp, # in Scheme - and Common Lisp.)" - (let ((argument (or argument (point)))) - (and (eq (char-before argument) ?\\ ) - (not (eq (char-before (1- argument)) ?\\ ))))) +(defun paredit-in-char-p (&optional position) + "True if point is on a character escape outside a string." + (save-excursion + (goto-char (or position (point))) + (paredit-in-string-escape-p))) (defun paredit-indent-sexps () "If in a list, indent all following S-expressions in the list." -- cgit v1.2.1