From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt McClure Newsgroups: gmane.emacs.help Subject: Re: Emacs quitting on Control-G when committing to mercurial Date: Mon, 21 May 2012 19:05:25 -0500 Message-ID: <-5593377888256836725@unknownmsgid> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=90e6ba1efc1608a42b04c094c7a1 X-Trace: dough.gmane.org 1337645156 31706 80.91.229.3 (22 May 2012 00:05:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 May 2012 00:05:56 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Roy Smith Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 22 02:05:54 2012 Return-path: Envelope-to: geh-help-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 1SWcbi-0007ch-HS for geh-help-gnu-emacs@m.gmane.org; Tue, 22 May 2012 02:05:46 +0200 Original-Received: from localhost ([::1]:43403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWcbh-0000wa-Et for geh-help-gnu-emacs@m.gmane.org; Mon, 21 May 2012 20:05:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWcba-0000wS-N6 for help-gnu-emacs@gnu.org; Mon, 21 May 2012 20:05:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWcbY-0000d8-NR for help-gnu-emacs@gnu.org; Mon, 21 May 2012 20:05:38 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:33612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWcbY-0000ck-Ed for help-gnu-emacs@gnu.org; Mon, 21 May 2012 20:05:36 -0400 Original-Received: by yenm7 with SMTP id m7so5953903yen.0 for ; Mon, 21 May 2012 17:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type; bh=pXmFd2LNT0gL90411EWVgWQ8FbfgCaSM3K4Y7Z/CJLc=; b=kATGFHR5pt25+xmfVfDmKboBw9q9LSoUpCr2laHtDUlGi7+AvZAmc4NbH1+LaQoCtw mlViSTItbEaMr8+mgnSCr1zIeQseEluG/nlC224Pf+LD80MkOFFJwq8t4CunTetFquIs OU+h9q53WbUJccm0uBcYU5ysoGio7dVjDs1SZSe8UHwcJwm9kpHvy946HPHYL9VrKQpQ hRGGyW8TsG8GA4ggdkOoDpw2NA1x8eZjhP3xTp6Whr8JE/nybL5FydebjWXq8u0mrLtY fOOfshfajKVwySTPeo62g/vL3lRV1+vvmy2BphlqyWwyk+J81z/pGVRngOS+qIdG+up6 tYow== Original-Received: by 10.42.155.200 with SMTP id v8mr13451106icw.12.1337645133767; Mon, 21 May 2012 17:05:33 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84923 Archived-At: --90e6ba1efc1608a42b04c094c7a1 Content-Type: text/plain; charset=ISO-8859-1 That's a bug. Emacs' process has the wrong pgid when its parent isn't an interactive shell. Here's a workaround for the same problem using Git. I would hope you can configure Mercurial similarly. http://static.matthewlmcclure.com/n/ Emacs C-g Kills `git commit` On Mac OS X 2012-02-22 Workaround: Invoke Emacs via an interactive Bash shell. emacs.sh: #! /bin/bash -i emacs "$@" In a shell: git config --global core.editor emacs.sh See also: - http://thread.gmane.org/gmane.comp.version-control.git/158981 - http://www.cons.org/cracauer/sigint.html Matt McClure http://matthewlmcclure.com http://www.mapmyfitness.com/profile/matthewlmcclure On May 21, 2012, at 9:54 AM, Roy Smith wrote: I'm running: GNU Emacs 22.1.1 OSX-10.6.8 Mercurial Distributed SCM (version 1.6.4+20101001) If I do "hg commit", emacs is run as I would expect, but if I type a Control-G, I get an "interrupted!" message, and emacs quits (leaving the terminal modes unrestored). Running ps shows that the command being executed is: emacs -nw /var/folders/p5/p5Gj6NRtF-yAXT+X0YVgJU+++TM/-Tmp-/hg-editor-wQEeGG.txt If I run that manually, I get normal operation. I assume there's something funky about the environment in which emacs is being executed, but I can't figure out what that might be. Any ideas? It doesn't seem to be related to the buffer; I get the same problem in other buffers. M-X make command summary shows, for both the normal and broken situations: C-g keyboard-quit self-insert-command -- Roy Smith roy@panix.com --90e6ba1efc1608a42b04c094c7a1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
That's a bug. Emacs&#= 39; process has the wrong pgid when its parent isn't an interactive she= ll. Here's a workaround for the same problem using Git. I would hope yo= u can configure Mercurial similarly.=A0


Emacs C-g Kills `git commit` On= Mac OS X

2012-02-22

Workaround: Invoke Emacs via an= interactive Bash shell.

emacs.sh:


    #! /bin/bash -i

    emacs "$@"
    

In a shell:


    git config --global core.editor emacs.sh
    
See also:

Matt McClure

On Ma= y 21, 2012, at 9:54 AM, Roy Smith <roy@= panix.com> wrote:

I'm running:<= /span>

GNU Emacs 22.1.1
OSX-10.6.= 8
Mercurial Distributed SCM (version 1.6.4+20101001)=

If I do "hg commit", emacs is run as I wou= ld expect, but if I type a Control-G, I get an "interrupted!" mes= sage, and emacs quits (leaving the terminal modes unrestored).

Running ps shows that the command being executed is:=

=A0=A0=A0emacs -nw /var/folders/p5/p5Gj6= NRtF-yAXT+X0YVgJU+++TM/-Tmp-/hg-editor-wQEeGG.txt
If I run that manually, I get normal operation. =A0I assume there'= ;s something funky about the environment in which emacs is being executed, = but I can't figure out what that might be. =A0Any ideas?

It doesn't seem to be related to the buffer; I get the same probl= em in other buffers. =A0M-X make command summary shows, for both the normal= and broken situations:

=A0=A0=A0C-g =A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0keyboard-quit =A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0<JISX0208> =A0=A0=A0=A0self-insert-command

--
Roy Smith
roy@panix.com


--90e6ba1efc1608a42b04c094c7a1--