emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el,v
Date: Wed, 29 Aug 2007 05:28:39 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/08/29 05:28:10

Index: lisp/files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.925
retrieving revision 1.926
diff -u -b -r1.925 -r1.926
--- lisp/files.el       25 Aug 2007 14:09:02 -0000      1.925
+++ lisp/files.el       29 Aug 2007 05:28:02 -0000      1.926
@@ -2485,6 +2485,7 @@
        minor-mode-overriding-map-alist
        mode-line-buffer-identification
        mode-line-format
+       mode-line-client
        mode-line-modes
        mode-line-modified
        mode-line-mule-info
@@ -5300,6 +5301,22 @@
           (funcall confirm-kill-emacs "Really exit Emacs? "))
        (kill-emacs)))
 
+(defun save-buffers-kill-terminal (&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.
+
+If emacsclient was started with a list of filenames to edit, then
+only these files will be asked to be saved."
+  (interactive "P")
+  (let ((proc (frame-parameter (selected-frame) 'client))
+       (frame (selected-frame)))
+    (if (null proc)
+       (save-buffers-kill-emacs)
+      (server-save-buffers-kill-terminal proc arg))))
+
+
 ;; We use /: as a prefix to "quote" a file name
 ;; so that magic file name handlers will not apply to it.
 
@@ -5396,7 +5413,7 @@
 (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" 'save-buffers-kill-terminal)
 (define-key ctl-x-map "\C-q" 'toggle-read-only)
 
 (define-key ctl-x-4-map "f" 'find-file-other-window)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]