From e57610789c512eb8ff780629ba03907366ed06eb Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Tue, 17 Jan 2006 09:57:46 +0000 Subject: [PATCH] (rmail-message-labels-p): Rewrote using rmail-desc-get-keywords. --- lisp/mail/rmail.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 5e40ab3ddfe..227abc0d07d 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -1892,15 +1892,14 @@ otherwise, show it in full." (with-current-buffer rmail-summary-buffer (rmail-summary-update-attribute attr-index msgnum))))))) -;; Return t if the attributes/keywords line of msg number MSG -;; contains a match for the regexp LABELS. -(defun rmail-message-labels-p (msg labels) - (save-excursion - (save-restriction - (widen) - (goto-char (rmail-desc-get-start msg)) - (forward-line 1) - (re-search-backward labels (prog1 (point) (end-of-line)) t)))) +(defun rmail-message-labels-p (n labels) + "Return t if message number N has keywords matching LABELS. +LABELS is a regular expression." + (catch 'found + (dolist (keyword (rmail-desc-get-keywords n)) + (when (string-match labels keyword) + (throw 'found t))))) + ;;;; *** Rmail Message Selection And Support *** -- 2.39.2