GNU bug report logs - #43055
27.1; [PATCH] * lisp/term.el: Use correct exit status in suggested dir-tracking functions

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Wed, 26 Aug 2020 03:59:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43055 in the body.
You can then email your comments to 43055 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#43055; Package emacs. (Wed, 26 Aug 2020 03:59:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Phil Sainty <psainty <at> orcon.net.nz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Aug 2020 03:59:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; [PATCH] * lisp/term.el: Use correct exit status in suggested
 dir-tracking functions
Date: Wed, 26 Aug 2020 15:58:39 +1200
[Message part 1 (text/plain, inline)]
The shell function overrides suggested in term.el to facilitate
directory tracking cause those commands to return a success status
unconditionally:

cd()    { command cd    "$@"; printf '\033AnSiTc %s\n' "$PWD"; }
pushd() { command pushd "$@"; printf '\033AnSiTc %s\n' "$PWD"; }
popd()  { command popd  "$@"; printf '\033AnSiTc %s\n' "$PWD"; }

I.e. if the 'cd' fails, we are ignoring that and instead returning
the 'printf' exit status.

I believe these should be:

cd()    { command cd    "$@" && printf '\033AnSiTc %s\n' "$PWD"; }
pushd() { command pushd "$@" && printf '\033AnSiTc %s\n' "$PWD"; }
popd()  { command popd  "$@" && printf '\033AnSiTc %s\n' "$PWD"; }

If the command fails, no dir-tracking update should be needed in
Emacs (so it's fine not to do that part), and we will see the exit
status for the original command, so I think this is all that's
required.

Patch attached.


-Phil
[0001-lisp-term.el-Use-correct-exit-status-in-suggested-di.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#43055; Package emacs. (Wed, 26 Aug 2020 10:05:01 GMT) Full text and rfc822 format available.

Message #8 received at 43055 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 43055 <at> debbugs.gnu.org
Subject: Re: bug#43055: 27.1; [PATCH] * lisp/term.el: Use correct exit
 status in suggested dir-tracking functions
Date: Wed, 26 Aug 2020 12:03:57 +0200
Phil Sainty <psainty <at> orcon.net.nz> writes:

> If the command fails, no dir-tracking update should be needed in
> Emacs (so it's fine not to do that part), and we will see the exit
> status for the original command, so I think this is all that's
> required.

Makes sense to me.  I've now applied the patch to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 10:05:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 43055 <at> debbugs.gnu.org and Phil Sainty <psainty <at> orcon.net.nz> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 26 Aug 2020 10:05:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 23 Sep 2020 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 273 days ago.

Previous Next


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