diff options
| author | Juri Linkov | 2014-07-03 02:45:12 +0300 |
|---|---|---|
| committer | Juri Linkov | 2014-07-03 02:45:12 +0300 |
| commit | cbb6a7aeff3b901645ee8e4f2c4abeceafdfc073 (patch) | |
| tree | d7a19fbbf00f73b080b4d2e5aab2ddfce8fe0500 | |
| parent | 4991d13037d4154b3c52d1a2f516714fbcf0e6eb (diff) | |
| download | emacs-cbb6a7aeff3b901645ee8e4f2c4abeceafdfc073.tar.gz emacs-cbb6a7aeff3b901645ee8e4f2c4abeceafdfc073.zip | |
* lisp/desktop.el (desktop-save): Rename arg `auto-save' to `only-if-changed'.
Doc fix.
Fixes: debbugs:17873
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/desktop.el | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d9224d0b747..73f1f286c43 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-07-02 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * desktop.el (desktop-save): Rename arg `auto-save' to | ||
| 4 | `only-if-changed'. Doc fix. (Bug#17873) | ||
| 5 | |||
| 1 | 2014-07-02 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2014-07-02 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * mouse.el (mouse-yank-primary, mouse-yank-secondary): | 8 | * mouse.el (mouse-yank-primary, mouse-yank-secondary): |
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." | |||
| 942 | :predicate #'desktop--check-dont-save)))) | 942 | :predicate #'desktop--check-dont-save)))) |
| 943 | 943 | ||
| 944 | ;;;###autoload | 944 | ;;;###autoload |
| 945 | (defun desktop-save (dirname &optional release auto-save) | 945 | (defun desktop-save (dirname &optional release only-if-changed) |
| 946 | "Save the desktop in a desktop file. | 946 | "Save the desktop in a desktop file. |
| 947 | Parameter DIRNAME specifies where to save the desktop file. | 947 | Parameter DIRNAME specifies where to save the desktop file. |
| 948 | Optional parameter RELEASE says whether we're done with this desktop. | 948 | Optional parameter RELEASE says whether we're done with this desktop. |
| 949 | If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, | 949 | If ONLY-IF-CHANGED is non-nil, compare the current desktop information |
| 950 | and don't save the buffer if they are the same." | 950 | to that in the desktop file, and if the desktop information has not |
| 951 | changed since it was last saved then do not rewrite the file." | ||
| 951 | (interactive (list | 952 | (interactive (list |
| 952 | ;; Or should we just use (car desktop-path)? | 953 | ;; Or should we just use (car desktop-path)? |
| 953 | (let ((default (if (member "." desktop-path) | 954 | (let ((default (if (member "." desktop-path) |
| @@ -1020,7 +1021,7 @@ and don't save the buffer if they are the same." | |||
| 1020 | 1021 | ||
| 1021 | (setq default-directory desktop-dirname) | 1022 | (setq default-directory desktop-dirname) |
| 1022 | ;; When auto-saving, avoid writing if nothing has changed since the last write. | 1023 | ;; When auto-saving, avoid writing if nothing has changed since the last write. |
| 1023 | (let* ((beg (and auto-save | 1024 | (let* ((beg (and only-if-changed |
| 1024 | (save-excursion | 1025 | (save-excursion |
| 1025 | (goto-char (point-min)) | 1026 | (goto-char (point-min)) |
| 1026 | ;; Don't check the header with changing timestamp | 1027 | ;; Don't check the header with changing timestamp |