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

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

[nongnu] elpa/iedit df6c2ad919 017/301: fix search to use regexp-quote w


From: ELPA Syncer
Subject: [nongnu] elpa/iedit df6c2ad919 017/301: fix search to use regexp-quote when needed
Date: Mon, 10 Jan 2022 22:58:46 -0500 (EST)

branch: elpa/iedit
commit df6c2ad9195b87ea8e6c2a70943745ab038d6969
Author: Le Wang <le.wang@agworld.com.au>
Commit: Le Wang <le.wang@agworld.com.au>

    fix search to use regexp-quote when needed
---
 iedit.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/iedit.el b/iedit.el
index f710989ab7..5b9ae9971a 100644
--- a/iedit.el
+++ b/iedit.el
@@ -270,12 +270,17 @@ Commands:
       (cond ((and arg iedit-last-occurrence-in-history)
              (setq occurrence iedit-last-occurrence-in-history))
             ((and transient-mark-mode mark-active (not (equal (mark) (point))))
-             (setq occurrence (buffer-substring-no-properties (mark) (point))))
+             (setq occurrence (regexp-quote (buffer-substring-no-properties
+                                             (mark) (point)))))
             ((and isearch-mode (not (string= isearch-string "")))
-             (setq occurrence (buffer-substring-no-properties (point) 
isearch-other-end))
+             (setq occurrence (funcall (if isearch-regexp
+                                           'eval
+                                         'regexp-quote)
+                                       (buffer-substring-no-properties
+                                        (point) isearch-other-end)))
              (isearch-exit))
             ((and iedit-current-symbol-default (current-word t))
-             (setq occurrence (current-word))
+             (setq occurrence (regexp-quote (current-word)))
              (when iedit-only-at-symbol-boundaries
                (setq occurrence (concat "\\_<" (regexp-quote occurrence) 
"\\_>"))))
             (t (error "No candidate of the occurrence, cannot enable iedit 
mode.")))



reply via email to

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