]> code.delx.au - gnu-emacs-elpa/commitdiff
Rewrite `string' pattern definition
authorMichael Heerdegen <michael_heerdegen@web.de>
Tue, 15 Mar 2016 16:03:28 +0000 (17:03 +0100)
committerMichael Heerdegen <michael_heerdegen@web.de>
Thu, 19 May 2016 20:28:14 +0000 (22:28 +0200)
packages/el-search/el-search.el

index f5db2ebd9e1407568d623b6e5cdd6bb11982327e..764d77eb99732696c3653e493e9fc7df57023169 100644 (file)
@@ -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."