emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2675c79: Fix daemon shutdown when emacs-kill-hooks


From: Eli Zaretskii
Subject: [Emacs-diffs] master 2675c79: Fix daemon shutdown when emacs-kill-hooks ask questions
Date: Mon, 12 Sep 2016 18:27:16 +0000 (UTC)

branch: master
commit 2675c79db5745d55d43b78019b1e6a4f84b168fa
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix daemon shutdown when emacs-kill-hooks ask questions
    
    * lisp/server.el (server-start): Put the server's kill-emacs-hook
    last, to allow other hooks to have a frame to interact with the
    user.  (Bug#24326)
---
 lisp/server.el |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/server.el b/lisp/server.el
index 5300984..85d51c8 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -648,7 +648,12 @@ server or call `\\[server-force-delete]' to forcibly 
disconnect it."))
          (add-hook 'delete-frame-functions 'server-handle-delete-frame)
          (add-hook 'kill-emacs-query-functions
                     'server-kill-emacs-query-function)
-         (add-hook 'kill-emacs-hook 'server-force-stop) ;Cleanup upon exit.
+          ;; We put server's kill-emacs-hook after the others, so that
+          ;; frames are not deleted too early, because doing that
+          ;; would severely degrade our abilities to communicate with
+          ;; the user, while some hooks may wish to ask the user
+          ;; questions (e.g., desktop-kill).
+         (add-hook 'kill-emacs-hook 'server-force-stop t) ;Cleanup upon exit.
          (setq server-process
                (apply #'make-network-process
                       :name server-name



reply via email to

[Prev in Thread] Current Thread [Next in Thread]