diff options
| author | Kelly Dean | 2015-02-16 04:18:25 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-02-17 22:08:51 -0200 |
| commit | 1e00ee2497be60040a20fccb79633c936ccbe2c7 (patch) | |
| tree | e55d0a8633b0a72f6539084c18f9b51e9bb10b52 | |
| parent | 77052f4baa974802021197536f7f5004f471fc48 (diff) | |
| download | emacs-1e00ee2497be60040a20fccb79633c936ccbe2c7.tar.gz emacs-1e00ee2497be60040a20fccb79633c936ccbe2c7.zip | |
desktop.el: Conditionally re-enable desktop autosave
* desktop.el (desktop-read): Conditionally re-enable
desktop autosave. (Bug#19059)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/desktop.el | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4200a7b7dda..b3da9dcaadf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2015-02-16 Kelly Dean <kelly@prtime.org> | 1 | 2015-02-16 Kelly Dean <kelly@prtime.org> |
| 2 | 2 | ||
| 3 | * desktop.el (desktop-read): Conditionally re-enable desktop autosave. | ||
| 4 | (Bug#19059) | ||
| 5 | |||
| 6 | 2015-02-16 Kelly Dean <kelly@prtime.org> | ||
| 7 | |||
| 3 | * help-mode.el (help-do-xref): Prevent duplicated display of Info | 8 | * help-mode.el (help-do-xref): Prevent duplicated display of Info |
| 4 | buffer, and prevent interference with existing buffer. (Bug#13190) | 9 | buffer, and prevent interference with existing buffer. (Bug#13190) |
| 5 | 10 | ||
diff --git a/lisp/desktop.el b/lisp/desktop.el index c2724904b58..b85d8b257a5 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el | |||
| @@ -1136,7 +1136,8 @@ It returns t if a desktop file was loaded, nil otherwise." | |||
| 1136 | (desktop-buffer-fail-count 0) | 1136 | (desktop-buffer-fail-count 0) |
| 1137 | (owner (desktop-owner)) | 1137 | (owner (desktop-owner)) |
| 1138 | ;; Avoid desktop saving during evaluation of desktop buffer. | 1138 | ;; Avoid desktop saving during evaluation of desktop buffer. |
| 1139 | (desktop-save nil)) | 1139 | (desktop-save nil) |
| 1140 | (desktop-autosave-was-enabled)) | ||
| 1140 | (if (and owner | 1141 | (if (and owner |
| 1141 | (memq desktop-load-locked-desktop '(nil ask)) | 1142 | (memq desktop-load-locked-desktop '(nil ask)) |
| 1142 | (or (null desktop-load-locked-desktop) | 1143 | (or (null desktop-load-locked-desktop) |
| @@ -1152,6 +1153,8 @@ Using it may cause conflicts. Use it anyway? " owner))))) | |||
| 1152 | ;; Temporarily disable the autosave that will leave it | 1153 | ;; Temporarily disable the autosave that will leave it |
| 1153 | ;; disabled when loading the desktop fails with errors, | 1154 | ;; disabled when loading the desktop fails with errors, |
| 1154 | ;; thus not overwriting the desktop with broken contents. | 1155 | ;; thus not overwriting the desktop with broken contents. |
| 1156 | (setq desktop-autosave-was-enabled | ||
| 1157 | (memq 'desktop-auto-save-set-timer window-configuration-change-hook)) | ||
| 1155 | (desktop-auto-save-disable) | 1158 | (desktop-auto-save-disable) |
| 1156 | ;; Evaluate desktop buffer and remember when it was modified. | 1159 | ;; Evaluate desktop buffer and remember when it was modified. |
| 1157 | (load (desktop-full-file-name) t t t) | 1160 | (load (desktop-full-file-name) t t t) |
| @@ -1205,7 +1208,7 @@ Using it may cause conflicts. Use it anyway? " owner))))) | |||
| 1205 | (set-window-prev-buffers window nil) | 1208 | (set-window-prev-buffers window nil) |
| 1206 | (set-window-next-buffers window nil)))) | 1209 | (set-window-next-buffers window nil)))) |
| 1207 | (setq desktop-saved-frameset nil) | 1210 | (setq desktop-saved-frameset nil) |
| 1208 | (desktop-auto-save-enable) | 1211 | (if desktop-autosave-was-enabled (desktop-auto-save-enable)) |
| 1209 | t)) | 1212 | t)) |
| 1210 | ;; No desktop file found. | 1213 | ;; No desktop file found. |
| 1211 | (let ((default-directory desktop-dirname)) | 1214 | (let ((default-directory desktop-dirname)) |