# HG changeset patch # User Glenn Morris # Date 1234409333 0 # Node ID 22a84dde5ca493a5e1622d706fda2cd8dd9041e2 # Parent 01bb1ca54bd55e4011c9474026fc3b4b7d915290 (rmail-read-label): Don't scan for labels if the summary exists, since it's already done. diff -r 01bb1ca54bd5 -r 22a84dde5ca4 lisp/mail/rmailkwd.el --- a/lisp/mail/rmailkwd.el Thu Feb 12 03:28:37 2009 +0000 +++ b/lisp/mail/rmailkwd.el Thu Feb 12 03:28:53 2009 +0000 @@ -64,20 +64,24 @@ 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* ((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 " - (symbol-name rmail-last-label) - "): ") - ": ")) - rmail-label-obarray - nil - nil)))) + (let* ((old nil) + (result + (progn + ;; If the summary exists, we've already read all the + ;; existing labels. If not, read the ones in this message. + (or (eq major-mode 'rmail-summary-mode) + (rmail-summary-exists) + (and (setq old (rmail-get-keywords)) + (mapc 'rmail-make-label (split-string old ", ")))) + (completing-read (concat prompt + (if rmail-last-label + (concat " (default " + (symbol-name rmail-last-label) + "): ") + ": ")) + rmail-label-obarray + nil + nil)))) (if (string= result "") rmail-last-label (setq rmail-last-label (rmail-make-label result)))))