[Top][All Lists]

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

Re: desktop.el: autosave?

From: Juri Linkov
Subject: Re: desktop.el: autosave?
Date: Tue, 11 Dec 2007 02:23:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

>>> 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?
>> No need for a separate function.  You could just change desktop-save-mode
>> as follows:
>> (define-minor-mode desktop-save-mode
>>  :global t
>>  :group 'desktop
>>  (if desktop-save-mode
>>      (if desktop-auto-save
>>        (add-hook 'auto-save-hook 'desktop-save-in-desktop-dir))
>>    (remove-hook 'auto-save-hook 'desktop-save-in-desktop-dir)))
> Is that how other similar features work? If you change the
> desktop-auto-save preference while desktop-save-mode is active, it won't
> actually stop saving.

This is how other modes work: when you want a configuration change to
take effect, you should disable and re-enable this mode.

Juri Linkov

reply via email to

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