emacs-diffs
[Top][All Lists]
Advanced

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

master 9cf0f254bae: * lisp/net/dictionary.el: More fixes for dictionary-


From: Juri Linkov
Subject: master 9cf0f254bae: * lisp/net/dictionary.el: More fixes for dictionary-new-matching (bug#69312)
Date: Tue, 5 Mar 2024 11:44:08 -0500 (EST)

branch: master
commit 9cf0f254bae79f6b6cda01e7a4b77fabec9f3f8f
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/net/dictionary.el: More fixes for dictionary-new-matching (bug#69312)
    
    (dictionary-new-matching): Change the order of standard calls
    to be the same as in 'dictionary-new-search'.
    Use new function 'dictionary-new-matching-internal'.
    (dictionary-new-matching-internal): New function based on
    'dictionary-new-search-internal'.
---
 lisp/net/dictionary.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el
index 7967c650999..d4dfa33716c 100644
--- a/lisp/net/dictionary.el
+++ b/lisp/net/dictionary.el
@@ -1116,17 +1116,22 @@ If PATTERN is omitted, it defaults to \"[ 
\\f\\t\\n\\r\\v]+\"."
 
 (defun dictionary-new-matching (word)
   "Run a new matching search on WORD."
-  (dictionary-ensure-buffer)
   (dictionary-store-positions)
-  (dictionary-pre-buffer)
-  (dictionary-do-matching word dictionary-default-dictionary
-                         dictionary-default-strategy
-                         'dictionary-display-match-result)
-  (dictionary-store-state 'dictionary-do-matching
+  (dictionary-ensure-buffer)
+  (dictionary-new-matching-internal word dictionary-default-dictionary
+                                    dictionary-default-strategy
+                                    'dictionary-display-match-result)
+  (dictionary-store-state 'dictionary-new-matching-internal
                          (list word dictionary-default-dictionary
                                dictionary-default-strategy
                                'dictionary-display-match-result)))
 
+(defun dictionary-new-matching-internal (word dictionary strategy function)
+  "Start a new matching for WORD in DICTIONARY after preparing the buffer.
+FUNCTION is the callback which is called for each search result."
+  (dictionary-pre-buffer)
+  (dictionary-do-matching word dictionary strategy function))
+
 (defun dictionary-do-matching (word dictionary strategy function)
   "Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION."
   (insert (format-message "Lookup matching words for `%s' in `%s' using `%s'\n"



reply via email to

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