From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83mx6f3der.fsf@gnu.org> References: <87obreaups.fsf@gnu.org> <83wr62yocw.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1334328063 30247 80.91.229.3 (13 Apr 2012 14:41:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Apr 2012 14:41:03 +0000 (UTC) Cc: 11102@debbugs.gnu.org, cyd@gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 13 16:41:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SIhgF-0006OB-PN for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Apr 2012 16:40:56 +0200 Original-Received: from localhost ([::1]:38730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIhgE-0001jo-Le for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Apr 2012 10:40:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIhgB-0001ii-BN for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 10:40:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SIhg5-0002Zu-51 for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 10:40:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SIhg5-0002Zf-2C for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 10:40:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SIhhK-0002Dv-Mp for bug-gnu-emacs@gnu.org; Fri, 13 Apr 2012 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Apr 2012 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11102 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11102-submit@debbugs.gnu.org id=B11102.13343281058523 (code B ref 11102); Fri, 13 Apr 2012 14:42:02 +0000 Original-Received: (at 11102) by debbugs.gnu.org; 13 Apr 2012 14:41:45 +0000 Original-Received: from localhost ([127.0.0.1]:57362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIhh2-0002DQ-Hi for submit@debbugs.gnu.org; Fri, 13 Apr 2012 10:41:44 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:43197) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SIhgy-0002DG-6g for 11102@debbugs.gnu.org; Fri, 13 Apr 2012 10:41:41 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M2F002009X5Q000@a-mtaout22.012.net.il> for 11102@debbugs.gnu.org; Fri, 13 Apr 2012 17:40:20 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.57.204]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M2F0022BA3718P0@a-mtaout22.012.net.il>; Fri, 13 Apr 2012 17:40:20 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58994 Archived-At: > From: Juanma Barranquero > Date: Thu, 12 Apr 2012 20:11:38 +0200 > Cc: Chong Yidong , dmoncayo@gmail.com, 11102@debbugs.g= nu.org >=20 > On Fri, Mar 30, 2012 at 19:45, Eli Zaretskii wrote: >=20 > > It most probably is. =C2=A0Juanma, could you take a look, please? >=20 > A little after current_frame is forced to 0 on Windows (in the -c /= -t cases): >=20 > #ifdef WINDOWSNT > /* Emacs on Windows does not support GUI and console frames in th= e same > instance. So, it makes sense to treat the -t and -c options a= s > equivalent, and open a new frame regardless of whether the run= ning > instance is GUI or console. Ideally, we would only set tty = =3D 1 when > the instance is running in a console, but alas we don't know t= hat. > 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 =3D (const char *) ttyname (fileno (stdout)); > current_frame =3D 0; > tty =3D 1; > } > #endif >=20 > there's this bit of code (non-WINDOWSNT-specific): >=20 > /* --no-wait implies --current-frame on ttys when there are file > arguments or expressions given. */ > if (nowait && tty && argc - optind > 0) > current_frame =3D 1; >=20 > which causes the bug. I'm not sure I understand the logic after tha= t > 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.