diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-05-28 17:22:31 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-05-28 17:22:31 +0000 |
commit | e82e73c21a154bcc783dfde4c3d93af51187577a (patch) | |
tree | 4654df01f49446e79709ad064d31fd5b35c9a842 /lisp/server.el | |
parent | b22f3a199c48244fa1c1bed16ca15412009b1c90 (diff) | |
download | emacs-e82e73c21a154bcc783dfde4c3d93af51187577a.tar.gz |
(server-visit-files): Bind last-nonmenu-event.
(server-kill-emacs-query-function): Ignore killed buffers.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/server.el b/lisp/server.el index 1d175bfa7de..47f3ce0c4d5 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -92,7 +92,7 @@ (defvar server-clients nil "List of current server clients. -Each element is (CLIENTID FILES...) where CLIENTID is a string +Each element is (CLIENTID BUFFERS...) where CLIENTID is a string that can be given to the server process to identify a client. When a buffer is marked as \"done\", it is removed from this list.") @@ -197,7 +197,8 @@ Prefix arg means just kill any existing server communications subprocess." (defun server-visit-files (files client) "Finds FILES and returns the list CLIENT with the buffers nconc'd. FILES is an alist whose elements are (FILENAME LINENUMBER)." - (let (client-record (obuf (current-buffer))) + ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries. + (let (client-record (last-nonmenu-event t) (obuf (current-buffer))) ;; Restore the current buffer afterward, but not using save-excursion, ;; because we don't want to save point in this buffer ;; if it happens to be one of those specified by the server. @@ -299,8 +300,15 @@ Then bury it, and return a suggested buffer to select next." 'server-kill-buffer-query-function) (defun server-kill-emacs-query-function () - (or (not server-clients) - (yes-or-no-p "Server buffers still have clients; exit anyway? "))) + (let (live-client + (tail server-clients)) + ;; See if any clients have any buffers that are still alive. + (while tail + (if (memq t (mapcar 'stringp (mapcar 'buffer-name (cdr (car tail))))) + (setq live-client t)) + (setq tail (cdr tail))) + (or (not live-client) + (yes-or-no-p "Server buffers still have clients; exit anyway? ")))) (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function) |