bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs should warn before editing a backup~ file~


From: Kevin Rodgers
Subject: Re: emacs should warn before editing a backup~ file~
Date: Mon, 29 Jan 2001 22:20:49 GMT

Roland.Winkler@physik.uni-erlangen.de (Roland Winkler) wrote:
> (defun toggle-read-only-backup ()
>   "Make backup files read-only."
>   (if (string-match "~$" buffer-file-name)
>       (toggle-read-only 1)))
> (add-hook 'find-file-hooks 'toggle-read-only-backup)

Good idea, but the doc string is misleading: the file isn't made read
only, the buffer is.  And it will work on nonstandard configurations if
you use backup-file-name-p instead of string-match.

--
Kevin Rodgers <kevinr@ihs.com>          Lead Software Engineer
Information Handling Services           Electronic Systems Development
15 Inverness Way East, M/S A114         GO BUFFS!
Englewood CO 80112-5776 USA             1 303 397 2807[voice]


Sent via Deja.com
http://www.deja.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]