]> code.delx.au - gnu-emacs-elpa/commitdiff
el-search: new pattern type `not'
authorMichael Heerdegen <michael_heerdegen@web.de>
Wed, 30 Dec 2015 00:33:52 +0000 (01:33 +0100)
committerMichael Heerdegen <michael_heerdegen@web.de>
Thu, 31 Dec 2015 20:24:26 +0000 (21:24 +0100)
packages/el-search/el-search.el

index 6e81c28264509db468a5bdb36c6a7c988b55aca4..8724071ed35252e97636cbb982a90d7527428ed0 100644 (file)
@@ -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))))