# HG changeset patch # User Richard M. Stallman # Date 719446776 0 # Node ID 240d5fe385957340873b5b3bac5f95e716d9c56d # Parent f680a6fb666110cc8b7b7ab5dd5688dfeb509a22 (mail-setup): Call build-mail-aliases, not mail-abbrev-setup. (sendmail-send-it): Call expand-mail-aliases. diff -r f680a6fb6661 -r 240d5fe38595 lisp/mail/sendmail.el --- a/lisp/mail/sendmail.el Sun Oct 18 19:10:56 1992 +0000 +++ b/lisp/mail/sendmail.el Sun Oct 18 22:19:36 1992 +0000 @@ -62,6 +62,10 @@ feature from that of defining aliases in `.mailrc' to be expanded in Emacs. This variable has no effect unless your system uses sendmail as its mailer.") +(defvar mail-aliases t + "Alias of mail address aliases, +or t meaning should be initialized from `~/.mailrc'.") + (defvar mail-yank-prefix nil "*Prefix insert on lines of yanked message being replied to. nil means use indentation.") @@ -69,6 +73,17 @@ (defvar mail-abbrevs-loaded nil) (defvar mail-mode-map nil) +(autoload 'build-mail-aliases "mailalias" + "Read mail aliases from `~/.mailrc' and set `mail-aliases'." + nil) + +(autoload 'expand-mail-aliases "mailalias" + "Expand all mail aliases in suitable header fields found between BEG and END. +Suitable header fields are `To', `Cc' and `Bcc' and their `Resent-' variants. +Optional second arg EXCLUDE may be a regular expression defining text to be +removed from alias expansions." + nil) + ;;;###autoload (defvar mail-signature nil "*Text inserted at end of mail buffer when a message is initialized. @@ -92,8 +107,12 @@ (modify-syntax-entry ?% ". " mail-mode-syntax-table))) (defun mail-setup (to subject in-reply-to cc replybuffer actions) + (if (eq mail-aliases t) + (progn + (setq mail-aliases nil) + (if (file-exists-p "~/.mailrc") + (build-mail-aliases)))) (setq mail-send-actions actions) - (mail-aliases-setup) (setq mail-reply-buffer replybuffer) (goto-char (point-min)) (insert "To: ") @@ -251,6 +270,8 @@ (replace-match "\n") (backward-char 1) (setq delimline (point-marker)) + (if mail-aliases + (expand-mail-aliases (point-min) delimline)) (goto-char (point-min)) ;; ignore any blank lines in the header (while (and (re-search-forward "\n\n\n*" delimline t)