GNU bug report logs - #11102
24.0.94; C-x C-c from a client frame sometimes kills the whole Emacs process

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Tue, 27 Mar 2012 19:29:01 UTC

Severity: normal

Found in version 24.0.94

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chong Yidong <cyd <at> gnu.org>
Cc: lekktu <at> gmail.com, 11102 <at> debbugs.gnu.org
Subject: bug#11102: 24.0.94; C-x C-c from a client frame sometimes kills the whole Emacs process
Date: Sat, 14 Apr 2012 10:25:42 +0300
> From: Chong Yidong <cyd <at> gnu.org>
> Cc: Juanma Barranquero <lekktu <at> gmail.com>,  11102 <at> debbugs.gnu.org
> Date: Sat, 14 Apr 2012 13:34:27 +0800
> 
> Chong Yidong <cyd <at> gnu.org> writes:
> 
> > If on a client frame created by "emacsclient -c -n" the C-x C-c command
> > kills Emacs, that is indeed a bug.  My guess would be that the `client'
> > frame parameter is not getting correctly assigned to the newly-created
> > frame on Windows, due to the extra juggling in the #ifdef WINDOWSNT code
> > segment Juanma pointed out.
> 
> Took a quick look, and indeed the "set tty = 1 on Windows" hack does
> seem to be at fault.

Like I said, I see the same "bug" on GNU/Linux, when the server runs
in a TTY session (couldn't check in a GUI session).  Are you talking
about GUI sessions only?

> Here's my diagnosis:
> 
>   if (tty || !current_frame)
>     {
>       display = (const char *) ttyname (0);  /* Arg is ignored.  */
>       current_frame = 0;
>       tty = 1;
>     }
> 
>   ...
> 
>   /* --no-wait implies --current-frame on ttys when there are file
>      arguments or expressions given.  */
>   if (nowait && tty && argc - optind > 0)
>     current_frame = 1;
> 
> When tty = 1, if there are also -n and filename arguments, emacsclient
> assumes that a current Emacs frame must be used.  This assumption is not
> correct if the tty = 1 is because of the Window hack.

But is that assumption correct if tty = 1 on GNU/Linux?  In a previous
mail you said:

> With the -c option, a client frame is created, so C-x C-c should delete
> the frame without killing the main Emacs session, whether or not there
> is an -n option.

This seems to imply that using "emacsclient -c -n FILE" on a Posix
host should _not_ kill emacs when "C-x C-c" is typed.  And yet in my
testing, it does, with the emacs-24 branch built just now, when the
server runs in a TTY session.  Are you saying that the effect of -n
depends also on whether the server runs in a TTY session?  If not,
what else am I missing?




This bug report was last modified 13 years and 35 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.