diff lisp/mail/rmailkwd.el @ 101970:5edae205a1ff

(rmail-set-label): Fix the test for a label being already present. (Bug#2210)
author Glenn Morris <rgm@gnu.org>
date Thu, 12 Feb 2009 06:55:43 +0000
parents 22a84dde5ca4
children e91fed5616f7
line wrap: on
line diff
--- a/lisp/mail/rmailkwd.el	Thu Feb 12 06:28:59 2009 +0000
+++ b/lisp/mail/rmailkwd.el	Thu Feb 12 06:55:43 2009 +0000
@@ -106,9 +106,8 @@
 	  ;; If so, set it as an attribute.
 	  (rmail-set-attribute attr-index state msg)
 	;; Is this keyword already present in msg's keyword list?
-	(let* ((header (rmail-get-header rmail-keyword-header msg))
-	       (regexp (concat ", " (regexp-quote label) ","))
-	       (present (string-match regexp (concat ", " header ","))))
+	(let* ((header (rmail-get-keywords msg))
+	       (present (not (null (member label (split-string header ", "))))))
 	  ;; If current state is not correct,
 	  (unless (eq present state)
 	    ;; either add it or delete it.