From: Michael Heerdegen Date: Wed, 30 Dec 2015 00:33:52 +0000 (+0100) Subject: el-search: new pattern type `not' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/1e8529872618cc0bae0497543588202ef076ab58 el-search: new pattern type `not' --- diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index 6e81c2826..8724071ed 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/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))))