[Top][All Lists]

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

bug#26161: 25.1; `eshell-exit-success-p' determines that Lisp commands a

From: npostavs
Subject: bug#26161: 25.1; `eshell-exit-success-p' determines that Lisp commands are successful if they return non-nil
Date: Thu, 30 Mar 2017 23:52:39 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

tags 26161 confirmed
severity 26161 minor

"George D. Plymale" <address@hidden> writes:

> I believe that it is sub-optimal behavior for `eshell-exit-success-p' to
> determine that Lisp commands are successful by checking whether or not
> they return a non-nil value. A demonstration of why this behavior can be
> considered problematic is found in a command like this: `$ cd .. && pwd'

So maybe `eshell/cd' should be changed to return t when it succeeds?

> Such a command will not execute its second part (which is `pwd') because
> `eshell/cd' returns a nil value whether it's successful or not. This
> behavior is a bit confusing for someone who expects common shell
> operators such as `&&' to "just work."
> A better solution would be to check whether the last command threw an
> actual error.

AFAICT, when you cd to a non-existent directory it doesn't throw an
error, but I don't think that should be considered success.

reply via email to

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