emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/paredit 5558fd0 137/224: Make `paredit-in-char-p' work rec


From: ELPA Syncer
Subject: [nongnu] elpa/paredit 5558fd0 137/224: Make `paredit-in-char-p' work recursively.
Date: Sat, 7 Aug 2021 09:22:36 -0400 (EDT)

branch: elpa/paredit
commit 5558fd0a6d343a0ea0c35b4a64429eccb9af8e42
Author: Taylor R Campbell <campbell@mumble.net>
Commit: Taylor R Campbell <campbell@mumble.net>

    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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]