diff options
| -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." | |||
| 1589 | (server-buffer-done (current-buffer)))) | 1589 | (server-buffer-done (current-buffer)))) |
| 1590 | 1590 | ||
| 1591 | (defun server-kill-emacs-query-function () | 1591 | (defun server-kill-emacs-query-function () |
| 1592 | "Ask before exiting Emacs if it has live clients. | 1592 | "Ask before exiting Emacs if it has other live clients. |
| 1593 | A \"live client\" is a client with at least one live buffer | 1593 | A \"live client\" is a client with at least one live buffer |
| 1594 | associated with it." | 1594 | associated with it. These clients were (probably) started by |
| 1595 | (or (not (seq-some (lambda (proc) | 1595 | external processes that are waiting for some buffers to be |
| 1596 | (seq-some #'buffer-live-p | 1596 | edited. If there are any other clients, we don't want to fail |
| 1597 | (process-get proc 'buffers))) | 1597 | their waiting processes, so ask the user to be sure." |
| 1598 | server-clients)) | 1598 | (let ((this-client (frame-parameter nil 'client))) |
| 1599 | (yes-or-no-p "This Emacs session has clients; exit anyway? "))) | 1599 | (or (not (seq-some (lambda (proc) |
| 1600 | (unless (eq proc this-client) | ||
| 1601 | (seq-some #'buffer-live-p | ||
| 1602 | (process-get proc 'buffers)))) | ||
| 1603 | server-clients)) | ||
| 1604 | (yes-or-no-p "This Emacs session has other clients; exit anyway? ")))) | ||
| 1600 | 1605 | ||
| 1601 | (defun server-kill-buffer () | 1606 | (defun server-kill-buffer () |
| 1602 | "Remove the current buffer from its clients' buffer list. | 1607 | "Remove the current buffer from its clients' buffer list. |