1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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).
This commit is contained in:
Daniel Martín 2022-10-16 11:25:17 +02:00 committed by Lars Ingebrigtsen
parent 45aabe6eda
commit f9726408f6

View File

@ -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."