[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dict-tree 2978fc7 024/154: ...and already a bug-fix to
From: |
Stefan Monnier |
Subject: |
[elpa] externals/dict-tree 2978fc7 024/154: ...and already a bug-fix to the new cache updating code |
Date: |
Mon, 14 Dec 2020 12:21:37 -0500 (EST) |
branch: externals/dict-tree
commit 2978fc70d2e7c8ac35fd873405de45a1405db239
Author: Toby Cubitt <toby-predictive@dr-qubit.org>
Commit: tsc25 <toby-predictive@dr-qubit.org>
...and already a bug-fix to the new cache updating code
---
dict-tree.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dict-tree.el b/dict-tree.el
index 809dd48..f6ced34 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -583,7 +583,7 @@ than the corresponding CACHE-THRESHOLD (since those are
likely to
be the slower ones in that case). The setting 'both requires both
conditions to be satisfied simultaneously.
-CACHE-UPDATE-POLICY should be a symbol ('update or 'delete),
+CACHE-UPDATE-POLICY should be a symbol ('synchronize or 'delete),
which determines how the caches are updated when data is inserted
or deleted. The former updates tainted cache entries, which makes
queries faster but insertion and deleteion slower, whereas the
@@ -1059,18 +1059,18 @@ TEST returns non-nil."
;; synchronise the lookup cache if dict is a meta-dictionary,
;; since it's not done automatically
- (cond
- ;; if updating dirty cache entries...
- ((eq (dictree-cache-update-policy dict) 'delete)
- (when (and (dictree--meta-dict-p dict)
- (dictree--lookup-cache-threshold dict)
- (gethash key (dictree--lookup-cache dict)))
- (if deleted
- (remhash key (dictree--lookup-cache dict))
- (puthash key newdata (dictree--lookup-cache dict)))))
- ;; if deleting dirty cache entries...
- (t ; (eq (dictree-cache-update-policy dict) 'delete)
- (remhash key (dictree-complete-cache dict))))
+ (when (and (dictree--meta-dict-p dict)
+ (dictree--lookup-cache-threshold dict))
+ (cond
+ ;; if updating dirty cache entries...
+ ((eq (dictree-cache-update-policy dict) 'synchronize)
+ (when (gethash key (dictree--lookup-cache dict))
+ (if deleted
+ (remhash key (dictree--lookup-cache dict))
+ (puthash key newdata (dictree--lookup-cache dict)))))
+ ;; if deleting dirty cache entries...
+ (t ; (eq (dictree-cache-update-policy dict) 'delete)
+ (remhash key (dictree-complete-cache dict)))))
;; synchronize the completion cache, if it exists
@@ -1133,7 +1133,7 @@ TEST returns non-nil."
(cond
;; if updating dirty cache entries...
- ((eq (dictree-cache-update-policy dict) 'update)
+ ((eq (dictree-cache-update-policy dict) 'synchronize)
(when (setq cache (gethash (cons prefix reverse)
(dictree-complete-ranked-cache dict)))
(setq completions (dictree--cache-completions cache))
- [elpa] branch externals/dict-tree created (now 9242ff7), Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree ae0dc0e 001/154: Version 0.10 of the predictive completion package., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree d86829b 007/154: Fixed bugs in predictive's auto-learn and which dict mode features., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 47f8163 010/154: Made saving dictionaries to compiled or uncomiled forms a customization option., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 9e6d0f2 017/154: Fixed bug when deleting non-existent entries., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 4cd369d 027/154: Avoid breaking setf abstraction in dictree--wrap-insfun., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 9827131 016/154: Fixed unwrapped rank-function bug in dictree--query, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 87bb7e8 019/154: Allow custom write and load functions when saving and dumping dictionaries;, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 2978fc7 024/154: ...and already a bug-fix to the new cache updating code,
Stefan Monnier <=
- [elpa] externals/dict-tree 7d9b258 033/154: Improved handling of dictionary file names in dictree-load, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree f46da76 008/154: Minor bug fixes., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 405d11b 023/154: Implemented the other cache and cache-update policies, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 57d59eb 021/154: Bug-fixes to predictive-auto-learn and read-dict., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 76140ec 026/154: Converted function wrapping macros into functions, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 9120845 032/154: Make weird variable names used to avoid dynamic scoping bugs more consistent, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 6c21fcb 038/154: Fix dictree--query and dictree-complete to return results in correct format, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 8a575f6 039/154: Added new trie functions to dictree--create-custom., Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree 3a18a06 042/154: Modified dictree-populate-from-file to read linearly by default,, Stefan Monnier, 2020/12/14
- [elpa] externals/dict-tree ca2c562 050/154: Bug-fix to dictree-complete, Stefan Monnier, 2020/12/14