emacs-devel
[Top][All Lists]
Advanced

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

Re: desktop.el: autosave?


From: Reuben Thomas
Subject: Re: desktop.el: autosave?
Date: Mon, 10 Dec 2007 22:01:02 +0000 (GMT)
User-agent: Alpine 0.99999 (DEB 796 2007-11-08)

On Sun, 9 Dec 2007, Stefan Monnier wrote:

likely to use this feature. Furthermore those concerned about power usage
and disk spin-up only have to worry about the same Emacs feature
(auto-save-hook), and not add another hook or function to their list of
things to tweak.

BTW, how 'bout optimizing disk writes like savehist does: only save the
new desktop file if it's different from the previous one.  That doesn't
save you from generating the new file's content in a buffer, of course,
but still.

That sounds like a good idea. I think we can now collect the changes that need to be made:

1. A customizable preference, desktop-auto-save, which indicates whether desktop-save-in-desktop-dir should be added to auto-save-hook or not. Is the easiest way to do this to add a private function that desktop mode always adds to auto-save-hook and then have that private function test a boolean which is itself the customizable preference when it runs, to see whether to proceed or not?

2. Change desktop-save-in-desktop-dir so that it only prompts for a directory if it is called interactively. The normal way seems to be to add an optional argument as described in the help for interactive-p.

3. Change desktop-save-in-desktop-dir to be like savehist-mode, only actually writing the file when the history has changed since the last time.

Does that sounds about right?

--
http://rrt.sc3d.org/ | Brevity is the soul




reply via email to

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