diff options
| author | Karoly Lorentey | 2004-08-16 19:54:16 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-08-16 19:54:16 +0000 |
| commit | b4ca0271173a25dcff0f0ce0ce534b49825c1a22 (patch) | |
| tree | 621ce7670a8ce13978fa604ff8570a59abd6c933 | |
| parent | 422f68e04e254e9ec704fffb7a0fbbda5897c41e (diff) | |
| download | emacs-b4ca0271173a25dcff0f0ce0ce534b49825c1a22.tar.gz emacs-b4ca0271173a25dcff0f0ce0ce534b49825c1a22.zip | |
Change binding of C-x C-c to only exit emacsclient, not Emacs itself.
* lisp/server.el (server-save-buffers-kill-display): New function.
* lisp/files.el (ctl-x-map): Change binding of C-x C-c to
server-save-buffers-kill-display.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-232
| -rw-r--r-- | lisp/files.el | 2 | ||||
| -rw-r--r-- | lisp/server.el | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index da1e7128a94..208f0b915ae 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -4570,7 +4570,7 @@ With prefix arg, silently save all file-visiting buffers, then kill." | |||
| 4570 | (define-key ctl-x-map "i" 'insert-file) | 4570 | (define-key ctl-x-map "i" 'insert-file) |
| 4571 | (define-key esc-map "~" 'not-modified) | 4571 | (define-key esc-map "~" 'not-modified) |
| 4572 | (define-key ctl-x-map "\C-d" 'list-directory) | 4572 | (define-key ctl-x-map "\C-d" 'list-directory) |
| 4573 | (define-key ctl-x-map "\C-c" 'save-buffers-kill-emacs) | 4573 | (define-key ctl-x-map "\C-c" 'server-save-buffers-kill-display) |
| 4574 | (define-key ctl-x-map "\C-q" 'toggle-read-only) | 4574 | (define-key ctl-x-map "\C-q" 'toggle-read-only) |
| 4575 | 4575 | ||
| 4576 | (define-key ctl-x-4-map "f" 'find-file-other-window) | 4576 | (define-key ctl-x-4-map "f" 'find-file-other-window) |
diff --git a/lisp/server.el b/lisp/server.el index f7dba625707..615762a3e01 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -883,7 +883,20 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it." | |||
| 883 | ;; a minibuffer/dedicated-window (if there's no other). | 883 | ;; a minibuffer/dedicated-window (if there's no other). |
| 884 | (error (pop-to-buffer next-buffer))))))))) | 884 | (error (pop-to-buffer next-buffer))))))))) |
| 885 | 885 | ||
| 886 | (global-set-key "\C-x#" 'server-edit) | 886 | (defun server-save-buffers-kill-display (&optional arg) |
| 887 | "Offer to save each buffer, then kill the current connection. | ||
| 888 | If the current frame has no client, kill Emacs itself. | ||
| 889 | |||
| 890 | With prefix arg, silently save all file-visiting buffers, then kill." | ||
| 891 | (interactive "P") | ||
| 892 | (let ((proc (frame-parameter (selected-frame) 'client))) | ||
| 893 | (if (and proc) | ||
| 894 | (progn | ||
| 895 | (save-some-buffers arg t) | ||
| 896 | (server-delete-client proc)) | ||
| 897 | (save-buffers-kill-emacs)))) | ||
| 898 | |||
| 899 | (global-set-key "\C-#" 'server-edit) | ||
| 887 | 900 | ||
| 888 | ;;;###autoload | 901 | ;;;###autoload |
| 889 | (defun server-getenv (variable &optional frame) | 902 | (defun server-getenv (variable &optional frame) |