branch: elpa/anzu
commit 17b3ab244b55c0d34a565b42927afb2035e5e687
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
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)))