summaryrefslogtreecommitdiff
path: root/Doc/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/compsys.yo29
-rw-r--r--Doc/Zsh/expn.yo3
-rw-r--r--Doc/Zsh/grammar.yo4
-rw-r--r--Doc/Zsh/options.yo27
4 files changed, 47 insertions, 16 deletions
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index e07ac0e9e..665c0d454 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -3687,10 +3687,12 @@ state of processing; the calling function then makes its own arrangements
for generating completions. For example, functions that implement a state
machine can use this type of action.
-Where tt(_arguments) encounters a `tt(->)var(string)', it will strip
-all leading and trailing whitespace from var(string) and set the array
-tt(state) to the set of all var(strings)s for which an action is to be
-performed.
+Where tt(_arguments) encounters var(action) in the `tt(->)var(string)'
+format, it will strip all leading and trailing whitespace from var(string)
+and set the array tt(state) to the set of all var(string)s for which an
+action is to be performed. The elements of the array tt(state_descr) are
+assigned the corresponding var(message) field from each var(optarg)
+containing such an var(action).
By default and in common with all other well behaved completion
functions, _arguments returns status zero if it was able to add matches and
@@ -3698,7 +3700,8 @@ non-zero otherwise. However, if the tt(-R) option is given,
tt(_arguments) will instead return a status of 300 to indicate that
tt($state) is to be handled.
-In addition to tt($state), tt(_arguments) also sets the global
+In addition to tt($state) and tt($state_descr), tt(_arguments) also
+sets the global
parameters `tt(context)', `tt(line)' and `tt(opt_args)' as described
below, and does not reset any changes made to the special parameters
such as tt(PREFIX) and tt(words). This gives the calling function the
@@ -3708,7 +3711,7 @@ A function calling tt(_arguments) with at least
one action containing a `tt(->)var(string)' must therefore declare
appropriate local parameters:
-example(local context state line
+example(local context state state_descr line
typeset -A opt_args)
to prevent tt(_arguments) from altering the global environment.
@@ -3970,7 +3973,7 @@ Example:
example(_example_caching_policy () {
# rebuild if cache is more than a week old
local -a oldp
- oldp=( "$1"(Nmw+1) )
+ oldp=( "$1"(Nm+7) )
(( $#oldp ))
})
)
@@ -4794,21 +4797,23 @@ values (but not those for the arguments) should be printed.
The associative array tt(val_args) is used to report values and their
arguments; this works similarly to the tt(opt_args) associative array
used by tt(_arguments). Hence the function calling tt(_values) should
-declare the local parameters tt(state), tt(line), tt(context) and
-tt(val_args):
+declare the local parameters tt(state), tt(state_descr), tt(line),
+tt(context) and tt(val_args):
-example(local context state line
+example(local context state state_descr line
typeset -A val_args)
when using an action of the form `tt(->)var(string)'. With this
function the tt(context) parameter will be set to the name of the
-value whose argument is to be completed.
+value whose argument is to be completed. Note that for tt(_values),
+the tt(state) and tt(state_descr) are scalars rather than arrays.
+Only a single matching state is returned.
Note also that tt(_values) normally adds the character used as the
separator between values as an auto-removable suffix (similar to a
`tt(/)' after a directory). However, this is not possible for a
`tt(->)var(string)' action as the matches for the argument are
-generated by the calling function. To get the usual behaviour, the
+generated by the calling function. To get the usual behaviour,
the calling function can add the separator var(x) as a suffix by
passing the options `tt(-qS) var(x)' either directly or indirectly to
tt(compadd).
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 28d525f14..25c44f331 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -2430,7 +2430,8 @@ Files accessed more than var(n) days ago are selected by a positive var(n)
value (tt(PLUS())var(n)). Optional unit specifiers `tt(M)', `tt(w)',
`tt(h)', `tt(m)' or `tt(s)' (e.g. `tt(ah5)') cause the check to be
performed with months (of 30 days), weeks, hours, minutes or seconds
-instead of days, respectively.
+instead of days, respectively. An explicit `tt(d)' for days is also
+allowed.
Any fractional part of the difference between the access time and the
current part in the appropriate units is ignored in the comparison. For
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 5c803a681..30fec79c6 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -449,8 +449,8 @@ tt(do done esac then elif else fi for case
if while function repeat time until
select coproc nocorrect foreach end ! [[ { })
-Additionally, `tt(})' is recognized in any position if the tt(IGNORE_BRACES) option
-is not set.
+Additionally, `tt(})' is recognized in any position if neither the
+tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.
texinode(Comments)(Aliasing)(Reserved Words)(Shell Grammar)
sect(Comments)
cindex(comments)
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 0e0176227..68247264f 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -548,7 +548,32 @@ cindex(disabling brace expansion)
cindex(brace expansion, disabling)
cindex(expansion, brace, disabling)
item(tt(IGNORE_BRACES) (tt(-I)) <S>)(
-Do not perform brace expansion.
+Do not perform brace expansion. For historical reasons this
+also includes the effect of the tt(IGNORE_CLOSE_BRACES) option.
+)
+pindex(IGNORE_CLOSE_BRACES)
+pindex(NO_IGNORE_CLOSE_BRACES)
+pindex(IGNORECLOSEBRACES)
+pindex(NOIGNORECLOSEBRACES)
+item(tt(IGNORE_CLOSE_BRACES))(
+When neither this option nor tt(IGNORE_BRACES) is set, a sole
+close brace character `tt(})' is syntactically significant at any
+point on a command line. This has the effect that no semicolon
+or newline is necessary before the brace terminating a function
+or current shell construct. When either option is set, a closing brace
+is syntactically significant only in command position. Unlike
+tt(IGNORE_BRACES), this option does not disable brace expansion.
+
+For example, with both options unset a function may be defined
+in the following fashion:
+
+example(args() { echo $# })
+
+while if either option is set, this does not work and something
+equivalent to the following is required:
+
+example(args() { echo $#; })
+
)
pindex(KSH_GLOB)
pindex(NO_KSH_GLOB)