unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* save-buffers-kill-terminal and emacsclient --no-wait
@ 2008-12-31  9:46 Ulrich Mueller
  2008-12-31 10:06 ` Thorsten Bonow
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Mueller @ 2008-12-31  9:46 UTC (permalink / raw)
  To: emacs-devel

Hi,

is the following a bug, or the intended behaviour:

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

Now save-buffers-kill-terminal (bound to C-x C-c) in this frame does
just nothing.

I would expect it to do the following:
- offer to save buffers
- call delete-frame

Ulrich




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save-buffers-kill-terminal and emacsclient --no-wait
  2008-12-31  9:46 save-buffers-kill-terminal and emacsclient --no-wait Ulrich Mueller
@ 2008-12-31 10:06 ` Thorsten Bonow
  2008-12-31 10:26   ` Thorsten Bonow
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Bonow @ 2008-12-31 10:06 UTC (permalink / raw)
  To: ulm; +Cc: emacs-devel

>>>>> "Ulrich" == Ulrich Mueller <ulm@gentoo.org> writes:

    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 frame does
    Ulrich> just nothing.

    Ulrich> I would expect it to do the following:
    Ulrich> - offer to save buffers
    Ulrich> - call delete-frame

Not if you had read the manual ;-) It is the documented behaviour:

   If you type `C-x C-c' (`save-buffers-kill-terminal') in an Emacs
frame created with `emacsclient', via the `-c' or `-t' options, Emacs
deletes the frame instead of killing the Emacs process itself.  On a
text-only terminal frame created with the `-t' option, this returns
control to the terminal.  Emacs also marks all the server buffers for
the client as finished, as though you had typed `C-x #' in all of them.

   When Emacs is started as a daemon, all frames are considered client
frames, so `C-x C-c' will never kill Emacs.  To kill the Emacs process,
type `M-x kill-emacs'.

(Quoted from "42.2 `emacsclient' Options")


    Ulrich> Ulrich

Best wishes for the new year and all that ...

Toto

-- 
Contact information and PGP key at
http://www.withouthat.org/~toto/contact.html

...wir sind Deserteure! Kein Land auf das ich schw^[$(D+S^[(Bre.

Wolf Mahn und die Deserteure




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save-buffers-kill-terminal and emacsclient --no-wait
  2008-12-31 10:06 ` Thorsten Bonow
@ 2008-12-31 10:26   ` Thorsten Bonow
  2008-12-31 11:32     ` Ulrich Mueller
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Bonow @ 2008-12-31 10:26 UTC (permalink / raw)
  To: ulm; +Cc: emacs-devel

>>>>> "Toto" == Thorsten Bonow <toto@withouthat.org> writes:

>>>>> "Ulrich" == Ulrich Mueller <ulm@gentoo.org> writes:
    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 frame does
    Ulrich> just nothing.
    
    [...]

    Toto> Not if you had read the manual ;-) It is the documented 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, Emacs
    Toto> deletes the frame instead of killing the Emacs process 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 :-)

    Sorry for the noise. First resolution for the new year: Read postings more
    carefully before responding...

    Toto

    Toto> -- Contact information and PGP key at
    Toto> http://www.withouthat.org/~toto/contact.html

    Toto> ...wir sind Deserteure! Kein Land auf das ich schw^[$(D+S^[(Bre.

    Toto> Wolf Mahn und die Deserteure



-- 
Contact information and PGP key at
http://www.withouthat.org/~toto/contact.html

Put the word "implement" in your resume and you won't get phoned
back.

Douglas Coupland: JPod




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save-buffers-kill-terminal and emacsclient --no-wait
  2008-12-31 10:26   ` Thorsten Bonow
@ 2008-12-31 11:32     ` Ulrich Mueller
  2008-12-31 17:54       ` Thorsten Bonow
  0 siblings, 1 reply; 5+ messages in thread
From: Ulrich Mueller @ 2008-12-31 11:32 UTC (permalink / raw)
  To: Thorsten Bonow; +Cc: emacs-devel

>>>>> 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)))))
 
 \f
 ;; We use /: as a prefix to "quote" a file name




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: save-buffers-kill-terminal and emacsclient --no-wait
  2008-12-31 11:32     ` Ulrich Mueller
@ 2008-12-31 17:54       ` Thorsten Bonow
  0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Bonow @ 2008-12-31 17:54 UTC (permalink / raw)
  To: ulm; +Cc: emacs-devel

>>>>> "Ulrich" == Ulrich Mueller <ulm@gentoo.org> writes:

    [...]
  
    Ulrich> Maybe a patch will clarify what I meant with "expected behaviour":

    Ulrich> --- lisp/files.el.~1.1030.~
    Ulrich> [...]

Yup, now that I have started thinking about it, I agree with you. I patched
files.el; looks good to me. I tried out your version of the defun. Works for me.

I think this should be changed.

Thanks for not giving up on me.

Toto

PS: I subscribed to emacs-devel, no need to CC me. Thx. Do I have to CC you?

-- 
Contact information and PGP key at
http://www.withouthat.org/~toto/contact.html

Liberalism is a philosophy of consolation for Western
Civilization as it commits suicide.---Jerry Pournelle

http://www.jerrypournelle.com/view/view449.html#Monday




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-31 17:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-31  9:46 save-buffers-kill-terminal and emacsclient --no-wait Ulrich Mueller
2008-12-31 10:06 ` Thorsten Bonow
2008-12-31 10:26   ` Thorsten Bonow
2008-12-31 11:32     ` Ulrich Mueller
2008-12-31 17:54       ` Thorsten Bonow

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).