diff options
| author | Kenichi Handa <handa@gnu.org> | 2014-07-05 23:07:57 +0900 |
|---|---|---|
| committer | Kenichi Handa <handa@gnu.org> | 2014-07-05 23:07:57 +0900 |
| commit | aeb894a9a06d84d29b93ca04432d7cbed366e665 (patch) | |
| tree | e2b73f9a76bc826c7a443e9a8d4fb3b49bdf7332 /lisp/desktop.el | |
| parent | 763a11d0d0dcf543e89a22c98f55ea07c40ceefa (diff) | |
| parent | a984543a4488ed08778eb775d62f7091db117945 (diff) | |
| download | emacs-aeb894a9a06d84d29b93ca04432d7cbed366e665.tar.gz | |
merge trunk
Diffstat (limited to 'lisp/desktop.el')
| -rw-r--r-- | lisp/desktop.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el index 26d288bf9cd..4bb6fba3532 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -942,12 +942,13 @@ Frames with a non-nil `desktop-dont-save' parameter are not saved." :predicate #'desktop--check-dont-save)))) ;;;###autoload -(defun desktop-save (dirname &optional release auto-save) +(defun desktop-save (dirname &optional release only-if-changed) "Save the desktop in a desktop file. Parameter DIRNAME specifies where to save the desktop file. Optional parameter RELEASE says whether we're done with this desktop. -If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, -and don't save the buffer if they are the same." +If ONLY-IF-CHANGED is non-nil, compare the current desktop information +to that in the desktop file, and if the desktop information has not +changed since it was last saved then do not rewrite the file." (interactive (list ;; Or should we just use (car desktop-path)? (let ((default (if (member "." desktop-path) @@ -1020,7 +1021,7 @@ and don't save the buffer if they are the same." (setq default-directory desktop-dirname) ;; When auto-saving, avoid writing if nothing has changed since the last write. - (let* ((beg (and auto-save + (let* ((beg (and only-if-changed (save-excursion (goto-char (point-min)) ;; Don't check the header with changing timestamp |
