unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "George D. Plymale" <georgedp@orbitalimpact.com>
To: npostavs@users.sourceforge.net
Cc: 26161@debbugs.gnu.org
Subject: bug#26161: 25.1; `eshell-exit-success-p' determines that Lisp commands are successful if they return non-nil
Date: Sat, 1 Apr 2017 19:46:00 -0400	[thread overview]
Message-ID: <801CBEDF-791F-4950-A8B1-F1EA346267BA@orbitalimpact.com> (raw)
In-Reply-To: <7E4E5778-FFBF-4298-9DEF-0A60539999D5@orbitalimpact.com>

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]



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

That would only solve the problem for this particular command. It's worth
noting that even doing things like, e.g., `$ .. && pwd' or `$ cat ~/.emacs &&
pwd' don't execute their latter halves because the functions that the former
parts expand to return nil, even if they are in fact successful. Honestly,
it'd probably be better off if `eshell-exit-success-p' just
checked`eshell-last-command-status' and Eshell makes sure that erring commands
always set that to non-zero (which I think is already covered by
`eshell-trap-errors').

> 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.

Yeah, `eshell/cd' actually is able to bypass something like
`eshell-trap-errors' because it uses `cd' under the hood through this
function invocation: `(eshell-printn result)' where `result' is `(cd
newdir)'. See, `eshell-printn' just captures the result of its given
object and prints that out. In some cases, that object is an error (like
when you cd into a non-existent directory), but you can't really tell
that because `eshell-printn' doesn't care about errors; it just prints
out the object it's given. Functions that do this sort of thing may also
exist aside from `eshell/cd', so I'm unsure what can be done about that.

[-- Attachment #2: Type: text/html, Size: 2120 bytes --]

  parent reply	other threads:[~2017-04-01 23:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18 19:12 bug#26161: 25.1; `eshell-exit-success-p' determines that Lisp commands are successful if they return non-nil George D. Plymale
2017-03-31  3:52 ` npostavs
2017-04-01 23:46 ` George D. Plymale [this message]
2017-04-02  0:06   ` npostavs
2017-04-11 19:48 ` George D. Plymale
2017-04-13  1:18   ` npostavs
2017-04-20 19:47     ` George Plymale II
2017-04-21  3:10       ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=801CBEDF-791F-4950-A8B1-F1EA346267BA@orbitalimpact.com \
    --to=georgedp@orbitalimpact.com \
    --cc=26161@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).