[Top][All Lists]

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

Re: save-buffers-kill-terminal and emacsclient --no-wait

From: Ulrich Mueller
Subject: Re: save-buffers-kill-terminal and emacsclient --no-wait
Date: Wed, 31 Dec 2008 12:32:35 +0100

>>>>> On Wed, 31 Dec 2008, Thorsten Bonow wrote:

Ulrich> Hi, is the following a bug, or the intended behaviour:

Ulrich> $ emacs --daemon $ emacsclient --create-frame --no-wait

Ulrich> Now save-buffers-kill-terminal (bound to C-x C-c) in this
Ulrich> frame does just nothing.
Toto> Not if you had read the manual ;-) It is the documented
Toto> behaviour:

Toto> If you type `C-x C-c' (`save-buffers-kill-terminal') in an Emacs
Toto> frame created with `emacsclient', via the `-c' or `-t' options,
Toto> Emacs deletes the frame instead of killing the Emacs process
Toto> itself. [...]

> But you're right to expect it to call (delete-frame)---which it
> doesn't call under X. Works on the terminal (if you omit the
> --no-wait option). So there is a bug---either in the code or in the
> manual :-)

Maybe a patch will clarify what I meant with "expected behaviour":

--- lisp/files.el.~1.1030.~
+++ lisp/files.el
@@ -5733,9 +5733,14 @@
   (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))))
+    (cond
+     ((null proc)
+      (save-buffers-kill-emacs))
+     ((processp proc)
+      (server-save-buffers-kill-terminal proc arg))
+     (t
+      (save-some-buffers arg t)
+      (delete-frame)))))
 ;; We use /: as a prefix to "quote" a file name

reply via email to

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