emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/mail rmailkwd.el


From: Glenn Morris
Subject: [Emacs-diffs] emacs/lisp/mail rmailkwd.el
Date: Wed, 11 Feb 2009 04:01:35 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       09/02/11 04:01:35

Modified files:
        lisp/mail      : rmailkwd.el 

Log message:
        (rmail-make-label): Doc fix.
        (rmail-read-label): Add current labels to completion list.  (Bug#2222)
        (rmail-set-label): Use `or'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/mail/rmailkwd.el?cvsroot=emacs&r1=1.34&r2=1.35

Patches:
Index: rmailkwd.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/rmailkwd.el,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- rmailkwd.el 3 Feb 2009 04:07:02 -0000       1.34
+++ rmailkwd.el 11 Feb 2009 04:01:35 -0000      1.35
@@ -39,7 +39,7 @@
       rmail-attr-array)
 
 (defun rmail-make-label (s)
-  "Convert string S to a downcased symbol in `rmail-label-obarray'."
+  "Intern string S as a downcased symbol in `rmail-label-obarray'."
   (intern (downcase s) rmail-label-obarray))
 
 ;;;###autoload
@@ -64,7 +64,11 @@
 Completions are chosen from `rmail-label-obarray'.  The default
 is `rmail-last-label', if that is non-nil.  Updates `rmail-last-label'
 according to the choice made, and returns a symbol."
-  (let ((result
+  (let* ((old (rmail-get-keywords))
+       (result
+        (progn
+          ;; Offer any existing labels as choices.
+          (if old (mapc 'rmail-make-label (split-string old ", ")))
         (completing-read (concat prompt
                                  (if rmail-last-label
                                      (concat " (default "
@@ -73,7 +77,7 @@
                                    ": "))
                          rmail-label-obarray
                          nil
-                         nil)))
+                           nil))))
     (if (string= result "")
        rmail-last-label
       (setq rmail-last-label (rmail-make-label result)))))
@@ -86,7 +90,7 @@
   (or (stringp label) (setq label (symbol-name label)))
   (with-current-buffer rmail-buffer
     (rmail-maybe-set-message-counters)
-    (if (not msg) (setq msg rmail-current-message))
+    (or msg (setq msg rmail-current-message))
     ;; Force recalculation of summary for this message.
     (aset rmail-summary-vector (1- msg) nil)
     (let (attr-index)
@@ -123,8 +127,7 @@
                        before)
                       (t (concat before ", " after))))))))))
     (if (rmail-summary-exists)
-       (rmail-select-summary
-        (rmail-summary-update-line msg)))
+       (rmail-select-summary (rmail-summary-update-line msg)))
     (if (= msg rmail-current-message)
        (rmail-display-labels))))
 




reply via email to

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