From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: Emacs exit (return) code? Date: Mon, 14 Oct 2002 09:44:43 -0600 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3DAAE66B.20309@ihs.com> References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1034610810 24860 127.0.0.1 (14 Oct 2002 15:53:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2002 15:53:30 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1817X7-0006Sq-00 for ; Mon, 14 Oct 2002 17:53:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 1817QU-00005d-00; Mon, 14 Oct 2002 11:46:38 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.174.75.178!news-fra1.dfn.de!fu-berlin.de!uni-berlin.de!170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 47 Original-NNTP-Posting-Host: 170.207.51.80 Original-X-Trace: fu-berlin.de 1034610281 22970045 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us Original-Xref: shelby.stanford.edu gnu.emacs.help:106043 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2591 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2591 Eli Zaretskii wrote: >>From: INVALID_SEE_SIG@example.com (J.D. Baldwin) >>Newsgroups: gnu.emacs.help >>Date: Thu, 10 Oct 2002 19:09:14 +0000 (UTC) >> >>I observe the same behavior with the sudo >>utility "visudo" (version 1.6.3p7 running on either Solaris 7 or 8). >>If I edit a file and never hit ^G, my changes are accepted. If I ever >>hit ^G during my session, I get this message: >> >> visudo: Editor (/opt/local/bin/emacs) failed with exit status 53248, \ >> /etc/sudoers unchanged. >> >>In that case, my changes are rejected without giving me a chance to >>recover them. (Yes, I know this is brain damage on the part of sudo, >>but I can't fix that just now.) >> >>So my questions are: >> >>1. What causes this? and >> > > Emacs sets things up so that ^G generates a signal, similar to ^C in > other programs. An interrupted program usually returns the signal in > its exit status. I think this is what you see. But if the signal is successfully handled and the program continues, why should the exit status be affected? >>2. Is there a way to suppress this behavior? >> > > Write a short shell script that invokes Emacs and then always returns > a zero status. Then tell those programs to run the script instead of > Emacs as your editor. I don't think that's a solution. Emacs could crash or otherwise fail to save the edited file and the script would report success. -- Kevin Rodgers