emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog mail/rmail.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp ChangeLog mail/rmail.el
Date: Tue, 10 Feb 2009 03:57:15 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/10 03:57:14

Modified files:
        lisp           : ChangeLog 
        lisp/mail      : rmail.el 

Log message:
        (rmail-set-attribute): Allow ATTR to be a string.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15289&r2=1.15290
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmail.el?cvsroot=emacs&r1=1.497&r2=1.498

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15289
retrieving revision 1.15290
diff -u -b -r1.15289 -r1.15290
--- ChangeLog   10 Feb 2009 03:39:38 -0000      1.15289
+++ ChangeLog   10 Feb 2009 03:57:10 -0000      1.15290
@@ -25,6 +25,7 @@
        (rmail-get-attr-names): Check for missing or corrupt attribute headers.
        (rmail-auto-file): Set the filed attribute, rather than explicitly not
        doing so.  (Bug#2231)
+       (rmail-set-attribute): Allow ATTR to be a string.
 
 2009-02-09  Ulf Jasper  <address@hidden>
 

Index: mail/rmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.497
retrieving revision 1.498
diff -u -b -r1.497 -r1.498
--- mail/rmail.el       10 Feb 2009 03:33:27 -0000      1.497
+++ mail/rmail.el       10 Feb 2009 03:57:13 -0000      1.498
@@ -2148,8 +2148,18 @@
   "Turn an attribute of a message on or off according to STATE.
 STATE is either nil or the character (numeric) value associated
 with the state (nil represents off and non-nil represents on).
-ATTR is the index of the attribute.  MSGNUM is message number to
+ATTR is either the index number of the attribute, or a string,
+both from `rmail-attr-array'.  MSGNUM is message number to
 change; nil means current message."
+  (let ((n 0)
+        (nmax (length rmail-attr-array)))
+    (while (and (stringp attr)
+                (< n nmax))
+      (if (string-equal attr (cadr (aref rmail-attr-array n)))
+          (setq attr n))
+      (setq n (1+ n))))
+  (if (stringp attr)
+      (error "Unknown attribute `%s'" attr))
   (with-current-buffer rmail-buffer
     (or msgnum (setq msgnum rmail-current-message))
     (when (> msgnum 0)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]