changeset 8802:7fcda87193a3

(mail-alias-modtime): New variable. (synch-mail-aliases): New function. (mail-setup, sendmail-send-it): Synchronize cached list with file.
author Karl Heuer <kwzh@gnu.org>
date Fri, 16 Sep 1994 22:29:25 +0000
parents eee06aef6f56
children 18bf41f29a7d
files lisp/mail/sendmail.el
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/sendmail.el	Fri Sep 16 22:28:30 1994 +0000
+++ b/lisp/mail/sendmail.el	Fri Sep 16 22:29:25 1994 +0000
@@ -75,6 +75,9 @@
 The alias definitions in `~/.mailrc' have this form:
     alias ALIAS MEANING")
 
+(defvar mail-alias-modtime nil
+  "The modification time of ~/.mailrc when it was last examined.")
+
 (defvar mail-yank-prefix nil
   "*Prefix insert on lines of yanked message being replied to.
 nil means use indentation.")
@@ -158,7 +161,14 @@
 (defvar mail-send-hook nil
   "Normal hook run before sending mail, in Mail mode.")
 
+(defun synch-mail-aliases ()
+  (let ((modtime (nth 5 (file-attributes "~/.mailrc"))))
+    (or (equal mail-alias-modtime modtime)
+	(setq mail-alias-modtime modtime
+	      mail-aliases t))))
+
 (defun mail-setup (to subject in-reply-to cc replybuffer actions)
+  (synch-mail-aliases)
   (if (eq mail-aliases t)
       (progn
 	(setq mail-aliases nil)
@@ -402,6 +412,7 @@
 	  (replace-match "\n")
 	  (backward-char 1)
 	  (setq delimline (point-marker))
+	  (synch-mail-aliases)
 	  (if mail-aliases
 	      (expand-mail-aliases (point-min) delimline))
 	  (goto-char (point-min))