#779131 emacs should return a non-zero exit code when it is terminated with SIGINT

#779131#5
Date:
2015-02-17 21:29:29 UTC
From:
To:
emacs is my default editor.

it looks like if you send emacs a SIGINT, it will clean up nicely and
terminate with a return code of 0.

if i run a bts command that drops me into my editor in an X11
environment, emacs spawns as a separate window, while my shell is
blocked by the bts invocation (as it should be).

if i hit ctrl-C in the shell, though, apparently bts passes the SIGINT
through to my editor, and then proceeds to use the contents of the
message as prepared.

I expected ctrl-C to terminate the bts report rather than sending it
in.

here's me starting to close #770592 by mistake, realizing that wasn't
correct and trying to abort it:

0 dkg@alice:~$ bts done 770592 2.1.1-1
^C0 dkg@alice:~$

(the leading 0 in my prompt is the return code of the previous
command)

unfortunately, this actually did close #770592, which i didn't intend.
--- /etc/devscripts.conf ---
--- ~/.devscripts --- Not present
#779131#10
Date:
2015-02-18 01:03:30 UTC
From:
To:
That seems like suboptimal behavior.  Exiting due to a signal doesn't
seem like a "successful" exit.

It seems emacs isn't very consistent about this.  Running emacsclient to
connect to an existing daemon means that frame exits with an exit code
of 130, as expected.  Running a standalone “emacs -nw”, SIGINT gets
caught and doesn't exit.  Running a standalone X emacs frame does exit
cleanly as you describe.

Yes, Perl ignores SIGINT/SIGQUIT while running the external process, so
that process gets the signal.  I'll adjust bts to inspect the exit code
of the process so it doesn't treat a non-zero exit code as success.
However, emacs will need to be fixed to not exit with a zero when
killed.

As an alternative, you can tell bts to cancel by saving an empty file.

Cheers,

#779131#17
Date:
2015-02-24 04:41:28 UTC
From:
To:
tag 778648 pending
thanks

Hello,

Bug #778648 reported by you has been fixed in the Git repository. You can
see the changelog below, and you can check the diff of the fix at:

http://git.debian.org/?p=collab-maint/devscripts.git;a=commitdiff;h=f6053e2

    bts: Cancel the command if a spawned editor errors out

    Although this is already supported by saving an empty file, a user may
    rightfully expect that killing the editor itself will prevent bts from
    sending the command email.

    Closes: #778648
    Signed-off-by: James McCoy <jamessan@debian.org>

diff --git a/debian/changelog b/debian/changelog
index 5f16fd4..7ab55a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -28,6 +28,9 @@ devscripts (2.15.1+exp1) UNRELEASED; urgency=medium
     + Fix extraction of uploader's key id.
     * Create a temporary GNUPGHOME to avoid “gpg --list-key” erroring when no
       ~/.gnupg exists.  (Closes: #776209)
+  * bts: Cancel the mail if the spawned editor exits with a non-zero exit
+    code.  This is an alternative way to cancel a command, rather than saving
+    an empty message.  (Closes: #778648)

   [ Johannes Schauer ]
   * chdist: Also set Apt::Architectures to prevent foreign architectures from

#779131#32
Date:
2017-08-11 18:38:25 UTC
From:
To:
Dear submitter,

as the package emacs24 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/871627

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)