unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kelly Dean <kelly@prtime.org>
To: 19059@debbugs.gnu.org
Subject: bug#19059: [PATCH] desktop-read re-enables desktop autosave when it shouldn't
Date: Fri, 23 Jan 2015 03:45:26 +0000	[thread overview]
Message-ID: <jo5UkPhcuHYnlips9IABSot76SUmBbxec4hdytoMlLf@local> (raw)
In-Reply-To: <emacs-mail-is-unusable-3>

[-- Attachment #1: Type: text/plain, Size: 34 bytes --]

Since patches are allowed now...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: desktop-auto-save-bug.patch --]
[-- Type: text/x-diff, Size: 1225 bytes --]

--- 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	other threads:[~2015-01-23  3:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <emacs-mail-is-unusable-3>
2015-01-23  3:45 ` Kelly Dean [this message]
2015-02-18  0:41   ` bug#19059: desktop-read re-enables desktop autosave when it shouldn't Kelly Dean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jo5UkPhcuHYnlips9IABSot76SUmBbxec4hdytoMlLf@local \
    --to=kelly@prtime.org \
    --cc=19059@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).