From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "George D. Plymale" Newsgroups: gmane.emacs.bugs 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 Message-ID: <801CBEDF-791F-4950-A8B1-F1EA346267BA@orbitalimpact.com> References: <7E4E5778-FFBF-4298-9DEF-0A60539999D5@orbitalimpact.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_4165EFB4-366D-41B2-81E6-D5F0372A226B" X-Trace: blaine.gmane.org 1491090452 18123 195.159.176.226 (1 Apr 2017 23:47:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Apr 2017 23:47:32 +0000 (UTC) Cc: 26161@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 02 01:47:24 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuSjj-00038x-Bk for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Apr 2017 01:47:15 +0200 Original-Received: from localhost ([::1]:53146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuSjn-0000U9-G1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 01 Apr 2017 19:47:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cuSjb-0000TM-KU for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 19:47:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cuSjW-0004NP-Eo for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 19:47:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cuSjW-0004NF-92 for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 19:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cuSjV-0002LH-Tc for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2017 19:47:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <7E4E5778-FFBF-4298-9DEF-0A60539999D5@orbitalimpact.com> Resent-From: "George D. Plymale" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Apr 2017 23:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26161 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 26161-submit@debbugs.gnu.org id=B26161.14910903748923 (code B ref 26161); Sat, 01 Apr 2017 23:47:01 +0000 Original-Received: (at 26161) by debbugs.gnu.org; 1 Apr 2017 23:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:56100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuSik-0002Jr-6C for submit@debbugs.gnu.org; Sat, 01 Apr 2017 19:46:14 -0400 Original-Received: from mail-qk0-f170.google.com ([209.85.220.170]:35342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cuSih-0002JX-U8 for 26161@debbugs.gnu.org; Sat, 01 Apr 2017 19:46:12 -0400 Original-Received: by mail-qk0-f170.google.com with SMTP id g195so19478883qke.2 for <26161@debbugs.gnu.org>; Sat, 01 Apr 2017 16:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orbitalimpact.com; s=google; h=from:mime-version:subject:date:cc:to:message-id; bh=hl4qSUSzb8nfZUbhIkatp9RpUi5PNGCoxJibT7LH1eg=; b=wSGFtMgzs45YAOct5wZe6AKfP3sSLctw/5CTC8dzNXRghqK3RexjM+4aTjyoZQmEBZ 71Ax3veXz+XOCF/Oetytm3sKO65NH0HSB3S6V9hwIyi6Zcv2y2WYYIEXpTDGhjzHdTgv ZP9QwGncx3+ua7KsydJ0OOxl9yDBD7OzbJWSo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:cc:to:message-id; bh=hl4qSUSzb8nfZUbhIkatp9RpUi5PNGCoxJibT7LH1eg=; b=mZ0m21J0CHCvrXsN3bvdr7AGLYnwXNLs0gvOHdQGn0j5BBU8PzPQ+EHh141zaIAqgT 4fsKPe6RzIS6xdxokktIwfA4FCd9EM+dwg7bZfm32DsYkcMCFrlwIcieXJW2ysTuHCGW Ifvt7zXq4qMxN5dYSqjWQvPTdF6ejW6ARjfVJUFwhZ4XHiyiH4WB3XAJUA4sKPDlkXMR R0VVdSAhy6xFs9MgnsMxYGYMmLX9hT4Yl/iUd25wOWR7c+2Ue6Mb9AvmpCjQJfWfB4E0 QS0LH56QV0sTF4G2+rDBtF8+aGux9gsXSxFZsy1etMYKF4PtcTJ/C0WFyBKOuNzF+3nR VVYQ== X-Gm-Message-State: AFeK/H0lzLyet4A2NecPt+OM96m+IJusaE2SCtb1LRpUuBdYxFG9LrnxSTbu1N8wlUed3Q== X-Received: by 10.55.67.66 with SMTP id q63mr9125796qka.49.1491090366350; Sat, 01 Apr 2017 16:46:06 -0700 (PDT) Original-Received: from [10.16.10.6] ([66.55.144.182]) by smtp.gmail.com with ESMTPSA id i5sm6464272qtb.63.2017.04.01.16.46.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Apr 2017 16:46:05 -0700 (PDT) X-Mailbutler-Tracking-Uuid: 0AFE1A6B-EF54-4D44-B7FA-9BBA67A6BFB2 X-Mailbutler-Link-Tracking-Uuid: X-Mailer: Apple Mail (2.3273) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131187 Archived-At: --Apple-Mail=_4165EFB4-366D-41B2-81E6-D5F0372A226B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > 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. --Apple-Mail=_4165EFB4-366D-41B2-81E6-D5F0372A226B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

> 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.
3D""= --Apple-Mail=_4165EFB4-366D-41B2-81E6-D5F0372A226B--