comparison 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
comparison
equal deleted inserted replaced
101969:214450de83bc 101970:5edae205a1ff
104 (setq attr-index i))) 104 (setq attr-index i)))
105 (if attr-index 105 (if attr-index
106 ;; If so, set it as an attribute. 106 ;; If so, set it as an attribute.
107 (rmail-set-attribute attr-index state msg) 107 (rmail-set-attribute attr-index state msg)
108 ;; Is this keyword already present in msg's keyword list? 108 ;; Is this keyword already present in msg's keyword list?
109 (let* ((header (rmail-get-header rmail-keyword-header msg)) 109 (let* ((header (rmail-get-keywords msg))
110 (regexp (concat ", " (regexp-quote label) ",")) 110 (present (not (null (member label (split-string header ", "))))))
111 (present (string-match regexp (concat ", " header ","))))
112 ;; If current state is not correct, 111 ;; If current state is not correct,
113 (unless (eq present state) 112 (unless (eq present state)
114 ;; either add it or delete it. 113 ;; either add it or delete it.
115 (rmail-set-header 114 (rmail-set-header
116 rmail-keyword-header msg 115 rmail-keyword-header msg