[comp.emacs] rmail mode auto-saves

riddle@umbc3.UMBC.EDU (Mr. Paul Riddle) (01/20/89)

Hello, folks...

I read my mail using RMAIL and every time I re-save the mail file, Emacs
creates a backup which I have to delete.  Is there a simple way to tell
it not to do this?  There has never been an occasion where I needed to
use my backup RMAIL file.  I'd like to keep the setting local, as I
DO use backups on my normal files.

Thanks,
Paul Riddle
riddle@umbc3.umbc.edu

interran@marktwain (John Interrante) (01/20/89)

Put the following code in your ~/.emacs if you want to prevent GNU
Emacs from backing up your RMAIL file when you quit rmail.

(setq rmail-mode-hook 'rmail:mode:hook)

(defun rmail:mode:hook ()
  (auto-save-mode 1)
  (make-local-variable 'make-backup-files)
  (setq make-backup-files nil))

John Interrante		interran@marktwain.stanford.edu

rbj@nav.icst.nbs.GOV (Root Boy Jim) (01/28/89)

? (setq rmail-mode-hook 'rmail:mode:hook)

? (defun rmail:mode:hook () ...)

One fact that may not be widely known about lisp is that a symbol
may have *both* a function *and* a variable binding. There is nothing
wrong with saying "(setq rmail-mode-hook 'rmail-mode-hook)" followed
by "(defun rmail-mode-hook () ...)". And it is even marginally more
efficient, as you save a symbol, at the possible expense of confusion.

In fact, once having done the above, you can now refer to rmail-mode-hook
without the quote, since it evals to itself! Ain't LISP wonderful?

? John Interrante		interran@marktwain.stanford.edu

	(Root Boy) Jim Cottrell	(301) 975-5688
	<rbj@nav.icst.nbs.gov> or <uunet!nav.icst.nbs.gov!rbj>
	Crackers and Worms -- Breakfast of Champions!