🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.help
Article #188852

Re: Build-mail-aliases?

#188852
From: Piet van Oostrum
Date: Tue, 18 Jun 1991 07:27
57 lines
2655 bytes
>>>>> worley@compass.com (Dale Worley) (DW) writes:


DW> Type:

DW> 	ESC ESC ( b u i l d - m a i l - a l i a s e s ) RET

DW> like the man said.  *Yes*, it will prompt "Eval:" in the minibuffer,
DW> that's what it's supposed to do, because the "(build-mail-aliases)" is
DW> a piece of Emacs-Lisp that you're going to execute.

You can automate this in the following way:

Put this in your .emacs:

------------------------------------------------------------------------
(defun mailrc-reset ()
  (message "Reset aliases variable")
  (sit-for 1)
  (setq mail-aliases t)
  nil)     ; this is rather important!

;;; Small function to place the hook

(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)))

(defun mailrc-reset ()
  (message "Reset aliases variable")
  (sit-for 1)
  (setq mail-aliases t)
  nil)     ; this is rather important!

;;; Small function to place the hook

(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)))
------------------------------------------------------------------------
Note: I guess you could also call (build-mail-aliases) in mailrc-reset.

Put this at the end of your .mailrc file:

------------------------------------------------------------------------
#
# Local Variables:
# eval: (setup-mailrc-hook)
# End:
------------------------------------------------------------------------

Now every time you save the .mailrc file emacs will reload your aliases.
-- 
Piet* van Oostrum, Dept of Computer Science, Utrecht University,
Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands.
Telephone: +31 30 531806   Uucp:   uunet!mcsun!ruuinf!piet
Telefax:   +31 30 513791   Internet:  piet@cs.ruu.nl   (*`Pete')
Technical Details
Message-ID: <1991Jun18.072744.8027@cs.ruu.nl>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!alchemy!piet
References: <79928@eerie.acsu.Buffalo.EDU> <WORLEY.91Jun14104953@sn1987a.compass.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 103b8b,6f4a18bee078860f
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 1991-06-18 08:17:21 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!hp4nl!alchemy!piet
From: piet@cs.ruu.nl (Piet van Oostrum)
Newsgroups: gnu.emacs.help
Subject: Re: Build-mail-aliases?
Message-ID: <1991Jun18.072744.8027@cs.ruu.nl>
Date: 18 Jun 91 07:27:44 GMT
References: <79928@eerie.acsu.Buffalo.EDU> <WORLEY.91Jun14104953@sn1987a.compass.com>
Sender: piet@cs.ruu.nl (Piet van Oostrum)
Reply-To: piet@cs.ruu.nl (Piet van Oostrum)
Organization: Dept of Computer Science, Utrecht University, The Netherlands
Lines: 57
In-Reply-To: worley@compass.com (Dale Worley)