aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-07-02 17:29:10 +0200
committerLars Ingebrigtsen2021-07-02 17:29:23 +0200
commit5bd04ea307f1dfc5002715a23b8bea1c038f65a6 (patch)
tree8c361035ef9faaa0f7973fe8d2be2611c14fc84a
parent225ca617b70d3c70376c2d9bf38ced2f2323b26e (diff)
downloademacs-5bd04ea307f1dfc5002715a23b8bea1c038f65a6.tar.gz
emacs-5bd04ea307f1dfc5002715a23b8bea1c038f65a6.zip
Don't have desktop-save-mode query on `M-x kill-emacs'
* lisp/desktop.el (noninteractive): Prompting functions should not be added to `kill-emacs-hook' (bug#28943). (desktop-kill): Return t so that it can be used from `kill-emacs-query-functions'.
-rw-r--r--lisp/desktop.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el
index fb7c6c79a1a..ae8d026acc4 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -731,7 +731,7 @@ if different)."
731 731
732;; ---------------------------------------------------------------------------- 732;; ----------------------------------------------------------------------------
733(unless noninteractive 733(unless noninteractive
734 (add-hook 'kill-emacs-hook #'desktop-kill)) 734 (add-hook 'kill-emacs-query-functions #'desktop-kill))
735 735
736(defun desktop-kill () 736(defun desktop-kill ()
737 "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do. 737 "If `desktop-save-mode' is non-nil, do what `desktop-save' says to do.
@@ -759,7 +759,8 @@ is nil, ask the user where to save the desktop."
759 (unless (yes-or-no-p "Error while saving the desktop. Ignore? ") 759 (unless (yes-or-no-p "Error while saving the desktop. Ignore? ")
760 (signal (car err) (cdr err)))))) 760 (signal (car err) (cdr err))))))
761 ;; If we own it, we don't anymore. 761 ;; If we own it, we don't anymore.
762 (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock))) 762 (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock))
763 t)
763 764
764;; ---------------------------------------------------------------------------- 765;; ----------------------------------------------------------------------------
765(defun desktop-list* (&rest args) 766(defun desktop-list* (&rest args)