diff options
author | Taylor R Campbell <campbell@mumble.net> | 2011-04-11 23:00:56 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@mumble.net> | 2011-04-11 23:00:56 +0000 |
commit | 5558fd0a6d343a0ea0c35b4a64429eccb9af8e42 (patch) | |
tree | 7f2d6978582775c62cd32da893b89c0ad4d6d6b5 | |
parent | 239e065218996f7f8ac077d7743e6c3b2d5199ef (diff) |
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
-rw-r--r-- | paredit.el | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -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." |