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

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

[elpa] externals/el-search 975e2e5 073/332: Rewrite `string' pattern def


From: Stefan Monnier
Subject: [elpa] externals/el-search 975e2e5 073/332: Rewrite `string' pattern definition
Date: Tue, 1 Dec 2020 15:48:14 -0500 (EST)

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

    Rewrite `string' pattern definition
---
 el-search.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/el-search.el b/el-search.el
index f5db2eb..764d77e 100644
--- a/el-search.el
+++ b/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."



reply via email to

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