Subject: [FIX INCLUDED] desktop-read re-enables desktop autosave when it shouldn't

From: Kelly Dean <[email-masked]>
Date: Sat, 15 Nov 2014 06:57:15 +0000

With emacs 24.4, run emacs -Q, then do
(desktop-save-mode 1)
Notice that window-configuration-change-hook now (correctly) contains desktop-auto-save-set-timer, since desktop-save-mode defaults to enabling desktop autosave. Now do
(desktop-auto-save-disable)
Notice that desktop-auto-save-set-timer is (correctly) removed from the hook. Now do
(desktop-save "~/.emacs.d")
(desktop-read)
Notice that desktop-auto-save-set-timer is added back to the hook, which is a bug since you didn't ask for desktop autosave to be re-enabled.

This bug wasn't in 24.3, because 24.3 didn't have the desktop autosave feature.

The bug is in desktop.el of the 24.4 release, line 1191, which unconditionally calls desktop-auto-save-enable. The fix is to change that to conditionally call desktop-auto-save-enable, if desktop autosave was enabled (indicated by presence of desktop-auto-save-set-timer in the hook) prior to being disabled by the call to desktop-auto-save-disable on line 1138. Patch excluded, per request.