emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 790259f: Make "not found" message in dictionary less misleading


From: Lars Ingebrigtsen
Subject: master 790259f: Make "not found" message in dictionary less misleading
Date: Thu, 18 Mar 2021 03:43:31 -0400 (EDT)

branch: master
commit 790259f01a62c2b09385aa58a84198ea378ba83d
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make "not found" message in dictionary less misleading
    
    * lisp/net/dictionary.el (dictionary-do-search): Don't say there
    are more words when there aren't (bug#47056).
---
 lisp/net/dictionary.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 5938b81..f33cbaf 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -721,13 +721,14 @@ of matching words."
     (if (dictionary-check-reply reply 552)
        (progn
          (unless nomatching
-           (beep)
-           (insert "Word not found, maybe you are looking "
-                   "for one of these words\n\n")
-           (dictionary-do-matching word
-                                   dictionary
-                                   "."
-                                   'dictionary-display-only-match-result)
+           (insert "Word not found")
+           (dictionary-do-matching
+             word
+            dictionary
+            "."
+            (lambda (reply)
+               (insert ", maybe you are looking for one of these words\n\n")
+               (dictionary-display-only-match-result reply)))
            (dictionary-post-buffer)))
       (if (dictionary-check-reply reply 550)
           (error "Dictionary \"%s\" is unknown, please select an existing one"
@@ -1074,7 +1075,6 @@ If PATTERN is omitted, it defaults to \"[ 
\\f\\t\\n\\r\\v]+\"."
 
 (defun dictionary-display-only-match-result (reply)
   "Display the results from the current matches in REPLY without the headers."
-
   (let ((number (nth 1 (dictionary-reply-list reply)))
        (list (dictionary-simple-split-string (dictionary-read-answer) "\n+")))
     (insert number " matching word" (if (equal number "1") "" "s")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]