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

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

[nongnu] elpa/anzu e82b3d4236 069/288: Use delimiter regexp at anzu-quer


From: ELPA Syncer
Subject: [nongnu] elpa/anzu e82b3d4236 069/288: Use delimiter regexp at anzu-query-replace-at-cursor
Date: Thu, 6 Jan 2022 03:58:41 -0500 (EST)

branch: elpa/anzu
commit e82b3d4236ad2324ad1c2538aa1971c5828202d8
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>

    Use delimiter regexp at anzu-query-replace-at-cursor
---
 anzu.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/anzu.el b/anzu.el
index 8de12b6fcd..25fd7fbd80 100644
--- a/anzu.el
+++ b/anzu.el
@@ -431,9 +431,10 @@
     (point)))
 
 (defun anzu--query-from-at-cursor (prompt buf beg end overlay-limit)
-  (let ((symbol (thing-at-point 'symbol)))
+  (let* ((symbol (thing-at-point 'symbol))
+         (symbol-regexp (concat "\\b" (regexp-quote symbol) "\\b")))
     (setq anzu--total-matched
-          (anzu--count-matched buf symbol beg end nil overlay-limit))
+          (anzu--count-matched buf symbol-regexp beg end t overlay-limit))
     (force-mode-line-update)
     symbol))
 
@@ -457,7 +458,8 @@
     (unwind-protect
         (let* ((from (if symbol-beg
                          (progn
-                           (setq beg symbol-beg)
+                           (setq beg symbol-beg
+                                 delimited nil)
                            (anzu--query-from-at-cursor prompt curbuf beg end 
overlay-limit))
                        (anzu--query-from-string prompt beg end use-regexp 
overlay-limit)))
                (to (if (consp from)



reply via email to

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