🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #189032

Re: mail mode

#189032
From: Bob Weiner
Date: Tue, 07 May 1991 21:58
44 lines
1869 bytes
In article <74777@brunix.UUCP> sdm (Scott Meyers) writes:

> When does [GNU] emacs read my .mailrc to see my aliases?  I naively assumed
> that it read my .mailrc whenever I sent a message, but that seems to be
> false.  In particular, if I send mail, then edit my .mailrc to add a new
> alias, then send mail to the new alias, the alias is not expanded and the
> mail bounces.


This is a common problem, with a non-intuitive solution, so I've posted here
what works well for me and does exactly what Scott asks.  Just save the
modified aliases file, before you try to send mail.

At the end of your ~/.mailrc, add the following lines beginning with '#':

#
# Do not remove these comments!
#
# Local Variables:
# eval: (setup-mailrc-hook)
# End:


In your ~/.emacs file, add the following code:


;; Set up so changes to ~/.mailrc aliases are always added to current Emacs
;; session.
;;
(defun mailrc-reset ()
  (message "Reset aliases variable")
  (sit-for 1)
  (setq mail-aliases t)
  nil)     ; this is rather important!

(defun setup-mailrc-hook ()
  (make-local-variable 'write-file-hooks)  ; make it have a separate value here
  (setq write-file-hooks (cons 'mailrc-reset write-file-hooks)))

;; End of code

Start Emacs and you're set.
--
Bob Weiner				   rsw@cs.brown.edu
Technical Details
Message-ID: <RSW.91May7175858@delay.cs.brown.EDU>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!brunix!doorknob!rsw
References: <74777@brunix.UUCP>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,fd7be6b6252b0dfc,start
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-05-08 08:46:56 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!brunix!doorknob!rsw
From: rsw@cs.brown.EDU (Bob Weiner)
Newsgroups: gnu.emacs.help
Subject: Re: mail mode
Message-ID: <RSW.91May7175858@delay.cs.brown.EDU>
Date: 7 May 91 21:58:58 GMT
References: <74777@brunix.UUCP>
Sender: news@brunix.UUCP
Organization: Brown U.
Lines: 44
In-reply-to: sdm's message of 7 May 91 17:22:55 GMT