Commit 1e00ee24 authored by Kelly Dean's avatar Kelly Dean Committed by Artur Malabarba

desktop.el: Conditionally re-enable desktop autosave

* desktop.el (desktop-read): Conditionally re-enable
desktop autosave. (Bug#19059)
parent 77052f4b
2015-02-16 Kelly Dean <kelly@prtime.org>
* desktop.el (desktop-read): Conditionally re-enable desktop autosave.
(Bug#19059)
2015-02-16 Kelly Dean <kelly@prtime.org>
* help-mode.el (help-do-xref): Prevent duplicated display of Info
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment