diff options
| author | Stefan Monnier | 2007-12-23 22:46:07 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-12-23 22:46:07 +0000 |
| commit | c61a4448418603aca3bbfb31dab2baa52b0899a8 (patch) | |
| tree | 5a9971159b72b1f6e2ccf0dcd8a57d4a0509508f | |
| parent | d03b9b3108cc27e5c8058788ffcb32068ec0d953 (diff) | |
| download | emacs-c61a4448418603aca3bbfb31dab2baa52b0899a8.tar.gz emacs-c61a4448418603aca3bbfb31dab2baa52b0899a8.zip | |
(server-save-buffers-kill-terminal): Check the `proc' is indeed a process.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/server.el | 22 |
2 files changed, 18 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 76dfeb27f05..f02cfe5d894 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-12-23 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * server.el (server-save-buffers-kill-terminal): Check the `proc' is | ||
| 4 | indeed a process. | ||
| 5 | |||
| 1 | 2007-12-23 Richard Stallman <rms@gnu.org> | 6 | 2007-12-23 Richard Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * simple.el (region-active-p): New function. | 8 | * simple.el (region-active-p): New function. |
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." | |||
| 1260 | 1260 | ||
| 1261 | ;;;###autoload | 1261 | ;;;###autoload |
| 1262 | (defun server-save-buffers-kill-terminal (proc &optional arg) | 1262 | (defun server-save-buffers-kill-terminal (proc &optional arg) |
| 1263 | ;; Called from save-buffers-kill-terminal in files.el. | ||
| 1263 | "Offer to save each buffer, then kill PROC. | 1264 | "Offer to save each buffer, then kill PROC. |
| 1264 | 1265 | ||
| 1265 | With prefix arg, silently save all file-visiting buffers, then kill. | 1266 | With prefix arg, silently save all file-visiting buffers, then kill. |
| 1266 | 1267 | ||
| 1267 | If emacsclient was started with a list of filenames to edit, then | 1268 | If emacsclient was started with a list of filenames to edit, then |
| 1268 | only these files will be asked to be saved." | 1269 | only these files will be asked to be saved." |
| 1269 | (let ((buffers (process-get proc 'buffers))) | 1270 | ;; save-buffers-kill-terminal occasionally calls us with proc set |
| 1270 | ;; If client is bufferless, emulate a normal Emacs session | 1271 | ;; to `nowait' (comes from the value of the `client' frame parameter). |
| 1271 | ;; exit and offer to save all buffers. Otherwise, offer to | 1272 | (when (processp proc) |
| 1272 | ;; save only the buffers belonging to the client. | 1273 | (let ((buffers (process-get proc 'buffers))) |
| 1273 | (save-some-buffers arg | 1274 | ;; If client is bufferless, emulate a normal Emacs session |
| 1274 | (if buffers | 1275 | ;; exit and offer to save all buffers. Otherwise, offer to |
| 1275 | (lambda () (memq (current-buffer) buffers)) | 1276 | ;; save only the buffers belonging to the client. |
| 1276 | t)) | 1277 | (save-some-buffers arg |
| 1277 | (server-delete-client proc))) | 1278 | (if buffers |
| 1279 | (lambda () (memq (current-buffer) buffers)) | ||
| 1280 | t)) | ||
| 1281 | (server-delete-client proc)))) | ||
| 1278 | 1282 | ||
| 1279 | (define-key ctl-x-map "#" 'server-edit) | 1283 | (define-key ctl-x-map "#" 'server-edit) |
| 1280 | 1284 | ||