zsh-workers
 help / color / mirror / code / Atom feed
From: gammafn <GammaFunction@vivaldi.net>
To: zsh-workers@zsh.org
Cc: gammafn <GammaFunction@vivaldi.net>
Subject: [PATCH] Doc/Zsh/expn: Elaborate how 'word' is expanded in PEs
Date: Wed, 21 Jul 2021 15:40:34 -0500	[thread overview]
Message-ID: <20210721204034.1107354-1-GammaFunction@vivaldi.net> (raw)

---
After some discussion on what does and does not happen in PEs on irc,
I added some more information on how the alternate value `word' is
expanded.  Additionally, I saw that `word' has documentation both
before and after the alternate value forms, so I unified the examples.

Should we also mention how quoting applies to `pattern', or is that
obvious enough?
 Doc/Zsh/expn.yo | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index c218ded05..594ef751f 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -616,6 +616,14 @@ substitution on the expansion of parameter tt($i).
 
 In the following descriptions, `var(word)' refers to a single word
 substituted on the command line, not necessarily a space delimited word.
+Therefore var(word) in unquoted parameter expansions can be subject
+to all expansions, but are not subject to splitting unless
+the parameter expansion is subject to tt(SH_WORD_SPLIT) option
+the tt(=) flag, or the tt(s:)var(string)tt(:) flag.
+
+Standard shell quoting in the var(word) value can be used to selectively override
+the splitting done by the tt(SH_WORD_SPLIT) option and the tt(=) flag,
+but not splitting by the tt(s:)var(string)tt(:) flag.
 
 startitem()
 item(tt(${)var(name)tt(}))(
@@ -669,11 +677,6 @@ the prompt.  If var(word) is omitted, then a standard message is printed.
 )
 enditem()
 
-In any of the above expressions that test a variable and substitute an
-alternate var(word), note that you can use standard shell quoting in the
-var(word) value to selectively override the splitting done by the
-tt(SH_WORD_SPLIT) option and the tt(=) flag, but not splitting by the
-tt(s:)var(string)tt(:) flag.
 
 In the following expressions, when var(name) is an array and
 the substitution is not quoted, or if the `tt((@))' flag or the
-- 
2.32.0



                 reply	other threads:[~2021-07-21 20:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210721204034.1107354-1-GammaFunction@vivaldi.net \
    --to=gammafunction@vivaldi.net \
    --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).