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

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

[nongnu] elpa/anzu 17b3ab244b 074/288: Fix case, no symbol at cursor


From: ELPA Syncer
Subject: [nongnu] elpa/anzu 17b3ab244b 074/288: Fix case, no symbol at cursor
Date: Thu, 6 Jan 2022 03:58:41 -0500 (EST)

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

    Fix case, no symbol at cursor
---
 anzu.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/anzu.el b/anzu.el
index 0f2710c365..9ac8844f99 100644
--- a/anzu.el
+++ b/anzu.el
@@ -436,12 +436,14 @@
     (point)))
 
 (defun anzu--query-from-at-cursor (prompt buf beg end overlay-limit)
-  (let* ((symbol (thing-at-point 'symbol))
-         (symbol-regexp (concat "\\_<" (regexp-quote symbol) "\\_>")))
-    (setq anzu--total-matched
-          (anzu--count-matched buf symbol-regexp beg end t overlay-limit))
-    (force-mode-line-update)
-    symbol))
+  (let ((symbol (thing-at-point 'symbol)))
+    (unless symbol
+      (error "No symbol at cursor!!"))
+    (let ((symbol-regexp (concat "\\_<" (regexp-quote symbol) "\\_>")))
+      (setq anzu--total-matched
+            (anzu--count-matched buf symbol-regexp beg end t overlay-limit))
+      (force-mode-line-update)
+      symbol)))
 
 (defun anzu--thing-begin (thing)
   (let ((bound (bounds-of-thing-at-point thing)))



reply via email to

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