GNU bug report logs - #6963
Return an exit status to emacsclient

Previous Next

Package: emacs;

Reported by: Arne Babenhauserheide <arne_bab <at> web.de>

Date: Wed, 1 Sep 2010 10:16:01 UTC

Severity: wishlist

Found in version 23.2

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Wolfgang Schnerring <wosc <at> wosc.de>
To: 6963 <at> debbugs.gnu.org
Subject: bug#6963: More usecases, patch attached
Date: Wed, 29 Sep 2010 08:09:18 +0200
[Message part 1 (text/plain, inline)]
emacsclient is such a usefull tool. But that it does not signal error
situations via its exit status severely hinders its usage in shell
scripts or in integration with other programs.

For example, I was bit by this rather badly when I tried to use
emacsclient to start an ediff session, to use as a merge tool for the
Mercurial SCM.
I may have made a typo in configuring said ediff command or for
whatever other reason, Emacs returned an error. But Mercurial was
blissfully unaware of this, since emacsclient returns 0 no matter
what. End result: Mercurial committed a broken merge that I had to
spend at least two hours some days later to debug.

I've attached a patch that makes emacsclient exit with nonzero status
when it receives an error message from Emacs -- it already *prints*
"*ERROR*" in these cases, so I feel this makes a lot of sense.

Thanks,
Wolfgang
[emacsclient-exitstatus.patch (text/plain, attachment)]
[Message part 3 (application/pgp-signature, inline)]

This bug report was last modified 14 years and 276 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.