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

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

[elpa] externals/el-search e7e900c 145/332: Use `read' to circumvent bug


From: Stefan Monnier
Subject: [elpa] externals/el-search e7e900c 145/332: Use `read' to circumvent bug#24542
Date: Tue, 1 Dec 2020 15:48:31 -0500 (EST)

branch: externals/el-search
commit e7e900c8bf4774e42db4012f2f1fd8853dd50761
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    Use `read' to circumvent bug#24542
    
    Use `read' to jump over symbols starting with an "@" character.  This
    should fix the issues caused by bug#24542 completely instead of
    handling only special cases.
    
    Add some documentation for `el-search--end-of-sexp'.
---
 el-search.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/el-search.el b/el-search.el
index e9ac389..019c935 100644
--- a/el-search.el
+++ b/el-search.el
@@ -592,8 +592,13 @@ matches the (only) argument (that should be a string)."
 
 
 (defun el-search--end-of-sexp ()
-  ;; Assumes point is at sexp beginning
-  (or (scan-sexps (point) 1) (point-max)))
+  "Return the value of point at the end of this sexp.
+Assumes point is at a sexp beginning."
+  (if (eql (char-after) ?@) ;bug#24542
+      (save-excursion
+        (ignore (read (current-buffer)))
+        (point))
+    (or (scan-sexps (point) 1) (point-max))))
 
 (defun el-search--skip-expression (expression &optional read)
   ;; Move forward at least one character.  Don't move into a string or
@@ -608,8 +613,6 @@ matches the (only) argument (that should be a string)."
   ;; point instead.
   (when read (setq expression (save-excursion (read (current-buffer)))))
   (cond
-   ((and (symbolp expression)) (string-match-p "\\`@+\\'" (symbol-name 
expression)) ;bug#24542
-    (forward-char (length (symbol-name expression))))
    ((or (null expression)
         (equal [] expression)
         (not (or (listp expression) (vectorp expression))))



reply via email to

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