emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/dict-tree 9e9d7e9 056/154: Added dictree-clear-caches f


From: Stefan Monnier
Subject: [elpa] externals/dict-tree 9e9d7e9 056/154: Added dictree-clear-caches for doing the obvious
Date: Mon, 14 Dec 2020 12:21:44 -0500 (EST)

branch: externals/dict-tree
commit 9e9d7e9282bc2cc34f0a58812584d1f14e8aec92
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@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
 



reply via email to

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