bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43055: 27.1; [PATCH] * lisp/term.el: Use correct exit status in sugg


From: Phil Sainty
Subject: bug#43055: 27.1; [PATCH] * lisp/term.el: Use correct exit status in suggested dir-tracking functions
Date: Wed, 26 Aug 2020 15:58:39 +1200
User-agent: Orcon Webmail

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

Attachment: 0001-lisp-term.el-Use-correct-exit-status-in-suggested-di.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]