Mercurial > emacs
comparison lisp/mail/mailalias.el @ 221:ce8e0192266e
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 01 Apr 1991 21:16:55 +0000 |
parents | 6f8afe7308eb |
children | 7e4c7ef44243 |
comparison
equal
deleted
inserted
replaced
220:2ea306376f97 | 221:ce8e0192266e |
---|---|
20 | 20 |
21 ;; Called from sendmail-send-it, or similar functions, | 21 ;; Called from sendmail-send-it, or similar functions, |
22 ;; only if some mail aliases are defined. | 22 ;; only if some mail aliases are defined. |
23 (defun expand-mail-aliases (beg end &optional exclude) | 23 (defun expand-mail-aliases (beg end &optional exclude) |
24 "Expand all mail aliases in suitable header fields found between BEG and END. | 24 "Expand all mail aliases in suitable header fields found between BEG and END. |
25 Suitable header fields are To, Cc and Bcc and their Resent- variants. | 25 Suitable header fields are `To', `Cc' and `Bcc' and their `Resent-' variants. |
26 Optional 2nd arg EXCLUDE may be a regular expression | 26 Optional second arg EXCLUDE may be a regular expression defining text to be |
27 defining text to be removed from alias expansions." | 27 removed from alias expansions." |
28 (if (eq mail-aliases t) | 28 (if (eq mail-aliases t) |
29 (progn (setq mail-aliases nil) (build-mail-aliases))) | 29 (progn (setq mail-aliases nil) (build-mail-aliases))) |
30 (goto-char beg) | 30 (goto-char beg) |
31 (setq end (set-marker (make-marker) end)) | 31 (setq end (set-marker (make-marker) end)) |
32 (let ((case-fold-search nil)) | 32 (let ((case-fold-search nil)) |
87 (set-marker end1 nil))) | 87 (set-marker end1 nil))) |
88 (set-marker end nil))) | 88 (set-marker end nil))) |
89 | 89 |
90 ;; Called by mail-setup, or similar functions, only if ~/.mailrc exists. | 90 ;; Called by mail-setup, or similar functions, only if ~/.mailrc exists. |
91 (defun build-mail-aliases (&optional file) | 91 (defun build-mail-aliases (&optional file) |
92 "Read mail aliases from ~/.mailrc and set mail-aliases." | 92 "Read mail aliases from ~/.mailrc and set `mail-aliases'." |
93 (setq file (expand-file-name (or file "~/.mailrc"))) | 93 (setq file (expand-file-name (or file "~/.mailrc"))) |
94 (let ((buffer nil) | 94 (let ((buffer nil) |
95 (obuf (current-buffer))) | 95 (obuf (current-buffer))) |
96 (unwind-protect | 96 (unwind-protect |
97 (progn | 97 (progn |
129 (set-buffer obuf)))) | 129 (set-buffer obuf)))) |
130 | 130 |
131 ;; Always autoloadable in case the user wants to define aliases | 131 ;; Always autoloadable in case the user wants to define aliases |
132 ;; interactively or in .emacs. | 132 ;; interactively or in .emacs. |
133 (defun define-mail-alias (name definition) | 133 (defun define-mail-alias (name definition) |
134 "Define NAME as a mail-alias that translates to DEFINITION. | 134 "Define NAME as a mail alias that translates to DEFINITION. |
135 This means that sending a message to NAME will actually send to DEFINITION. | 135 This means that sending a message to NAME will actually send to DEFINITION. |
136 DEFINITION can be one or more mail addresses separated by commas." | 136 DEFINITION can be one or more mail addresses separated by commas." |
137 (interactive "sDefine mail alias: \nsDefine %s as mail alias for: ") | 137 (interactive "sDefine mail alias: \nsDefine %s as mail alias for: ") |
138 ;; Read the defaults first, if we have not done so. | 138 ;; Read the defaults first, if we have not done so. |
139 (if (eq mail-aliases t) | 139 (if (eq mail-aliases t) |