zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: New problem with ERR_RETURN ?
Date: Thu, 8 Dec 2022 09:24:00 +0000 (GMT)	[thread overview]
Message-ID: <1965529659.1839688.1670491440623@mail.virginmedia.com> (raw)
In-Reply-To: <cb8df6b1-4ea6-454b-846e-c6f582ff3a86@app.fastmail.com>

> On 08/12/2022 06:05 Lawrence Velázquez <larryv@zsh.org> wrote:
> Bikeshedding perhaps, but this sentence already exists just above:
> 
> 	This will trigger an exit at the outermost level of a
> 	non-interactive script.
> 
> Maybe any new text should come right after this?  That would keep
> the explanations about how ERR_RETURN affects behavior at the top
> level in one place.

That will make it more compact, too.

pws

diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 445052617..e92969531 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -1744,6 +1744,9 @@ Exiting due to tt(ERR_EXIT) has certain interactions with asynchronous
 jobs noted in
 ifzman(the section JOBS in zmanref(zshmisc))\
 ifnzman(noderef(Jobs & Signals)).
+
+Note this behaviour is not disabled in interactive shells ---
+a non-zero status on the command line causes the shell to exit.
 )
 pindex(ERR_RETURN)
 pindex(NO_ERR_RETURN)
@@ -1756,7 +1759,10 @@ If a command has a non-zero exit status, return immediately from the
 enclosing function.  The logic is similar to that for tt(ERR_EXIT),
 except that an implicit tt(return) statement is executed instead of an
 tt(exit).  This will trigger an exit at the outermost level of a
-non-interactive script.
+non-interactive script.  At the top level of an interactive shell,
+it will trigger a return to the command prompt; in other
+words, the sequence of commands typed by the user may be
+thought of as a function for this purpose.
 
 Normally this option inherits the behaviour of tt(ERR_EXIT) that
 code followed by `tt(&&)' `tt(||)' does not trigger a return.  Hence


  reply	other threads:[~2022-12-08  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 16:17 Bart Schaefer
2022-12-07 16:37 ` Peter Stephenson
2022-12-07 16:41 ` Philippe Altherr
2022-12-07 16:53   ` Peter Stephenson
2022-12-07 17:02     ` Bart Schaefer
2022-12-07 17:07       ` Peter Stephenson
2022-12-08  6:05         ` Lawrence Velázquez
2022-12-08  9:24           ` Peter Stephenson [this message]
2022-12-07 16:58   ` Bart Schaefer

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

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

  git send-email \
    --in-reply-to=1965529659.1839688.1670491440623@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).