Commit 5ef9d627 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(mail-setup): Call build-mail-aliases, not mail-abbrev-setup.

(sendmail-send-it): Call expand-mail-aliases.
parent d0c9169e
......@@ -62,6 +62,10 @@ This file defines aliases to be expanded by the mailer; this is a different
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 @@ nil means use indentation.")
(defvar mail-abbrevs-loaded nil)
(defvar mail-mode-map nil)
(autoload 'build-mail-aliases "mailalias"
"Read mail aliases from `~/.mailrc' and set `mail-aliases'."
(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."
(defvar mail-signature nil
"*Text inserted at end of mail buffer when a message is initialized.
......@@ -92,8 +107,12 @@ so you can edit or delete these lines.")
(modify-syntax-entry ?% ". " mail-mode-syntax-table)))
(defun mail-setup (to subject in-reply-to cc replybuffer actions)
(if (eq mail-aliases t)
(setq mail-aliases nil)
(if (file-exists-p "~/.mailrc")
(setq mail-send-actions actions)
(setq mail-reply-buffer replybuffer)
(goto-char (point-min))
(insert "To: ")
......@@ -251,6 +270,8 @@ the user from the mailer."
(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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment