summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorDaniel Martín <mardani29@yahoo.es>2022-10-16 11:25:17 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-10-16 11:25:17 +0200
commitf9726408f6cb56b3a97a9e76be166a5156faec0b (patch)
tree4dad73cd64446b2d3516a04d7396574efa819ae0 /lisp/net
parent45aabe6edae8d841a8985853394baddad4a1949e (diff)
downloademacs-f9726408f6cb56b3a97a9e76be166a5156faec0b.tar.gz
emacs-f9726408f6cb56b3a97a9e76be166a5156faec0b.tar.bz2
emacs-f9726408f6cb56b3a97a9e76be166a5156faec0b.zip
Signal an error in dictionary lookup if there's no word at point
* lisp/net/dictionary.el (dictionary-lookup-definition): Signal an error when there is no word at point (bug#58552).
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/dictionary.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 4c52382c672..b8f5018005b 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -1173,7 +1173,10 @@ allows editing it."
(defun dictionary-lookup-definition ()
"Unconditionally lookup the word at point."
(interactive)
- (dictionary-new-search (cons (current-word) dictionary-default-dictionary)))
+ (let ((word (current-word)))
+ (unless word
+ (error "No word at point"))
+ (dictionary-new-search (cons word dictionary-default-dictionary))))
(defun dictionary-previous ()
"Go to the previous location in the current buffer."