From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: typeset docs flow Re: [PATCH] typeset: set $? on incidental error
Date: Sat, 30 Jan 2016 11:47:45 -0800 [thread overview]
Message-ID: <160130114745.ZM10270@torch.brasslantern.com> (raw)
In-Reply-To: <20160130074657.GA3030@tarsus.local2>
On Jan 30, 7:46am, Daniel Shahaf wrote:
} Subject: typeset docs flow Re: [PATCH] typeset: set $? on incidental error
}
} The following paragraph (the context lines of the patch) is the
} continuation of the text about var(name) that precedes the segment about
} the reserved word syntax.
How about the below?
Two other things: (1) I still get a double blank line before any use
of example(...) -- I thought we'd come up with a fix for that (Jun T.
perhaps?). (2) I noticed in passing that there are a lot of places
where builtins.yo says "the shell will try ..." (sometimes without the
word "try") -- if someone were up for a lot of work, this should all
be rewritten in active voice, i.e., "the shell does", not "the shell
will (do)"; and unless something useful happens when "try" does not
succeed [in which case explain it], remove the wishy-washy.
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index cdf405b..365f8e1 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1763,18 +1763,31 @@ ifnzman(noderef(Local Parameters))\
retain their special attributes when made local.
For each var(name)tt(=)var(value) assignment, the parameter
-var(name) is set to var(value). All forms of the command
-handle scalar assignment.
+var(name) is set to var(value).
-If any of the reserved words tt(declare), tt(export), tt(float),
+If the shell option tt(TYPESET_SILENT) is not set, for each remaining
+var(name) that refers to a parameter that is already set, the name and
+value of the parameter are printed in the form of an assignment.
+Nothing is printed for newly-created parameters, or when any attribute
+flags listed below are given along with the var(name). Using
+`tt(PLUS())' instead of minus to introduce an attribute turns it off.
+
+If no var(name) is present, the names and values of all parameters are
+printed. In this case the attribute flags restrict the display to only
+those parameters that have the specified attributes, and using `tt(PLUS())'
+rather than `tt(-)' to introduce the flag suppresses printing of the values
+of parameters when there is no parameter name.
+
+All forms of the command handle scalar assignment. Array assignment is
+possible if any of the reserved words tt(declare), tt(export), tt(float),
tt(integer), tt(local), tt(readonly) or tt(typeset) is matched when the
-line is parsed (N.B. not when it is executed) the shell will try to parse
-arguments as assignments, except that the `tt(+=)' syntax and the
-tt(GLOB_ASSIGN) option are not supported. This has two major differences
-from normal command line argument parsing: array assignment is possible,
-and scalar values after tt(=) are not split further into words even if
-expanded (regardless of the setting of the tt(KSH_TYPESET) option; this
-option is obsolete). Here is an example:
+line is parsed (N.B. not when it is executed). In this case the arguments
+are parsed as assignments, except that the `tt(+=)' syntax and the
+tt(GLOB_ASSIGN) option are not supported, and scalar values after tt(=)
+are em(not) split further into words, even if expanded (regardless of the
+setting of the tt(KSH_TYPESET) option; this option is obsolete).
+
+Examples of the differences between command and reserved word parsing:
example(# Reserved word parsing
typeset svar=$(echo one word) avar=(several words))
@@ -1843,19 +1856,6 @@ To initialize a parameter var(param) to a command output and mark it readonly,
use tt(typeset -r )var(param) or tt(readonly )var(param) after the parameter
assignment statement.
-If the shell option tt(TYPESET_SILENT) is not set, for each remaining
-var(name) that refers to a parameter that is already set, the name and
-value of the parameter are printed in the form of an assignment.
-Nothing is printed for newly-created parameters, or when any attribute
-flags listed below are given along with the var(name). Using
-`tt(PLUS())' instead of minus to introduce an attribute turns it off.
-
-If no var(name) is present, the names and values of all parameters are
-printed. In this case the attribute flags restrict the display to only
-those parameters that have the specified attributes, and using `tt(PLUS())'
-rather than `tt(-)' to introduce the flag suppresses printing of the values
-of parameters when there is no parameter name.
-
If no attribute flags are given, and either no var(name) arguments are
present or the flag tt(+m) is used, then each parameter name printed is
preceded by a list of the attributes of that parameter (tt(array),
next prev parent reply other threads:[~2016-01-30 19:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-14 0:13 Daniel Shahaf
2016-01-14 4:58 ` Bart Schaefer
2016-01-14 5:24 ` Eric Cook
2016-01-15 6:26 ` Daniel Shahaf
2016-01-15 14:46 ` Mikael Magnusson
2016-01-15 14:54 ` Eric Cook
2016-01-15 15:49 ` Peter Stephenson
[not found] ` <20160118022557.GE3979@tarsus.local2>
2016-01-18 4:38 ` Mikael Magnusson
2016-01-18 13:33 ` Mikael Magnusson
2016-01-20 7:47 ` Daniel Shahaf
2016-01-20 15:00 ` Eric Cook
2016-01-23 23:53 ` Daniel Shahaf
2016-01-24 3:32 ` Eric Cook
2016-01-26 22:50 ` Daniel Shahaf
2016-01-27 4:15 ` Error status of "repeat" (was Re: [PATCH] typeset: set $? on incidental error) Bart Schaefer
2016-01-27 4:38 ` Bart Schaefer
2016-01-27 9:52 ` Peter Stephenson
2016-01-29 9:18 ` Daniel Shahaf
2016-01-29 9:29 ` Peter Stephenson
2016-01-29 10:25 ` Daniel Shahaf
2016-01-27 4:17 ` [PATCH] typeset: set $? on incidental error Bart Schaefer
2016-01-29 9:18 ` Daniel Shahaf
2016-01-30 7:46 ` typeset docs flow " Daniel Shahaf
2016-01-30 19:47 ` Bart Schaefer [this message]
2016-01-31 0:49 ` Jun T.
2016-01-31 17:03 ` Bart Schaefer
2016-02-01 3:23 ` Jun T.
2016-02-01 5:41 ` Bart Schaefer
2016-01-21 14:22 ` Vincent Lefevre
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=160130114745.ZM10270@torch.brasslantern.com \
--to=schaefer@brasslantern.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).