diff options
| author | Karoly Lorentey | 2005-02-10 21:23:33 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-02-10 21:23:33 +0000 |
| commit | 7540c1e0ea7ac7767c96a69df330abd108a7247a (patch) | |
| tree | 049961ad2ee44fe4fb7a27587ba9f2dcdc44acba | |
| parent | bdfec2134d38a605c95baab0e38ef321a6b1d59e (diff) | |
| download | emacs-7540c1e0ea7ac7767c96a69df330abd108a7247a.tar.gz emacs-7540c1e0ea7ac7767c96a69df330abd108a7247a.zip | |
On C-x C-c, restrict `save-some-buffers' to the client's buffers. (Reported by Han Boetes.)
* lisp/server.el (server-kill-emacs-query-function): Fix typo in docs.
(server-save-buffers-kill-display): If emacsclient was started with a
list of filenames to edit, then offer to save only these buffers.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-291
| -rw-r--r-- | lisp/server.el | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lisp/server.el b/lisp/server.el index ec4bb3534ba..d8bd83b839f 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -922,7 +922,7 @@ specifically for the clients and did not exist before their request for it." | |||
| 922 | (buffer-name (current-buffer)))))) | 922 | (buffer-name (current-buffer)))))) |
| 923 | 923 | ||
| 924 | (defun server-kill-emacs-query-function () | 924 | (defun server-kill-emacs-query-function () |
| 925 | "Ask before exiting Emacs it has are live clients." | 925 | "Ask before exiting Emacs it has live clients." |
| 926 | (or (not server-clients) | 926 | (or (not server-clients) |
| 927 | (let (live-client) | 927 | (let (live-client) |
| 928 | (dolist (client server-clients live-client) | 928 | (dolist (client server-clients live-client) |
| @@ -1031,12 +1031,21 @@ done that." | |||
| 1031 | "Offer to save each buffer, then kill the current connection. | 1031 | "Offer to save each buffer, then kill the current connection. |
| 1032 | If the current frame has no client, kill Emacs itself. | 1032 | If the current frame has no client, kill Emacs itself. |
| 1033 | 1033 | ||
| 1034 | With prefix arg, silently save all file-visiting buffers, then kill." | 1034 | With prefix arg, silently save all file-visiting buffers, then kill. |
| 1035 | |||
| 1036 | If emacsclient was started with a list of filenames to edit, then | ||
| 1037 | only these files will be asked to be saved." | ||
| 1035 | (interactive "P") | 1038 | (interactive "P") |
| 1036 | (let ((proc (frame-parameter (selected-frame) 'client))) | 1039 | (let ((proc (frame-parameter (selected-frame) 'client))) |
| 1037 | (if (and proc) | 1040 | (if proc |
| 1038 | (progn | 1041 | (let ((buffers (server-client-get proc 'buffers))) |
| 1039 | (save-some-buffers arg t) | 1042 | ;; If client is bufferless, emulate a normal Emacs session |
| 1043 | ;; exit and offer to save all buffers. Otherwise, offer to | ||
| 1044 | ;; save only the buffers belonging to the client. | ||
| 1045 | (save-some-buffers arg | ||
| 1046 | (if buffers | ||
| 1047 | (lambda () (memq (current-buffer) buffers)) | ||
| 1048 | t)) | ||
| 1040 | (server-delete-client proc)) | 1049 | (server-delete-client proc)) |
| 1041 | (save-buffers-kill-emacs)))) | 1050 | (save-buffers-kill-emacs)))) |
| 1042 | 1051 | ||