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

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

[elpa] externals/el-search 656869c 235/332: * el-search/el-search.el: Fi


From: Stefan Monnier
Subject: [elpa] externals/el-search 656869c 235/332: * el-search/el-search.el: Fix heuristic matcher for 'nil
Date: Tue, 1 Dec 2020 15:48:53 -0500 (EST)

branch: externals/el-search
commit 656869cf0d62c7cfcca197b571ef78adf2d3b749
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    * el-search/el-search.el: Fix heuristic matcher for 'nil
    
    (el-search-heuristic-matcher): Special case 'nil.
---
 el-search.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/el-search.el b/el-search.el
index b65bd9e..e2b7179 100644
--- a/el-search.el
+++ b/el-search.el
@@ -1187,6 +1187,8 @@ matcher function is constructed by recursively 
destructuring the
 PATTERN and combining the heuristic matchers of the subpatterns."
   (pcase pattern
     ((pred symbolp) #'el-search-true)
+    (''nil ; special case: don't miss occurrences in text like "(1 . nil)"
+     #'el-search-true)
     ((pred pcase--self-quoting-p) (lambda (_ atoms-thunk) (member pattern 
(thunk-force atoms-thunk))))
     (`',tree
      (pcase (el-search--flatten-tree tree)
@@ -1239,7 +1241,9 @@ PATTERN and combining the heuristic matchers of the 
subpatterns."
 (defvar el-search--atom-list-cache (make-hash-table :test #'equal :size 1000))
 
 (defun el-search-atom-list (file-name-or-buffer)
-  "Return a list of el-search-atomic expressions in FILE-NAME-OR-BUFFER."
+  "Return a list of el-search-atomic expressions in FILE-NAME-OR-BUFFER.
+`nil' atoms may be missing from the list for code like
+\"(1 . nil)\")."
   (let ((get-buffer-atoms
          (lambda () (apply #'append
                       (mapcar #'el-search--flatten-tree



reply via email to

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