summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-10-18 22:19:36 +0000
committerRichard M. Stallman <rms@gnu.org>1992-10-18 22:19:36 +0000
commit5ef9d627098627e1781b83cc1f11338a51e53870 (patch)
tree4003ae1d89a5c3b6cf47dd13b3901a181b7c3e9b /lisp
parentd0c9169e2bf24c080afd4cd2a8a394efae36d052 (diff)
downloademacs-5ef9d627098627e1781b83cc1f11338a51e53870.tar.gz
(mail-setup): Call build-mail-aliases, not mail-abbrev-setup.
(sendmail-send-it): Call expand-mail-aliases.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mail/sendmail.el23
1 files changed, 22 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 9630bc873ee..c0e7dd413e0 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -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'."
+ 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 @@ 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)
+ (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 @@ 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)