diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-12-23 22:46:07 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-12-23 22:46:07 +0000 |
commit | c61a4448418603aca3bbfb31dab2baa52b0899a8 (patch) | |
tree | 5a9971159b72b1f6e2ccf0dcd8a57d4a0509508f /lisp/server.el | |
parent | d03b9b3108cc27e5c8058788ffcb32068ec0d953 (diff) | |
download | emacs-c61a4448418603aca3bbfb31dab2baa52b0899a8.tar.gz |
(server-save-buffers-kill-terminal): Check the `proc' is indeed a process.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/server.el b/lisp/server.el index 4d21959774a..dc534adc0f9 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -1260,21 +1260,25 @@ done that." ;;;###autoload (defun server-save-buffers-kill-terminal (proc &optional arg) + ;; Called from save-buffers-kill-terminal in files.el. "Offer to save each buffer, then kill PROC. With prefix arg, silently save all file-visiting buffers, then kill. If emacsclient was started with a list of filenames to edit, then only these files will be asked to be saved." - (let ((buffers (process-get proc 'buffers))) - ;; If client is bufferless, emulate a normal Emacs session - ;; exit and offer to save all buffers. Otherwise, offer to - ;; save only the buffers belonging to the client. - (save-some-buffers arg - (if buffers - (lambda () (memq (current-buffer) buffers)) - t)) - (server-delete-client proc))) + ;; save-buffers-kill-terminal occasionally calls us with proc set + ;; to `nowait' (comes from the value of the `client' frame parameter). + (when (processp proc) + (let ((buffers (process-get proc 'buffers))) + ;; If client is bufferless, emulate a normal Emacs session + ;; exit and offer to save all buffers. Otherwise, offer to + ;; save only the buffers belonging to the client. + (save-some-buffers arg + (if buffers + (lambda () (memq (current-buffer) buffers)) + t)) + (server-delete-client proc)))) (define-key ctl-x-map "#" 'server-edit) |