Function: server-kill-emacs-query-function
server-kill-emacs-query-function is a byte-compiled function defined
in server.el.gz.
Signature
(server-kill-emacs-query-function)
Documentation
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. 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.
Source Code
;; Defined in /usr/src/emacs/lisp/server.el.gz
(defun server-kill-emacs-query-function ()
"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. 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? "))))