From bace971d3cff75963ee52d0157c091caaba857ac Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Tue, 15 Mar 2016 17:03:28 +0100 Subject: [PATCH] Rewrite `string' pattern definition --- packages/el-search/el-search.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index f5db2ebd9..764d77eb9 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -619,13 +619,10 @@ matches the list (1 2 3 4 5 6 7 8 9) and binds `x' to (4 5 6)." "Matches any string that is matched by all REGEXPS." (el-search--check-pattern-args 'string regexps #'el-search--stringish-p "Argument not a string") - (let ((string (make-symbol "string")) - (regexp (make-symbol "regexp"))) - `(and (pred stringp) - (pred (lambda (,string) - (cl-every - (lambda (,regexp) (el-search--smart-string-match-p ,regexp ,string)) - ',regexps)))))) + `(and (pred stringp) + ,@(mapcar (lambda (thing) `(pred (el-search--smart-string-match-p + ,(if (symbolp thing) (symbol-name thing) thing)))) + regexps))) (el-search-defpattern symbol (&rest regexps) "Matches any symbol whose name is matched by all REGEXPS." -- 2.39.2