Commit b4ca0271 authored by Karoly Lorentey's avatar Karoly Lorentey

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
parent 422f68e0
......@@ -4570,7 +4570,7 @@ With prefix arg, silently save all file-visiting buffers, then kill."
(define-key ctl-x-map "i" 'insert-file)
(define-key esc-map "~" 'not-modified)
(define-key ctl-x-map "\C-d" 'list-directory)
(define-key ctl-x-map "\C-c" 'save-buffers-kill-emacs)
(define-key ctl-x-map "\C-c" 'server-save-buffers-kill-display)
(define-key ctl-x-map "\C-q" 'toggle-read-only)
(define-key ctl-x-4-map "f" 'find-file-other-window)
......
......@@ -883,7 +883,20 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
;; a minibuffer/dedicated-window (if there's no other).
(error (pop-to-buffer next-buffer)))))))))
(global-set-key "\C-x#" 'server-edit)
(defun server-save-buffers-kill-display (&optional arg)
"Offer to save each buffer, then kill the current connection.
If the current frame has no client, kill Emacs itself.
With prefix arg, silently save all file-visiting buffers, then kill."
(interactive "P")
(let ((proc (frame-parameter (selected-frame) 'client)))
(if (and proc)
(progn
(save-some-buffers arg t)
(server-delete-client proc))
(save-buffers-kill-emacs))))
(global-set-key "\C-#" 'server-edit)
;;;###autoload
(defun server-getenv (variable &optional frame)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment