>From ac9505d3105138c69b018d6432182e45d12a2bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 15 Oct 2022 21:25:59 +0200 Subject: [PATCH] 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. --- lisp/net/dictionary.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 4c52382c67..b8f5018005 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1173,7 +1173,10 @@ dictionary-search (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." -- 2.34.1