GNU bug report logs - #19059
[FIX INCLUDED] desktop-read re-enables desktop autosave when it shouldn't

Previous Next

Package: emacs;

Reported by: Kelly Dean <kelly <at> prtime.org>

Date: Sat, 15 Nov 2014 08:05:03 UTC

Severity: normal

Done: Kelly Dean <kelly <at> prtime.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19059 in the body.
You can then email your comments to 19059 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19059; Package emacs. (Sat, 15 Nov 2014 08:05:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kelly Dean <kelly <at> prtime.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Nov 2014 08:05:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kelly Dean <kelly <at> prtime.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [FIX INCLUDED] desktop-read re-enables desktop autosave when it
 shouldn't
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19059; Package emacs. (Fri, 23 Jan 2015 03:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 19059 <at> debbugs.gnu.org (full text, mbox):

From: Kelly Dean <kelly <at> prtime.org>
To: 19059 <at> debbugs.gnu.org
Subject: [PATCH] desktop-read re-enables desktop autosave when it shouldn't
Date: Fri, 23 Jan 2015 03:45:26 +0000
[Message part 1 (text/plain, inline)]
Since patches are allowed now...

[desktop-auto-save-bug.patch (text/x-diff, inline)]
--- emacs-24.4/lisp/desktop.el
+++ emacs-24.4/lisp/desktop.el
@@ -1119,7 +1119,8 @@
 	      (desktop-buffer-fail-count 0)
 	      (owner (desktop-owner))
 	      ;; Avoid desktop saving during evaluation of desktop buffer.
-	      (desktop-save nil))
+	      (desktop-save nil)
+	      (desktop-autosave-was-enabled))
 	  (if (and owner
 		   (memq desktop-load-locked-desktop '(nil ask))
 		   (or (null desktop-load-locked-desktop)
@@ -1135,6 +1136,8 @@
 	    ;; Temporarily disable the autosave that will leave it
 	    ;; disabled when loading the desktop fails with errors,
 	    ;; thus not overwriting the desktop with broken contents.
+	    (setq desktop-autosave-was-enabled
+		  (memq 'desktop-auto-save-set-timer window-configuration-change-hook))
 	    (desktop-auto-save-disable)
 	    ;; Evaluate desktop buffer and remember when it was modified.
 	    (load (desktop-full-file-name) t t t)
@@ -1188,7 +1191,7 @@
 				  (set-window-prev-buffers window nil)
 				  (set-window-next-buffers window nil))))
  	    (setq desktop-saved-frameset nil)
-	    (desktop-auto-save-enable)
+	    (if desktop-autosave-was-enabled (desktop-auto-save-enable))
 	    t))
       ;; No desktop file found.
       (desktop-clear)

Reply sent to Kelly Dean <kelly <at> prtime.org>:
You have taken responsibility. (Wed, 18 Feb 2015 00:43:02 GMT) Full text and rfc822 format available.

Notification sent to Kelly Dean <kelly <at> prtime.org>:
bug acknowledged by developer. (Wed, 18 Feb 2015 00:43:02 GMT) Full text and rfc822 format available.

Message #13 received at 19059-done <at> debbugs.gnu.org (full text, mbox):

From: Kelly Dean <kelly <at> prtime.org>
To: 19059-done <at> debbugs.gnu.org
Subject: Re: desktop-read re-enables desktop autosave when it shouldn't
Date: Wed, 18 Feb 2015 00:41:30 +0000
Fixed in trunk.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 18 Mar 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.