Function: rmail-read-label

rmail-read-label is an autoloaded and byte-compiled function defined in rmailkwd.el.gz.

Signature

(rmail-read-label PROMPT)

Documentation

Read a label with completion, prompting with PROMPT.

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.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmailkwd.el.gz
;;;###autoload
(defun rmail-read-label (prompt)
  "Read a label with completion, prompting with PROMPT.
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 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 (format-prompt prompt
                                            (and rmail-last-label
                                                 (symbol-name rmail-last-label)))
			     rmail-label-obarray
			     nil
			     nil))))
    (if (string= result "")
	rmail-last-label
      (setq rmail-last-label (rmail-make-label result)))))