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

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

[elpa] externals/el-search 14c7cf9 074/332: el-search--check-pattern-arg


From: Stefan Monnier
Subject: [elpa] externals/el-search 14c7cf9 074/332: el-search--check-pattern-args: make arg TYPE a string
Date: Tue, 1 Dec 2020 15:48:14 -0500 (EST)

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

    el-search--check-pattern-args: make arg TYPE a string
---
 el-search.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/el-search.el b/el-search.el
index 764d77e..84fb1c8 100644
--- a/el-search.el
+++ b/el-search.el
@@ -546,11 +546,11 @@ return nil (no error)."
 
 (defun el-search--check-pattern-args (type args predicate &optional message)
   "Check whether all ARGS fulfill PREDICATE.
-Raise an error if not.  TYPE and optional argument MESSAGE are
-used to construct the error message."
+Raise an error if not.  The string arguments TYPE and optional
+MESSAGE are used to construct the error message."
   (mapc (lambda (arg)
           (unless (funcall predicate arg)
-            (error (concat "Pattern `%S': "
+            (error (concat "Pattern `%s': "
                            (or message (format "argument doesn't fulfill %S" 
predicate))
                            ": %S")
                    type arg)))
@@ -617,7 +617,7 @@ matches the list (1 2 3 4 5 6 7 8 9) and binds `x' to (4 5 
6)."
 
 (el-search-defpattern string (&rest regexps)
   "Matches any string that is matched by all REGEXPS."
-  (el-search--check-pattern-args 'string regexps #'el-search--stringish-p
+  (el-search--check-pattern-args "string" regexps #'el-search--stringish-p
                                  "Argument not a string")
   `(and (pred stringp)
         ,@(mapcar (lambda (thing) `(pred (el-search--smart-string-match-p
@@ -626,7 +626,7 @@ matches the list (1 2 3 4 5 6 7 8 9) and binds `x' to (4 5 
6)."
 
 (el-search-defpattern symbol (&rest regexps)
   "Matches any symbol whose name is matched by all REGEXPS."
-  (el-search--check-pattern-args 'symbol regexps #'el-search--stringish-p
+  (el-search--check-pattern-args "symbol" regexps #'el-search--stringish-p
                                  "Argument not a string")
   `(and (pred symbolp)
         (app symbol-name (string ,@regexps))))
@@ -684,7 +684,7 @@ REGEXP can also be a symbol, in which case
   (concat \"^\" (symbol-name regexp) \"$\")
 
 is used as regular expression."
-  (el-search--check-pattern-args 'source (list regexp) #'el-search--stringish-p
+  (el-search--check-pattern-args "source" (list regexp) 
#'el-search--stringish-p
                                  "Argument not a string")
   `(pred (el-search--match-symbol-file ,(if (symbolp regexp) (symbol-name 
regexp) regexp))))
 
@@ -716,7 +716,7 @@ matches any of these expressions:
     [(control ?s)]"
   (when (eq (car-safe key-sequence) 'kbd)
     (setq key-sequence (kbd (cadr key-sequence))))
-  (el-search--check-pattern-args 'keys (list key-sequence) (lambda (x) (or 
(stringp x) (vectorp x)))
+  (el-search--check-pattern-args "keys" (list key-sequence) (lambda (x) (or 
(stringp x) (vectorp x)))
                                  "argument not a string or vector")
   `(pred (el-search--match-key-sequence ,key-sequence)))
 



reply via email to

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