emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1e00ee2 3/8: desktop.el: Conditionally re-enable de


From: Artur Malabarba
Subject: [Emacs-diffs] master 1e00ee2 3/8: desktop.el: Conditionally re-enable desktop autosave
Date: Tue, 17 Feb 2015 23:17:56 +0000

branch: master
commit 1e00ee2497be60040a20fccb79633c936ccbe2c7
Author: Kelly Dean <address@hidden>
Commit: Artur Malabarba <address@hidden>

    desktop.el: Conditionally re-enable desktop autosave
    
    * desktop.el (desktop-read): Conditionally re-enable
    desktop autosave. (Bug#19059)
---
 lisp/ChangeLog  |    5 +++++
 lisp/desktop.el |    7 +++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4200a7b..b3da9dc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
 2015-02-16  Kelly Dean  <address@hidden>
 
+       * desktop.el (desktop-read): Conditionally re-enable desktop autosave.
+       (Bug#19059)
+
+2015-02-16  Kelly Dean  <address@hidden>
+
        * help-mode.el (help-do-xref): Prevent duplicated display of Info
        buffer, and prevent interference with existing buffer. (Bug#13190)
 
diff --git a/lisp/desktop.el b/lisp/desktop.el
index c272490..b85d8b2 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1136,7 +1136,8 @@ It returns t if a desktop file was loaded, nil otherwise."
              (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)
@@ -1152,6 +1153,8 @@ Using it may cause conflicts.  Use it anyway? " owner)))))
            ;; 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)
@@ -1205,7 +1208,7 @@ Using it may cause conflicts.  Use it anyway? " owner)))))
                                  (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.
       (let ((default-directory desktop-dirname))



reply via email to

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