aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2024-03-05 18:42:49 +0200
committerJuri Linkov2024-03-05 18:42:49 +0200
commit9cf0f254bae79f6b6cda01e7a4b77fabec9f3f8f (patch)
treea3b9cad0d5dbdf5e5178275eadfd9b219812848d
parent5155f5b1cc0a48566d0f419de8cffd845638e567 (diff)
downloademacs-9cf0f254bae79f6b6cda01e7a4b77fabec9f3f8f.tar.gz
emacs-9cf0f254bae79f6b6cda01e7a4b77fabec9f3f8f.zip
* 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'.
-rw-r--r--lisp/net/dictionary.el17
1 files 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]+\"."
1116 1116
1117(defun dictionary-new-matching (word) 1117(defun dictionary-new-matching (word)
1118 "Run a new matching search on WORD." 1118 "Run a new matching search on WORD."
1119 (dictionary-ensure-buffer)
1120 (dictionary-store-positions) 1119 (dictionary-store-positions)
1121 (dictionary-pre-buffer) 1120 (dictionary-ensure-buffer)
1122 (dictionary-do-matching word dictionary-default-dictionary 1121 (dictionary-new-matching-internal word dictionary-default-dictionary
1123 dictionary-default-strategy 1122 dictionary-default-strategy
1124 'dictionary-display-match-result) 1123 'dictionary-display-match-result)
1125 (dictionary-store-state 'dictionary-do-matching 1124 (dictionary-store-state 'dictionary-new-matching-internal
1126 (list word dictionary-default-dictionary 1125 (list word dictionary-default-dictionary
1127 dictionary-default-strategy 1126 dictionary-default-strategy
1128 'dictionary-display-match-result))) 1127 'dictionary-display-match-result)))
1129 1128
1129(defun dictionary-new-matching-internal (word dictionary strategy function)
1130 "Start a new matching for WORD in DICTIONARY after preparing the buffer.
1131FUNCTION is the callback which is called for each search result."
1132 (dictionary-pre-buffer)
1133 (dictionary-do-matching word dictionary strategy function))
1134
1130(defun dictionary-do-matching (word dictionary strategy function) 1135(defun dictionary-do-matching (word dictionary strategy function)
1131 "Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION." 1136 "Search for WORD with STRATEGY in DICTIONARY and display them with FUNCTION."
1132 (insert (format-message "Lookup matching words for `%s' in `%s' using `%s'\n" 1137 (insert (format-message "Lookup matching words for `%s' in `%s' using `%s'\n"