# HG changeset patch # User Stefan Monnier # Date 1198449967 0 # Node ID cd847b2ba99f891b438c4d1a375f62101ed6ca30 # Parent 7fb15af635f403c0d2ed91e74ce2f546f67e344e (server-save-buffers-kill-terminal): Check the `proc' is indeed a process. diff -r 7fb15af635f4 -r cd847b2ba99f lisp/ChangeLog --- a/lisp/ChangeLog Sun Dec 23 21:46:25 2007 +0000 +++ b/lisp/ChangeLog Sun Dec 23 22:46:07 2007 +0000 @@ -1,3 +1,8 @@ +2007-12-23 Stefan Monnier + + * server.el (server-save-buffers-kill-terminal): Check the `proc' is + indeed a process. + 2007-12-23 Richard Stallman * simple.el (region-active-p): New function. diff -r 7fb15af635f4 -r cd847b2ba99f lisp/server.el --- a/lisp/server.el Sun Dec 23 21:46:25 2007 +0000 +++ b/lisp/server.el Sun Dec 23 22:46:07 2007 +0000 @@ -1260,21 +1260,25 @@ ;;;###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)