1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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
This commit is contained in:
Karoly Lorentey 2004-08-16 19:54:16 +00:00
parent 422f68e04e
commit b4ca027117
2 changed files with 15 additions and 2 deletions

View file

@ -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)