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

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

[elpa] master 58bc417 014/110: Escape regex metacharacters for standard


From: Oleh Krehel
Subject: [elpa] master 58bc417 014/110: Escape regex metacharacters for standard isearch
Date: Sat, 11 May 2019 10:15:34 -0400 (EDT)

branch: master
commit 58bc417c55f7b5d2fa14a8e55b899fa1655ca9fc
Author: Mark Triggs <address@hidden>
Commit: Mark Triggs <address@hidden>

    Escape regex metacharacters for standard isearch
    
    Doing an isearch for '[' and then invoking avy-isearch would trigger an
    error like:
    
         Invalid regexp: "Unmatched [ or [^"
    
    If we are not doing a regex-based search, escape the search string to
    avoid these kind of issues.
---
 avy.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/avy.el b/avy.el
index 1e5ee1a..94e899c 100644
--- a/avy.el
+++ b/avy.el
@@ -982,7 +982,9 @@ The window scope is determined by `avy-all-windows' (ARG 
negates it)."
   (avy-with avy-isearch
     (let ((avy-background nil))
       (avy--process
-       (avy--regex-candidates isearch-string)
+       (avy--regex-candidates (if isearch-regexp
+                                  isearch-string
+                                (regexp-quote isearch-string)))
        (avy--style-fn avy-style))
       (isearch-done))))
 



reply via email to

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