Mercurial > emacs
changeset 88188:d33a3b2bba76
(rmail-message-labels-p): Rewrote using
rmail-desc-get-keywords.
author | Alex Schroeder <alex@gnu.org> |
---|---|
date | Tue, 17 Jan 2006 09:57:46 +0000 |
parents | 50e619785920 |
children | 41d86c3e40fe |
files | lisp/mail/rmail.el |
diffstat | 1 files changed, 8 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/mail/rmail.el Tue Jan 17 09:36:49 2006 +0000 +++ b/lisp/mail/rmail.el Tue Jan 17 09:57:46 2006 +0000 @@ -1892,15 +1892,14 @@ (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 ***