diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-10-09 15:53:27 -0700 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2022-10-10 15:09:21 -0700 |
commit | ebc19f56aaeb98b834eea1ce8768ca13bed8578c (patch) | |
tree | 80102e7660ae6b31f6f7c9106291ec82e48f1519 /lisp/server.el | |
parent | 5df95ba039d93b26b11adcf61646467cd7174740 (diff) | |
download | emacs-ebc19f56aaeb98b834eea1ce8768ca13bed8578c.tar.gz |
Don't prompt when killing an Emacs client if it's the last client
* lisp/server.el (server-kill-emacs-query-function): Ignore the
current client (if any) when checking for live clients (bug#58404).
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lisp/server.el b/lisp/server.el index 3caa335c4eb..90d97c1538e 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1589,14 +1589,19 @@ specifically for the clients and did not exist before their request for it." (server-buffer-done (current-buffer)))) (defun server-kill-emacs-query-function () - "Ask before exiting Emacs if it has live clients. + "Ask before exiting Emacs if it has other live clients. A \"live client\" is a client with at least one live buffer -associated with it." - (or (not (seq-some (lambda (proc) - (seq-some #'buffer-live-p - (process-get proc 'buffers))) - server-clients)) - (yes-or-no-p "This Emacs session has clients; exit anyway? "))) +associated with it. These clients were (probably) started by +external processes that are waiting for some buffers to be +edited. If there are any other clients, we don't want to fail +their waiting processes, so ask the user to be sure." + (let ((this-client (frame-parameter nil 'client))) + (or (not (seq-some (lambda (proc) + (unless (eq proc this-client) + (seq-some #'buffer-live-p + (process-get proc 'buffers)))) + server-clients)) + (yes-or-no-p "This Emacs session has other clients; exit anyway? ")))) (defun server-kill-buffer () "Remove the current buffer from its clients' buffer list. |