Function: mail-completion-expand

mail-completion-expand is a byte-compiled function defined in mailalias.el.gz.

Signature

(mail-completion-expand TABLE)

Documentation

Build new completion table that expands aliases.

Completes like TABLE except that if the completion is a valid alias, it expands it to its full mail-complete-style form.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/mailalias.el.gz
(defun mail-completion-expand (table)
  "Build new completion table that expands aliases.
Completes like TABLE except that if the completion is a valid alias,
it expands it to its full `mail-complete-style' form."
  (lambda (string pred action)
    (cond
     ((eq action nil)
      (let* ((comp (try-completion string table pred))
             (name (and (listp table) comp
                        (assoc (if (stringp comp) comp string) table))))
        (cond
         ((null name) comp)
         ((eq mail-complete-style 'parens)
          (concat (car name) " (" (cdr name) ")"))
         ((eq mail-complete-style 'angles)
          (concat (cdr name) " <" (car name) ">"))
         (t comp))))
     (t
      (complete-with-action action table string pred)))))