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

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

[elpa] externals/dict-tree 4299171 150/154: Work around Emacs bug preven


From: Stefan Monnier
Subject: [elpa] externals/dict-tree 4299171 150/154: Work around Emacs bug preventing dict-tree caching.
Date: Mon, 14 Dec 2020 12:22:04 -0500 (EST)

branch: externals/dict-tree
commit 42991714549f5c3c0cea2d2c53673ee977b37a25
Author: Toby S. Cubitt <toby-predictive@dr-qubit.org>
Commit: Toby S. Cubitt <toby-predictive@dr-qubit.org>

    Work around Emacs bug preventing dict-tree caching.
    
    Hash tables with :test 'equal don't match `equal' byte-compiled anonymous
    functions, such as the prefix-filter functions generated by
    predictive-complete queries. Work around this by generating defun'ed
    prefix-filters for up to 10 ngrams.
---
 dict-tree.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/dict-tree.el b/dict-tree.el
index 100aac1..1c7ff08 100644
--- a/dict-tree.el
+++ b/dict-tree.el
@@ -2616,13 +2616,13 @@ to its constituent dicts."
 
       ;; if there's a cache entry with enough results, use it
       (if (and cachefun
-              ;; (or (symbolp rank-function)
-              ;;          ;; can be '(t . rankfun) for `dictree-fuzzy-complete'
-              ;;          (and (consp rank-function)
-              ;;               (symbolp (car rank-function))
-              ;;               (symbolp (cdr rank-function))))
-              ;; (symbolp filter)
-              ;; (symbolp pfxfilter)
+              (or (symbolp rank-function)
+                  ;; can be '(t . rankfun) for `dictree-fuzzy-complete'
+                  (and (consp rank-function)
+                       (symbolp (car rank-function))
+                       (symbolp (cdr rank-function))))
+              (symbolp filter)
+              (symbolp pfxfilter)
               (setq cache (funcall cachefun dic))
               (setq cache-entry
                     (gethash (list args rank-function reverse filter pfxfilter)



reply via email to

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