[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58552: 29.0.50; [PATCH] dictionary-lookup-definition "Wrong type arg
From: |
Richard Stallman |
Subject: |
bug#58552: 29.0.50; [PATCH] dictionary-lookup-definition "Wrong type argument" error when there is no word at point |
Date: |
Sun, 16 Oct 2022 16:53:03 -0400 |
[[[ To any NSA and FBI agents reading my email: please consider ]]]
[[[ whether defending the US Constitution against all enemies, ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]
As far as I can tell, the message below was sent only to me.
But the message is strange. So I decided to forward it here.
------- Start of forwarded message -------
From: Daniel Martín <mardani29@yahoo.es>
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
- --=-=-=--
------- End of forwarded message -------
--
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)