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

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

Re: A *real* auto-save-mode?


From: shreevatsa
Subject: Re: A *real* auto-save-mode?
Date: Thu, 31 Jan 2008 21:28:44 -0800 (PST)
User-agent: G2/1.0

On Jan 23, 5:37 pm, martin rudalics <address@hidden> wrote:
>  > Emacs has an auto-save-mode, which comes useful on rare occasions such
>  > as crashes. However, what I (and apparently, many others) would like
>  > is a feature that automatically saves your files for you -- not to
>  > another file but to the one your buffer is visiting, and such that you
>  > will not be prompted to save your file on exit.
>
[...]
>
> Setting `auto-save-visited-file-name' can be harmful.  See, for example,
>
> http://lists.gnu.org/archive/html/emacs-devel/2003-10/msg00306.html
>
> and
>
> http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-11/msg00077.html
>
> If these threads do not convince you feel free to send a bug report.
>
> Better yet: Help us find out why and how it doesn't work ;-)

Thanks for those. I was planning to post a detailed post summarising
those two threads and the issues that still exist (I'm convinced
setting `auto-save-visited-file-name' is harmful, not that the bugs
have been fixed), but I no longer feel as interested... I think that
feature should be removed if it's buggy; that's all I can say.

Anyway, for completeness, stating that this is the solution I'm using
now, and it seems to do what I want:

(defun save-buffer-if-visiting-file (&optional args)
"Save the current buffer only if it is visiting a file"
(interactive)
(if (buffer-file-name)
(save-buffer args)))

(add-hook 'auto-save-hook 'save-buffer-if-visiting-file)

Thanks for your help,
I'm sorry I'm not using a "standard" Emacs so I can't submit a bug
report,

-S


reply via email to

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