summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/gnus-art.el9
-rw-r--r--lisp/gnus/gnus-util.el22
2 files changed, 12 insertions, 19 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 8f0695222cb..0cd34e445cc 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -41,6 +41,7 @@
(require 'mm-uu)
(require 'message)
(require 'mouse)
+(require 'seq)
(autoload 'gnus-msg-mail "gnus-msg" nil t)
(autoload 'gnus-button-mailto "gnus-msg")
@@ -8580,11 +8581,9 @@ For example:
nil)
(gnus-treat-condition
(eq gnus-treat-condition val))
- ((and (listp val)
- (stringp (car val)))
- (apply #'gnus-or (mapcar `(lambda (s)
- (string-match s ,(or gnus-newsgroup-name "")))
- val)))
+ ((stringp (car-safe val))
+ (let ((name (or gnus-newsgroup-name "")))
+ (seq-some (lambda (s) (string-match-p s name)) val)))
((listp val)
(let ((pred (pop val)))
(cond
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 6b0f29b0afb..e4bc9b900c2 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -34,6 +34,7 @@
(eval-when-compile (require 'cl-lib))
+(require 'seq)
(require 'time-date)
(require 'text-property-search)
@@ -1160,20 +1161,13 @@ ARG is passed to the first function."
(eq (cadr (memq 'gnus-undeletable (text-properties-at b))) t)
(text-property-any b e 'gnus-undeletable t)))
-(defun gnus-or (&rest elems)
- "Return non-nil if any of the elements are non-nil."
- (catch 'found
- (while elems
- (when (pop elems)
- (throw 'found t)))))
-
-(defun gnus-and (&rest elems)
- "Return non-nil if all of the elements are non-nil."
- (catch 'found
- (while elems
- (unless (pop elems)
- (throw 'found nil)))
- t))
+(defun gnus-or (&rest elements)
+ "Return non-nil if any one of ELEMENTS is non-nil."
+ (seq-drop-while #'null elements))
+
+(defun gnus-and (&rest elements)
+ "Return non-nil if all ELEMENTS are non-nil."
+ (not (memq nil elements)))
;; gnus.el requires mm-util.
(declare-function mm-disable-multibyte "mm-util")