branch: externals/dict-tree commit 9e9d7e9282bc2cc34f0a58812584d1f14e8aec92 Author: Toby Cubitt <toby-predict...@dr-qubit.org> Commit: tsc25 <toby-predict...@dr-qubit.org>
Added dictree-clear-caches for doing the obvious --- dict-tree.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dict-tree.el b/dict-tree.el index d6e0e57..17d686f 100644 --- a/dict-tree.el +++ b/dict-tree.el @@ -1322,6 +1322,23 @@ TEST returns non-nil." ;; deleted and not in cached result: requires no action ))) + +(defun dictree-clear-caches (dict) + "Clear all DICT's query caches." + (interactive (list (read-dict "Dictionary: "))) + (dolist (cachefun '(dictree-lookup-cache + dictree-complete-cache + dictree-complete-ranked-cache + dictree-wildcard-cache + dictree-wildcard-ranked-cache)) + (when (funcall cachefun dict) + (clrhash (funcall cachefun dict)))) + (when (interactive-p) + (message "Cleared caches for dictionary %s" (dictree-name dict)))) + + + + ;; ---------------------------------------------------------------- ;; Retrieving data