unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: 11102@debbugs.gnu.org, cyd@gnu.org
Subject: bug#11102: 24.0.94; C-x C-c from a client frame sometimes kills the whole Emacs process
Date: Fri, 13 Apr 2012 17:38:20 +0300	[thread overview]
Message-ID: <83mx6f3der.fsf@gnu.org> (raw)
In-Reply-To: <CAAeL0SQk+hf_k8iJrHM+2hFm0M5PE7O5JUYqbAu7zhnXYnkaFw@mail.gmail.com>

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Thu, 12 Apr 2012 20:11:38 +0200
> Cc: Chong Yidong <cyd@gnu.org>, dmoncayo@gmail.com, 11102@debbugs.gnu.org
> 
> On Fri, Mar 30, 2012 at 19:45, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> > It most probably is.  Juanma, could you take a look, please?
> 
> A little after current_frame is forced to 0 on Windows (in the -c / -t cases):
> 
> #ifdef WINDOWSNT
>   /* Emacs on Windows does not support GUI and console frames in the same
>      instance.  So, it makes sense to treat the -t and -c options as
>      equivalent, and open a new frame regardless of whether the running
>      instance is GUI or console.  Ideally, we would only set tty = 1 when
>      the instance is running in a console, but alas we don't know that.
>      The simplest workaround is to always ask for a tty frame, and let
>      server.el check whether it makes sense.  */
>   if (tty || !current_frame)
>     {
>       display = (const char *) ttyname (fileno (stdout));
>       current_frame = 0;
>       tty = 1;
>     }
> #endif
> 
> there's this bit of code (non-WINDOWSNT-specific):
> 
>   /* --no-wait implies --current-frame on ttys when there are file
>      arguments or expressions given.  */
>   if (nowait && tty && argc - optind > 0)
>     current_frame = 1;
> 
> which causes the bug. I'm not sure I understand the logic after that
> code, and even less sure it makes sense on Windows. WDYT?

In that case, I don't understand why did Dani expect something
different from what he saw.  I see the same behavior on GNU/Linux: if
emacsclient is invoked with -n, "C-x C-c" kills Emacs.  Perhaps the
bug is that we create a new frame on Windows even though the server
receives the -current-frame parameter.  Why doesn't server.el on
Windows honor that parameter?

As for the logic behind the above code, AFAIU -n means emacsclient is
used as a way of asking Emacs to visit a file without any special
handling; in particular, "C-x #" does _not_ kill the buffer visiting
that file.  So killing the entire session upon "C-x C-c" makes sense
in this case.






  reply	other threads:[~2012-04-13 14:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 18:56 bug#11102: 24.0.94; C-x C-c from a client frame sometimes kills the whole Emacs process Dani Moncayo
2012-03-30 17:01 ` Chong Yidong
2012-03-30 17:45   ` Eli Zaretskii
2012-03-30 20:29     ` Juanma Barranquero
2012-04-12 18:11     ` Juanma Barranquero
2012-04-13 14:38       ` Eli Zaretskii [this message]
2012-04-13 15:20         ` Dani Moncayo
2012-04-13 15:46           ` Eli Zaretskii
2012-04-13 23:49             ` Juanma Barranquero
2012-04-14  4:03               ` Chong Yidong
2012-04-14  7:26                 ` Eli Zaretskii
2012-04-13 16:10         ` Juanma Barranquero
2012-04-13 16:13           ` Juanma Barranquero
2012-04-13 17:55             ` Eli Zaretskii
2012-04-13 19:15               ` Juanma Barranquero
2012-04-13 21:00                 ` Eli Zaretskii
2012-04-14  4:55         ` Chong Yidong
2012-04-14  5:34           ` Chong Yidong
2012-04-14  7:25             ` Eli Zaretskii
2012-04-14  8:17               ` Chong Yidong
2012-04-14  9:28                 ` Eli Zaretskii
2012-04-14 10:33                   ` Chong Yidong
2012-04-14 11:37                     ` Eli Zaretskii
2012-04-14 13:18                       ` Chong Yidong
2012-04-14 13:34                         ` Eli Zaretskii
2012-04-15  8:53                           ` Chong Yidong
2012-04-20  8:23                             ` Dani Moncayo
2012-04-20 19:10                               ` Dani Moncayo
2012-04-14  9:36           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mx6f3der.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=11102@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).