|
From: | Kevin Rodgers |
Subject: | Re: Emacs exit (return) code? |
Date: | Mon, 14 Oct 2002 09:44:43 -0600 |
User-agent: | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
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? andEmacs 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. -- <a href="mailto:<kevinr@ihs.com>">Kevin Rodgers</a>
[Prev in Thread] | Current Thread | [Next in Thread] |