Mercurial > emacs
comparison lisp/mail/mailalias.el @ 10327:8822b968b11c
Use `mail-personal-alias-file' globally in place of hardwired "~/.mailrc".
author | Noah Friedman <friedman@splode.com> |
---|---|
date | Tue, 03 Jan 1995 23:43:47 +0000 |
parents | 2c7688eb344e |
children | 462d55b84265 |
comparison
equal
deleted
inserted
replaced
10326:627063d29d25 | 10327:8822b968b11c |
---|---|
99 (goto-char epos) | 99 (goto-char epos) |
100 (forward-char seplen)))) | 100 (forward-char seplen)))) |
101 (set-marker end1 nil))) | 101 (set-marker end1 nil))) |
102 (set-marker end nil))) | 102 (set-marker end nil))) |
103 | 103 |
104 ;; Called by mail-setup, or similar functions, only if ~/.mailrc exists. | 104 ;; Called by mail-setup, or similar functions, only if the file specified |
105 ;; by mail-personal-alias-file (usually `~/.mailrc') exists. | |
105 (defun build-mail-aliases (&optional file) | 106 (defun build-mail-aliases (&optional file) |
106 "Read mail aliases from `~/.mailrc' and set `mail-aliases'." | 107 "Read mail aliases from personal aliases file and set `mail-aliases'. |
107 (setq file (expand-file-name (or file (or (getenv "MAILRC") "~/.mailrc")))) | 108 By default, this is the file specified by `mail-personal-alias-file'." |
109 (setq file (expand-file-name (or file mail-personal-alias-file))) | |
108 (let ((buffer nil) | 110 (let ((buffer nil) |
109 (obuf (current-buffer))) | 111 (obuf (current-buffer))) |
110 (unwind-protect | 112 (unwind-protect |
111 (progn | 113 (progn |
112 (setq buffer (generate-new-buffer "mailrc")) | 114 (setq buffer (generate-new-buffer "mailrc")) |
168 ;; Read the defaults first, if we have not done so. | 170 ;; Read the defaults first, if we have not done so. |
169 (sendmail-synch-aliases) | 171 (sendmail-synch-aliases) |
170 (if (eq mail-aliases t) | 172 (if (eq mail-aliases t) |
171 (progn | 173 (progn |
172 (setq mail-aliases nil) | 174 (setq mail-aliases nil) |
173 (if (file-exists-p (or (getenv "MAILRC") "~/.mailrc")) | 175 (if (file-exists-p mail-personal-alias-file) |
174 (build-mail-aliases)))) | 176 (build-mail-aliases)))) |
175 ;; strip garbage from front and end | 177 ;; strip garbage from front and end |
176 (if (string-match "\\`[ \t\n,]+" definition) | 178 (if (string-match "\\`[ \t\n,]+" definition) |
177 (setq definition (substring definition (match-end 0)))) | 179 (setq definition (substring definition (match-end 0)))) |
178 (if (string-match "[ \t\n,]+\\'" definition) | 180 (if (string-match "[ \t\n,]+\\'" definition) |