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

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

[elpa] externals/el-search ec0c3e8 053/332: el-search: new pattern type


From: Stefan Monnier
Subject: [elpa] externals/el-search ec0c3e8 053/332: el-search: new pattern type `not'
Date: Tue, 1 Dec 2020 15:48:10 -0500 (EST)

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

    el-search: new pattern type `not'
---
 el-search.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/el-search.el b/el-search.el
index 6e81c28..8724071 100644
--- a/el-search.el
+++ b/el-search.el
@@ -569,6 +569,11 @@ matches the list (1 2 3 4 5 6 7 8 9) and binds `x' to (4 5 
6)."
   `(and (pred symbolp)
         (app symbol-name (string ,@regexps))))
 
+(el-search-defpattern not (pattern)
+  "Matches any object that is not matched by PATTERN."
+  `(app ,(apply-partially #'el-search--match-p (el-search--matcher pattern))
+        (pred not)))
+
 (defun el-search--match-symbol-file (regexp symbol)
   (when-let ((symbol-file (and (symbolp symbol)
                                (symbol-file symbol))))



reply via email to

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