summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/.vimrc4
-rw-r--r--Doc/Zsh/builtins.yo211
-rw-r--r--Doc/Zsh/compsys.yo151
-rw-r--r--Doc/Zsh/compwid.yo4
-rw-r--r--Doc/Zsh/contrib.yo42
-rw-r--r--Doc/Zsh/expn.yo51
-rw-r--r--Doc/Zsh/grammar.yo3
-rw-r--r--Doc/Zsh/mod_system.yo63
-rw-r--r--Doc/Zsh/mod_zpty.yo9
-rw-r--r--Doc/Zsh/options.yo45
-rw-r--r--Doc/Zsh/params.yo23
-rw-r--r--Doc/Zsh/prompt.yo11
-rw-r--r--Doc/Zsh/zle.yo47
13 files changed, 499 insertions, 165 deletions
diff --git a/Doc/Zsh/.vimrc b/Doc/Zsh/.vimrc
new file mode 100644
index 000000000..6544cd450
--- /dev/null
+++ b/Doc/Zsh/.vimrc
@@ -0,0 +1,4 @@
+augroup filetypedetect
+ autocmd BufRead,BufNewFile **/Doc/Zsh/*.yo set ft=zyodl | source <sfile>:h:h:h/Util/zyodl.vim
+ "autocmd BufRead,BufNewFile **/Etc/FAQ.yo set ft=zyodl | source <sfile>:h:h:h/Util/zyodl.vim
+augroup END
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 1fcc7c2b7..5bbe7e70b 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -662,8 +662,8 @@ findex(fc)
cindex(history, editing)
cindex(editing history)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ ))ifnztexi( )))
-xitem(tt(fc) [ tt(-e) var(ename) ] [-L] [ tt(-m) var(match) ] [ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ])
-xitem(tt(fc -l )[ tt(-LnrdfEiD) ] [ tt(-t) var(timefmt) ] [ tt(-m) var(match) ])
+xitem(tt(fc) [ tt(-e) var(ename) ] [ tt(-LI) ] [ tt(-m) var(match) ] [ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ])
+xitem(tt(fc -l )[ tt(-LI) ] [ tt(-nrdfEiD) ] [ tt(-t) var(timefmt) ] [ tt(-m) var(match) ])
xitem(SPACES()[ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ])
xitem(tt(fc -p )[ tt(-a) ] [ var(filename) [ var(histsize) [ var(savehistsize) ] ] ])
xitem(tt(fc) tt(-P))
@@ -674,31 +674,24 @@ shell is interactive. Usually this is detected automatically, but
it can be forced by setting the tt(interactive) option when starting the
shell.
-Select a range of commands from var(first) to var(last) from the
-history list.
-The arguments var(first) and var(last) may be specified as a
-number or as a string. A negative number is used as an offset
-to the current history event number.
-A string specifies the most recent event beginning with the given string.
-All substitutions var(old)tt(=)var(new), if any, are then performed
-on the commands.
+The first two forms of this command select a range of events from
+var(first) to var(last) from the history list. The arguments var(first)
+and var(last) may be specified as a number or as a string. A negative
+number is used as an offset to the current history event number. A string
+specifies the most recent event beginning with the given string. All
+substitutions var(old)tt(=)var(new), if any, are then performed on the
+text of the events.
-If the tt(-L) flag is given, only the local history is considered (see
+In addition to the the number range,
+startsitem()
+sitem(tt(-I))(restricts to only internal events (not from tt($HISTFILE)))
+sitem(tt(-L))(restricts to only local events (not from other shells, see
tt(SHARE_HISTORY) in ifzman(zmanref(zshoptions))\
-ifnzman(noderef(Description of Options))).
-If the tt(-m) flag is given, the first argument is taken as a
-pattern (should be quoted) and only the history events matching this
-pattern are considered.
-
-When the tt(-l) flag is given, the resulting commands are listed on
-standard output.
-Otherwise the editor program var(ename) is invoked on a file containing
-these history events. If var(ename) is not given, the value
-of the parameter tt(FCEDIT) is used; if that is not set the value of the
-parameter tt(EDITOR) is used; if that is not set a builtin default, usually
-`tt(vi)' is used. If var(ename) is `tt(-)',
-no editor is invoked. When editing is complete, the edited
-command is executed.
+ifnzman(noderef(Description of Options)) -- note that tt($HISTFILE) is
+considered local when read at startup))
+sitem(tt(-m))(takes the first argument as a pattern (should be quoted) and
+only the history events matching this pattern are considered)
+endsitem()
If var(first) is not specified, it will be set to -1 (the most recent
event), or to -16 if the tt(-l) flag is given.
@@ -708,32 +701,39 @@ However, if the current event has added entries to the history with
`tt(print -s)' or `tt(fc -R)', then the default var(last) for tt(-l)
includes all new history entries since the current event began.
-The flag tt(-r) reverses the order of the commands and the
-flag tt(-n) suppresses command numbers when listing.
+When the tt(-l) flag is given, the resulting events are listed on
+standard output. Otherwise the editor program var(ename) is invoked on a
+file containing these history events. If var(ename) is not given, the
+value of the parameter tt(FCEDIT) is used; if that is not set the value of
+the parameter tt(EDITOR) is used; if that is not set a builtin default,
+usually `tt(vi)' is used. If var(ename) is `tt(-)', no editor is invoked.
+When editing is complete, the edited command is executed.
+
+The flag tt(-r) reverses the order of the events and the
+flag tt(-n) suppresses event numbers when listing.
Also when listing,
startsitem()
-sitem(tt(-d))(prints timestamps for each command)
+sitem(tt(-d))(prints timestamps for each event)
sitem(tt(-f))(prints full time-date stamps in the US
-`var(MM)tt(/)var(DD)tt(/)var(YY) var(hh):var(mm)' format)
+`var(MM)tt(/)var(DD)tt(/)var(YY) var(hh)tt(:)var(mm)' format)
sitem(tt(-E))(prints full time-date stamps in the European
-`var(dd)tt(.)var(mm)tt(.)var(yyyy) var(hh):var(mm)' format)
+`var(dd)tt(.)var(mm)tt(.)var(yyyy) var(hh)tt(:)var(mm)' format)
sitem(tt(-i))(prints full time-date stamps in ISO8601
-`var(yyyy)tt(-)var(mm)tt(-)var(dd) var(hh):var(mm)' format)
+`var(yyyy)tt(-)var(mm)tt(-)var(dd) var(hh)tt(:)var(mm)' format)
sitem(tt(-t) var(fmt))(prints time and date stamps in the given format;
var(fmt) is formatted with the strftime function with the zsh extensions
described for the tt(%D{)var(string)tt(}) prompt format in
ifzman(the section EXPANSION OF PROMPT SEQUENCES in zmanref(zshmisc))\
ifnzman(noderef(Prompt Expansion)). The resulting formatted string must be
-no more than 256 characters or will not be printed.
+no more than 256 characters or will not be printed
)
sitem(tt(-D))(prints elapsed times; may be combined with one of the
-options above.)
+options above)
endsitem()
cindex(history, stack)
cindex(stack, history)
-
`tt(fc -p)' pushes the current history list onto a stack and switches to a
new history list. If the tt(-a) option is also specified, this history list
will be automatically popped when the current function scope is exited, which
@@ -791,11 +791,18 @@ Equivalent to tt(typeset -E), except that options irrelevant to floating
point numbers are not permitted.
)
findex(functions)
-xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UkmtTuz) ] [ var(name) ... ])
+xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UkmtTuz) ] [ tt(-x) var(num) ] [ var(name) ... ])
xitem(tt(functions -M) var(mathfn) [ var(min) [ var(max) [ var(shellfn) ] ] ])
xitem(tt(functions -M) [ tt(-m) var(pattern) ... ])
item(tt(functions +M) [ tt(-m) ] var(mathfn) ... )(
-Equivalent to tt(typeset -f), with the exception of the tt(-M) option.
+Equivalent to tt(typeset -f), with the exception of the tt(-x) and
+tt(-M) options.
+
+The tt(-x) option indicates that any functions output will have
+each leading tab for indentation, added by the shell to show syntactic
+structure, expanded to the given number var(num) of spaces. var(num)
+can also be 0 to suppress all indentation.
+
Use of the tt(-M) option may not be combined with any of the options
handled by tt(typeset -f).
@@ -1106,7 +1113,7 @@ tt(popd) that do not change the environment seen by an interactive user.
)
findex(print)
xitem(tt(print )[ tt(-abcDilmnNoOpPrsSz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ])
-item(SPACES()[ tt(-R) [ tt(-en) ]] [ var(arg) ... ])(
+item(SPACES()[ tt(-xX) var(tab-stop) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])(
With the `tt(-f)' option the arguments are printed as described by tt(printf).
With no flags or with the flag `tt(-)', the arguments are printed on
the standard output as described by tt(echo), with the following differences:
@@ -1201,6 +1208,27 @@ tt(HIST_LEX_WORDS) option active.
item(tt(-u) var(n))(
Print the arguments to file descriptor var(n).
)
+item(tt(-x) var(tab-stop))(
+Expand leading tabs on each line of output in the printed string
+assuming a tab stop every var(tab-stop) characters. This is appropriate
+for formatting code that may be indented with tabs. Note that leading
+tabs of any argument to print, not just the first, are expanded, even if
+tt(print) is using spaces to separate arguments (the column count
+is maintained across arguments but may be incorrect on output
+owing to previous unexpanded tabs).
+
+The start of the output of each print command is assumed to be aligned
+with a tab stop. Widths of multibyte characters are handled if the
+option tt(MULTIBYTE) is in effect. This option is ignored if other
+formatting options are in effect, namely column alignment or
+tt(printf) style, or if output is to a special location such as shell
+history or the command line editor.
+)
+item(tt(-X) var(tab-stop))(
+This is similar to tt(-x), except that all tabs in the printed string
+are expanded. This is appropriate if tabs in the arguments are
+being used to produce a table format.
+)
item(tt(-z))(
Push the arguments onto the editing buffer stack, separated by spaces.
)
@@ -1699,10 +1727,10 @@ cindex(parameters, declaring)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ ))ifnztexi( )))
xitem(tt(typeset )[ {tt(PLUS())|tt(-)}tt(AHUaghlmprtux) ] \
[ {tt(PLUS())|tt(-)}tt(EFLRZi) [ var(n) ] ])
-xitem(SPACES()[ tt(+) | var(name)[tt(=)var(value)] ... ])
+xitem(SPACES()[ tt(+) ] [ var(name)[tt(=)var(value)] ... ])
xitem(tt(typeset )tt(-T) [ {tt(PLUS())|tt(-)}tt(Uglprux) ] [ {tt(PLUS())|tt(-)}tt(LRZ) [ var(n) ] ])
-xitem(SPACES()[ tt(+) | var(SCALAR)[tt(=)var(value)] var(array) [ var(sep) ] ])
-item(tt(typeset) tt(-f) [ {tt(PLUS())|tt(-)}tt(TUkmtuz) ] [ tt(+) | var(name) ... ])(
+xitem(SPACES()[ tt(+) | var(SCALAR)[tt(=)var(value)] var(array)[tt(=LPAR())var(value) ...tt(RPAR())] [ var(sep) ] ])
+item(tt(typeset) tt(-f) [ {tt(PLUS())|tt(-)}tt(TUkmtuz) ] [ tt(+) ] [ var(name) ... ])(
Set or display attributes and values for shell parameters.
A parameter is created for each var(name) that does not already refer
@@ -1715,22 +1743,72 @@ 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). Note that arrays currently cannot be
-assigned in tt(typeset) expressions, only scalars and integers. Unless
-the option tt(KSH_TYPESET) is set, normal expansion rules apply to
-assignment arguments, so var(value) may be split into separate words; if
-the option is set, assignments which can be recognised when expansion is
-performed are treated as single words. For example the command
-tt(typeset vbl=$(echo one two)) is treated as having one argument if
-tt(KSH_TYPESET) is set, but otherwise is treated as having the two arguments
-tt(vbl=one) and tt(two).
+var(name) is set to var(value). All forms of the command
+handle scalar assignment.
+
+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:
+
+example(# Reserved word parsing
+typeset svar=$(echo one word) avar=(several words))
+
+The above creates a scalar parameter tt(svar) and an array
+parameter tt(avar) as if the assignments had been
+
+example(svar="one word"
+avar=(several words))
+
+On the other hand:
+
+example(# Normal builtin interface
+builtin typeset svar=$(echo two words))
+
+The tt(builtin) keyword causes the above to use the standard builtin
+interface to tt(typeset) in which argument parsing is perfomed in the same
+way as for other commands. This example creates a scalar tt(svar)
+containing the value tt(two) and another scalar parameter tt(words) with
+no value. An array value in this case would either cause an error or be
+treated as an obscure set of glob qualifiers.
+
+Arbitrary arguments are allowed if they take the form of assignments
+after command line expansion; however, these only perform scalar
+assignment:
+
+example(var='svar=val'
+typeset $var)
+
+The above sets the scalar parameter tt(svar) to the value tt(val).
+Parentheses around the value within tt(var) would not cause array
+assignment as they will be treated as ordinary characters when tt($var)
+is substituted. Any non-trivial expansion in the name part of the
+assignment causes the argument to be treated in this fashion:
+
+example(typeset {var1,var2,var3}=name)
+
+The above syntax is valid, and has the expected effect of setting the
+three parameters to the same value, but the command line is parsed as
+a set of three normal command line arguments to tt(typeset) after
+expansion. Hence it is not possible to assign to multiple arrays by
+this means.
+
+Note that each interface to any of the commands my be disabled
+separately. For example, `tt(disable -r typeset)' disables the reserved
+word interface to tt(typeset), exposing the builtin interface, while
+`tt(disable typeset)' disables the builtin.
If the shell option tt(TYPESET_SILENT) is not set, for each remaining
-var(name) that refers to a parameter that is 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.
+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
@@ -1801,7 +1879,7 @@ the current state, readonly specials (whose values cannot be
changed) are not shown and assignments to arrays are shown before
the tt(typeset) rendering the array readonly.
)
-item(tt(-T) [ var(scalar)[tt(=)var(value)] var(array) [ var(sep) ] ])(
+item(tt(-T) [ var(scalar)[tt(=)var(value)] var(array)[tt(=LPAR())var(value) ...tt(RPAR())] [ var(sep) ] ])(
This flag has a different meaning when used with tt(-f); see below.
Otherwise the tt(-T) option requires zero, two, or three arguments to be
present. With no arguments, the list of parameters created in this
@@ -1811,10 +1889,13 @@ together in the manner of tt($PATH) and tt($path). The optional third
argument is a single-character separator which will be used to join the
elements of the array to form the scalar; if absent, a colon is used, as
with tt($PATH). Only the first character of the separator is significant;
-any remaining characters are ignored.
+any remaining characters are ignored. Multibyte characters are not
+yet supported.
+
+Only one of the scalar and array parameters may be assigned an initial
+value (the restrictions on assignment forms described above also apply).
-Only the scalar parameter may be assigned an initial value. Both the
-scalar and the array may otherwise be manipulated as normal. If one is
+Both the scalar and the array may be manipulated as normal. If one is
unset, the other will automatically be unset too. There is no way of
untying the variables without unsetting them, nor of converting the type
of one of them with another tt(typeset) command; tt(+T) does not work,
@@ -1906,6 +1987,9 @@ function is first referenced; see noderef(Functions). The tt(-k) and
tt(-z) flags make the function be loaded using ksh-style or zsh-style
autoloading respectively. If neither is given, the setting of the
tt(KSH_AUTOLOAD) option determines how the function is loaded.
+
+Note that the builtin tt(functions) provides the same basic capabilities
+as tt(typeset -f) but gives access to a few extra options.
)
item(tt(-h))(
Hide: only useful for special parameters (those marked `<S>' in the table in
@@ -2159,7 +2243,7 @@ the user is potentially interested in both, so this problem is intrinsic
to process IDs.
)
findex(whence)
-item(tt(whence) [ tt(-vcwfpamsS) ] var(name) ...)(
+item(tt(whence) [ tt(-vcwfpamsS) ] [ tt(-x) var(num) ] var(name) ...)(
For each var(name), indicate how it would be interpreted if used as a
command name.
@@ -2212,14 +2296,19 @@ As tt(-s), but if the pathname had to be resolved by following
multiple symlinks, the intermediate steps are printed, too. The
symlink resolved at each step might be anywhere in the path.
)
+item(tt(-x) var(num))(
+Expand tabs when outputting shell functions using the tt(-c) option.
+This has the same effect as the tt(-x) option to the tt(functions)
+builtin.
+)
enditem()
)
findex(where)
-item(tt(where) [ tt(-wpmsS) ] var(name) ...)(
+item(tt(where) [ tt(-wpmsS) ] [ tt(-x) var(num) ] var(name) ...)(
Equivalent to tt(whence -ca).
)
findex(which)
-item(tt(which) [ tt(-wpamsS) ] var(name) ...)(
+item(tt(which) [ tt(-wpamsS) ] [ tt(-x) var(num) ] var(name) ...)(
Equivalent to tt(whence -c).
)
findex(zcompile)
diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo
index a081ea32c..d067795dd 100644
--- a/Doc/Zsh/compsys.yo
+++ b/Doc/Zsh/compsys.yo
@@ -3530,37 +3530,109 @@ xitem(SPACES()[ tt(:) ] var(spec) ...)
item(tt(_arguments) [ var(opt) ... ] tt(-)tt(-) [ tt(-i) var(pats) ] [ tt(-s) var(pair) ] [ var(helpspec) ... ])(
This function can be used to give a complete specification for completion
for a command whose arguments follow standard UNIX option and argument
-conventions. Options to tt(_arguments) itself must be in separate words,
-i.e. tt(-s -w), not tt(-sw).
+conventions.
-When calling tt(_arguments), all var(spec)s that describe options of the
-analyzed command line must precede all var(spec)s that describe non-option
-(aka "normal") arguments of the analyzed line. To avoid ambiguity, all
+em(Options overview)
+
+Options to tt(_arguments) itself must be in separate words, i.e. tt(-s -w),
+not tt(-sw). The options are followed by var(spec)s that describe options and
+arguments of the analyzed command. var(spec)s that describe option flags must
+precede var(spec)s that describe non-option ("positional" or "normal")
+arguments of the analyzed line. To avoid ambiguity, all
options to tt(_arguments) itself may be separated from the var(spec) forms
by a single colon.
-The tt(-s -w -W -A) and tt(-S) options describe how parsing of the command
-line should proceed, and are discussed in context below. The `tt(-)tt(-)'
+The `tt(-)tt(-)'
form is used to intuit var(spec) forms from the help output of the command
being analyzed, and is described in detail below. The var(opts) for the
`tt(-)tt(-)' form are otherwise the same options as the first form. Note
that `tt(-s)' following `tt(-)tt(-)' has a distinct meaning from `tt(-s)'
preceding `tt(-)tt(-)', and both may appear.
-With the option tt(-n), tt(_arguments) sets the parameter tt(NORMARG)
+The option switches tt(-s), tt(-S), tt(-A), tt(-w), and tt(-W) affect how
+tt(_arguments) parses the analyzed command line's options. These switches are
+useful for commands with standard argument parsing.
+
+The options of tt(_arguments) have the following meanings:
+
+startitem()
+item(tt(-n))(
+With this option, tt(_arguments) sets the parameter tt(NORMARG)
to the position of the first normal argument in the tt($words) array,
i.e. the position after the end of the options. If that argument
has not been reached, tt(NORMARG) is set to tt(-1). The caller
should declare `tt(integer NORMARG)' if the tt(-n) option is passed;
otherwise the parameter is not used.
+)
+item(tt(-s))(
+Enable em(option stacking) for single-letter options, whereby multiple
+single-letter options may be combined into a single word. For example,
+the two options `tt(-x)' and `tt(-y)' may be combined into
+a single word `tt(-xy)'. By default, every word corresponds to a single
+option name (`tt(-xy)' is a single option named `tt(xy)').
+
+Options beginning with a single hyphen or plus sign are eligible for stacking;
+words beginning with two hyphens are not.
+
+Note that tt(-s) after tt(-)tt(-) has a different meaning, which is documented
+in the segment entitled `Deriving var(spec) forms from the help output'.
+)
+item(tt(-w))(
+In combination with tt(-s), allow option stacking
+even if one or more of the options take
+arguments. For example, if tt(-x) takes an argument, with no
+tt(-s), `tt(-xy)' is considered as a single (unhandled) option; with
+tt(-s), tt(-xy) is an option with the argument `tt(y)'; with both tt(-s)
+and tt(-w), tt(-xy) may be the option tt(-x) and the option tt(-y) with
+arguments still to come.
+)
+item(tt(-W))(
+This option takes tt(-w) a stage further: it is possible to
+complete single-letter options even after an argument that occurs in the
+same word. However, it depends on the action performed whether options
+will really be completed at this point. For more control, use a
+utility function like tt(_guard) as part of the action.
+)
+item(tt(-C))(
+Modify the tt(curcontext) parameter for an action of the form `tt(->)var(state)'.
+This is discussed in detail below.
+)
+item(tt(-R))(
+Return status 300 instead of zero when a tt($state) is to
+be handled, in the `tt(->)var(string)' syntax.
+)
+item(tt(-S))(
+Do not complete options after a `tt(-)tt(-)' appearing on the line,
+and ignore the `tt(-)tt(-)'. For example, with tt(-S), in the line
-The option `tt(-M) var(matchspec)' sets a match specification to use to
-completion option names and values. The default var(matchspec) is:
+example(foobar -x -- -y)
+the `tt(-x)' is considered an option, the `tt(-y)' is considered an
+argument, and the `tt(-)tt(-)' is considered to be neither.
+)
+item(tt(-A) var(pat))(
+Do not complete options after the first non-option
+argument on the line. var(pat) is a pattern matching
+all strings which are not to be taken as arguments. For example, to make
+tt(_arguments) stop completing options after the first normal argument, but
+ignoring all strings starting with a hyphen even if they are not described
+by one of the var(optspec)s, the form is `tt(-A "-*")'.
+)
+item(tt(-O) var(name))(
+Pass the elements of the array var(name) as arguments to functions called to
+execute var(action)s.
+This is discussed in detail below.
+)
+item(tt(-M) var(matchspec))(
+Use the match specification var(matchspec) for completing option names and values.
+The default var(matchspec) allows partial word completion after `tt(_)' and
+`tt(-)', such as completing `tt(-f-b)' to `tt(-foo-bar)'. The default
+var(matchspec) is:
example(tt(r:|[_-]=* r:|=*))
+)
+enditem()
-This allows partial word completion after `tt(_)' and `tt(-)', for example
-`tt(-f-b)' can be completed to `tt(-foo-bar)'.
+em(var(spec)s: overview)
Each of the following forms is a var(spec) describing individual sets of
options or arguments on the command line being analyzed.
@@ -3601,26 +3673,6 @@ This describes an option. The colon indicates handling for one or more
arguments to the option; if it is not present, the option is assumed to
take no arguments.
-By default, options are multi-character name, one `tt(-)var(word)' per
-option. With tt(-s), options may be single characters, with more than
-one option per word, although words starting with two hyphens, such as
-`tt(-)tt(-prefix)', are still considered complete option names. This is
-suitable for standard GNU options.
-
-The combination of tt(-s) with tt(-w) allows single-letter options to be
-combined in a single word even if one or more of the options take
-arguments. For example, if tt(-x) takes an argument, with no
-tt(-s) `tt(-xy)' is considered as a single (unhandled) option; with
-tt(-s) tt(-xy) is an option with the argument `tt(y)'; with both tt(-s)
-and tt(-w), tt(-xy) may be the option tt(-x) and the option tt(-y) with
-arguments still to come.
-
-The option tt(-W) takes this a stage further: it is possible to
-complete single-letter options even after an argument that occurs in the
-same word. However, it depends on the action performed whether options
-will really be completed at this point. For more control, use a
-utility function like tt(_guard) as part of the action.
-
The following forms are available for the initial var(optspec), whether
or not the option has arguments.
@@ -3682,23 +3734,6 @@ enditem()
It is possible for options with a literal `tt(PLUS())' or `tt(=)' to
appear, but that character must be quoted, for example `tt(-\+)'.
-The options tt(-S) and tt(-A) are available to simplify the specifications
-for commands with standard option parsing. With tt(-S), no option will be
-completed after a `tt(-)tt(-)' appearing on its own on the line; this
-argument will otherwise be ignored; hence in the line
-
-example(foobar -x -- -y)
-
-the `tt(-x)' is considered an option but the `tt(-y)' is considered an
-argument, while the `tt(-)tt(-)' is considered to be neither.
-
-With tt(-A), no options will be completed after the first non-option
-argument on the line. The tt(-A) must be followed by a pattern matching
-all strings which are not to be taken as arguments. For example, to make
-tt(_arguments) stop completing options after the first normal argument, but
-ignoring all strings starting with a hyphen even if they are not described
-by one of the var(optspec)s, the form is `tt(-A "-*")'.
-
Each var(optarg) following an var(optspec) must take one of the
following forms:
@@ -3719,7 +3754,7 @@ xitem(tt(:*)var(pattern)tt(::)var(message)tt(:)var(action))
item(tt(:*)var(pattern)tt(:::)var(message)tt(:)var(action))(
This describes multiple arguments. Only the last var(optarg) for
an option taking multiple arguments may be
-given in this form. If the var(pattern) is empty (i.e., tt(:*:)), all
+given in this form. If the var(pattern) is empty (i.e. tt(:*:)), all
the remaining words on the line are to be completed as described by the
var(action); otherwise, all the words up to and including a word matching
the var(pattern) are to be completed using the var(action).
@@ -3766,15 +3801,17 @@ given by an array, and tt(_arguments) is called repeatedly for more
specific contexts: on the first call `tt(_arguments $global_options)' is
used, and on subsequent calls `tt(_arguments !$^global_options)'.
+em(var(spec)s: actions)
+
In each of the forms above the var(action) determines how
completions should be generated. Except for the `tt(->)var(string)'
form below, the var(action) will be executed by calling the
tt(_all_labels) function to process all tag labels. No special handling
of tags is needed unless a function call introduces a new one.
-The option `tt(-O) var(name)' specifies the name of an array whose elements
-will be passed as arguments to functions called to execute var(action)s.
-For example, this can be used to pass the same set of options for the
+The functions called to execute var(action)s will be called with the the
+elements of the array named by the `tt(-O) var(name)' option as arguments.
+This can be used, for example, to pass the same set of options for the
tt(compadd) builtin to all var(action)s.
The forms for var(action) are as follows.
@@ -3918,6 +3955,8 @@ example(local curcontext="$curcontext")
This is useful where it is not possible for multiple states to be valid
together.
+em(Specifying multiple sets of options)
+
It is possible to specify multiple sets of options and
arguments with the sets separated by single hyphens. The specifications
before the first hyphen (if any) are shared by all the remaining sets.
@@ -3964,6 +4003,8 @@ A useful alternative is often an option specification with rest-arguments
(as in `tt(-foo:*:...)'); here the option tt(-foo) swallows up all
remaining arguments as described by the var(optarg) definitions.
+em(Deriving var(spec) forms from the help output)
+
The option `tt(-)tt(-)' allows tt(_arguments) to work out the names of long
options that support the `tt(-)tt(-help)' option which is standard in many
GNU commands. The command word is called with the argument
@@ -4036,6 +4077,8 @@ as `tt(-)tt(-enable-foo)', but the script also accepts the negated form
example(_arguments -- -s "LPAR()(#s)--enable- --disable-RPAR()")
+em(Miscellaneous notes)
+
Finally, note that tt(_arguments) generally expects to be the primary
function handling any completion for which it is used. It may have side
effects which change the treatment of any matches added by other functions
@@ -4158,7 +4201,7 @@ the functions for the fields if they are called.
findex(_describe)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi( )))
xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ])
-item(SPACES()[ tt(-)tt(-) var(descr) var(name1) [ var(name2) ] [ var(opt) ... ] ... ])(
+item(SPACES()[ tt(-)tt(-) var(name1) [ var(name2) ] [ var(opt) ... ] ... ])(
This function associates completions with descriptions.
Multiple groups separated by tt(-)tt(-) can be supplied, potentially with
different completion options var(opt)s.
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo
index 0c0a15d41..40cabea88 100644
--- a/Doc/Zsh/compwid.yo
+++ b/Doc/Zsh/compwid.yo
@@ -697,7 +697,9 @@ format completion lists and to make explanatory string be shown in
completion lists (since empty matches can be given display strings
with the tt(-d) option). And because all but one empty string would
otherwise be removed, this option implies the tt(-V) and tt(-2)
-options (even if an explicit tt(-J) option is given).
+options (even if an explicit tt(-J) option is given). This can be
+important to note as it affects the name space into which matches are
+added.
)
xitem(tt(-))
item(tt(-)tt(-))(
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 8b6b7d3b7..4e87d4116 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -756,7 +756,7 @@ revision number. This style lets you modify how that string should look.
)
kindex(nvcsformats)
item(tt(nvcsformats))(
-These "formats" are exported when we didn't detect a version control system
+These "formats" are set when we didn't detect a version control system
for the current directory or tt(vcs_info) was disabled. This is useful if
you want tt(vcs_info) to completely take over the generation of your
prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to
@@ -775,7 +775,7 @@ behavior using hooks.
kindex(max-exports)
item(tt(max-exports))(
Defines the maximum number of
-tt(vcs_info_msg_*_) variables tt(vcs_info) will export.
+tt(vcs_info_msg_*_) variables tt(vcs_info) will set.
)
kindex(enable)
item(tt(enable))(
@@ -1224,16 +1224,15 @@ All functions named tt(VCS_INFO_*) are for internal use only.
subsect(Variable Description)
startitem()
-item(tt(${vcs_info_msg_)var(N)tt(_)}) (Note the trailing underscore))
-(
+item(tt(${vcs_info_msg_)var(N)tt(_}) (Note the trailing underscore))(
Where var(N) is an integer, e.g., tt(vcs_info_msg_0_). These variables
are the storage for the informational message the last tt(vcs_info) call
has assembled. These are strongly connected to the tt(formats),
tt(actionformats) and tt(nvcsformats) styles described above. Those styles
are lists. The first member of that list gets expanded into
tt(${vcs_info_msg_0_}), the second into tt(${vcs_info_msg_1_})
-and the Nth into tt(${vcs_info_msg_N-1_}). These parameters are
-exported into the environment. (See the tt(max-exports) style above.)
+and the Nth into tt(${vcs_info_msg_N-1_}). (See the tt(max-exports)
+style above.)
)
enditem()
@@ -2272,7 +2271,8 @@ tindex(narrow-to-region)
tindex(narrow-to-region-invisible)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ))ifnztexi( )))
xitem(tt(narrow-to-region )[ tt(-p) var(pre) ] [ tt(-P) var(post) ])
-xitem(SPACES()[ tt(-S) var(statepm) | tt(-R) var(statepm) ] [ tt(-n) ] [ var(start) var(end) ])
+xitem(SPACES()[ tt(-S) var(statepm) | tt(-R) var(statepm) | [ tt(-l) var(lbufvar) ] [ tt(-r) var(rbufvar) ] ])
+xitem(SPACES()[ tt(-n) ] [ var(start) var(end) ])
item(tt(narrow-to-region-invisible))(
Narrow the editable portion of the buffer to the region between the cursor
and the mark, which may be in either order. The region may not be empty.
@@ -2308,9 +2308,15 @@ parameter, except that parameters beginning with the prefix tt(_ntr_) are
reserved for use within tt(narrow-to-region). Typically the parameter will
be local to the calling function.
+The options tt(-l) var(lbufvar) and tt(-r) var(rbufvar) may be used to
+specify parameters where the widget will store the resulting text from
+the operation. The parameter var(lbufvar) will contain tt(LBUFFER)
+and var(rbufvar) will contain tt(RBUFFER). Neither of these two options
+may be used with tt(-S) or tt(-R).
+
tt(narrow-to-region-invisible) is a simple widget which calls
tt(narrow-to-region) with arguments which replace any text outside the
-region with `tt(...)'.
+region with `tt(...)'. It does not take any arguments.
The display is restored (and the widget returns) upon any zle command
which would usually cause the line to be accepted or aborted. Hence an
@@ -3561,7 +3567,7 @@ set to the ANSI terminal escapes that turn off all attributes and turn on
bold intensity, respectively.
)
findex(fned)
-item(tt(fned) var(name))(
+item(tt(fned) [ tt(-x) var(num) ] var(name))(
Same as tt(zed -f). This function does not appear in the zsh
distribution, but can be created by linking tt(zed) to the name tt(fned)
in some directory in your tt(fpath).
@@ -3749,7 +3755,7 @@ the difference in function between tt(zargs) and tt(xargs)) or run
tt(zargs) with the tt(-)tt(-help) option.
)
findex(zed)
-xitem(tt(zed) [ tt(-f) ] var(name))
+xitem(tt(zed) [ tt(-f) [ tt(-x) var(num) ] ] var(name))
item(tt(zed -b))(
This function uses the ZLE editor to edit a file or function.
@@ -3758,7 +3764,10 @@ If the tt(-f) option is given, the name is taken to be that of
a function; if the function is marked for autoloading, tt(zed) searches
for it in the tt(fpath) and loads it. Note that functions edited this way
are installed into the current shell, but em(not) written back to the
-autoload file.
+autoload file. In this case the tt(-x) option specifies that leading
+tabs indenting the function according to syntax should be converted into
+the given number of spaces; `tt(-x 2)' is consistent with the layout
+of functions distributed with the shell.
Without tt(-f), var(name) is the path name of the file to edit, which need
not exist; it is created on write, if necessary.
@@ -3825,7 +3834,12 @@ The pattern is always treated as an tt(EXTENDED_GLOB) pattern. Any file
whose name is not changed by the substitution is simply ignored. Any
error (a substitution resulted in an empty string, two substitutions gave
the same result, the destination was an existing regular file and tt(-f)
-was not given) causes the entire function to abort without doing anything.
+was not given) causes the entire function to abort without doing
+anything.
+
+In addition to pattern replacement, the variable tt($f) can be referrred
+to in the second (replacement) argument. This makes it possible to
+use variable substitution to alter the argument; see examples below.
Options:
@@ -3874,6 +3888,10 @@ example(zmv -v '(* *)' '${1// /_}')
For any file in the current directory with at least one space in the name,
replace every space by an underscore and display the commands executed.
+example(zmv -v '* *' '${f// /_}')
+
+This does exactly the same by referring to the file name stored in tt($f).
+
For more complete examples and other implementation details, see the
tt(zmv) source file, usually located in one of the directories named in
your tt(fpath), or in tt(Functions/Misc/zmv) in the zsh distribution.
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 7d4e6fccb..d44b40a3b 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -319,6 +319,19 @@ forms of expansion.
Note that if a `tt(&)' is used within glob qualifiers an extra backslash
is needed as a tt(&) is a special character in this case.
+Also note that the order of expansions affects the interpretation of
+var(l) and var(r). When used in a history expansion, which occurs before
+any other expansions, var(l) and var(r) are treated as literal strings
+(except as explained for tt(HIST_SUBST_PATTERN) below). When used in
+parameter expansion, the replacement of var(r) into the parameter's value
+is done first, and then any additional process, parameter, command,
+arithmetic, or brace references are applied, which may evaluate those
+substitutions and expansions more than once if var(l) appears more than
+once in the starting value. When used in a glob qualifier, any
+substitutions or expansions are performed once at the time the qualifier
+is parsed, even before the `tt(:s)' expression itself is divided into
+var(l) and var(r) sides.
+
If the option tt(HIST_SUBST_PATTERN) is set, var(l) is treated as
a pattern of the usual form described in
ifzman(the section FILENAME GENERATION below)\
@@ -917,6 +930,25 @@ array index order. Note that `tt(a)' is therefore equivalent to the
default but `tt(Oa)' is useful for obtaining an array's elements in reverse
order.
)
+item(tt(b))(
+Quote with backslashes only characters that are special to pattern
+matching. This is useful when the contents of the variable are to be
+tested using tt(GLOB_SUBST), including the tt(${~)var(...)tt(}) switch.
+
+Quoting using one of the tt(q) family of flags does not work
+for this purpose since quotes are not stripped from non-pattern
+characters by tt(GLOB_SUBST). In other words,
+
+example(pattern=${(q)str}
+[[ $str = ${~pattern} ]])
+
+works if tt($str) is `tt(a*b)' but not if it is `tt(a b)', whereas
+
+example(pattern=${(b)str}
+[[ $str = ${~pattern} ]])
+
+is always true for any possible value of tt($str).
+)
item(tt(c))(
With tt(${#)var(name)tt(}), count the total number of characters in an array,
as if the elements were concatenated with spaces between them. This is not
@@ -1021,25 +1053,6 @@ form of single quoting is used that only quotes the string if needed to
protect special characters. Typically this form gives the most readable
output.
)
-item(tt(b))(
-Quote with backslashes only characters that are special to pattern
-matching. This is useful when the contents of the variable are to be
-tested using tt(GLOB_SUBST), including the tt(${~)var(...)tt(}) switch.
-
-Quoting using one of the tt(q) family of flags does not work
-for this purpose since quotes are not stripped from non-pattern
-characters by tt(GLOB_SUBST). In other words,
-
-example(pattern=${(q)str}
-[[ $str = ${~pattern} ]])
-
-works if tt($str) is tt('a*b') but not if it is tt('a b'), whereas
-
-example(pattern=${(b)str}
-[[ $str = ${~pattern} ]])
-
-is always true for any possible value of tt($str).
-)
item(tt(Q))(
Remove one level of quotes from the resulting words.
)
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 4476fc392..83968fedf 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -472,7 +472,8 @@ word of a command unless quoted or disabled using tt(disable -r):
tt(do done esac then elif else fi for case
if while function repeat time until
-select coproc nocorrect foreach end ! [[ { })
+select coproc nocorrect foreach end ! [[ { }
+declare export float integer local readonly typeset)
Additionally, `tt(})' is recognized in any position if neither the
tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.
diff --git a/Doc/Zsh/mod_system.yo b/Doc/Zsh/mod_system.yo
index 7f9c011a7..7f2009b43 100644
--- a/Doc/Zsh/mod_system.yo
+++ b/Doc/Zsh/mod_system.yo
@@ -28,6 +28,52 @@ system's range), a return status of 1 indicates an error in the
parameters, and a return status of 2 indicates the error name was
not recognised (no message is printed for this).
)
+findex(sysopen)
+redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ ))ifnztexi( )))
+xitem(tt(sysopen) [ tt(-arw) ] [ tt(-m) var(permissions) ] [ tt(-o) var(options) ])
+item(SPACES()tt(-u) var(fd) var(file))(
+This command opens a file. The tt(-r), tt(-w) and tt(-a) flags indicate
+whether the file should be opened for reading, writing and appending,
+respectively. The tt(-m) option allows the initial permissions to use when
+creating a file to be specified in octal form. The file descriptor is
+specified with tt(-u). Either an explicit file descriptor in the range 0 to 9 can
+be specified or a variable name can be given to which the file descriptor
+number will be assigned.
+
+The tt(-o) option allows various system specific options to be
+specified as a comma-separated list. The following is a list of possible
+options. Note that, depending on the system, some may not be available.
+startitem()
+item(tt(cloexec))(
+mark file to be closed when other programs are executed
+)
+xitem(tt(create))
+item(tt(creat))(
+create file if it does not exist
+)
+item(tt(excl))(
+create file, error if it already exists
+)
+item(tt(noatime))(
+suppress updating of the file atime
+)
+item(tt(nofollow))(
+fail if var(file) is a symbolic link
+)
+item(tt(sync))(
+request that writes wait until data has been physically written
+)
+xitem(tt(truncate))
+item(tt(trunc))(
+truncate file to size 0
+)
+enditem()
+
+To close the file, use one of the following:
+
+example(tt(exec {)var(fd)tt(}<&-)
+tt(exec {)var(fd)tt(}>&-))
+)
findex(sysread)
redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ ))ifnztexi( )))
xitem(tt(sysread )[ tt(-c) var(countvar) ] [ tt(-i) var(infd) ] [ tt(-o) var(outfd) ])
@@ -89,6 +135,14 @@ usual rules; no write to var(outfd) is attempted.
)
enditem()
)
+item(tt(sysseek) [ tt(-u) var(fd) ] [ tt(-w) tt(start)|tt(end)|tt(current) ] var(offset))(
+The current file position at which future reads and writes will take place is
+adjusted to the specified byte offset. The var(offset) is evaluated as a math
+expression. The tt(-u) option allows the file descriptor to be specified. By
+default the offset is specified relative to the start or the file but, with the
+tt(-w) option, it is possible to specify that the offset should be relative to
+the current position or the end of the file.
+)
item(tt(syswrite) [ tt(-c) var(countvar) ] [ tt(-o) var(outfd) ] var(data))(
The data (a single string of bytes) are written to the file descriptor
var(outfd), or 1 if that is not given, using the tt(write) system call.
@@ -161,6 +215,15 @@ version of the shell before it was implemented).
)
enditem()
+subsect(Math Functions)
+
+startitem()
+item(tt(systell+LPAR()var(fd)RPAR()))(
+The systell math function returns the current file position for the file
+descriptor passed as an argument.
+)
+enditem()
+
subsect(Parameters)
startitem()
diff --git a/Doc/Zsh/mod_zpty.yo b/Doc/Zsh/mod_zpty.yo
index 340f98314..44b375a3c 100644
--- a/Doc/Zsh/mod_zpty.yo
+++ b/Doc/Zsh/mod_zpty.yo
@@ -18,6 +18,15 @@ characters are echoed.
With the tt(-b) option, input to and output from the pseudo-terminal are
made non-blocking.
+
+The shell parameter tt(REPLY) is set to the file descriptor assigned to
+the master side of the pseudo-terminal. This allows the terminal to be
+monitored with ZLE descriptor handlers (see ifzman(zmanref(zshzle))\
+ifnzman(noderef(Zle Builtins))) or manipulated with tt(sysread) and
+tt(syswrite) (see ifzman(THE ZSH/SYSTEM MODULE in zmanref(zshmodules))\
+ifnzman(noderef(The zsh/system Module))). em(Warning): Use of tt(sysread)
+and tt(syswrite) is em(not) recommended, use tt(zpty -r) and tt(zpty -w)
+unless you know exactly what you are doing.
)
item(tt(zpty) tt(-d) [ var(name) ... ])(
The second form, with the tt(-d) option, is used to delete commands
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 4dd68c9cb..abd0f8715 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -124,7 +124,7 @@ pindex(POSIXCD)
pindex(NO_POSIX_CD)
pindex(NOPOSIXCD)
cindex(CDPATH, order of checking)
-item(tt(POSIX_CD))(
+item(tt(POSIX_CD) <K> <S>)(
Modifies the behaviour of tt(cd), tt(chdir) and tt(pushd) commands
to make them more compatible with the POSIX standard. The behaviour with
the option unset is described in the documentation for the tt(cd)
@@ -634,7 +634,7 @@ pindex(NO_MULTIBYTE)
pindex(NOMULTIBYTE)
cindex(characters, multibyte, in expansion and globbing)
cindex(multibyte characters, in expansion and globbing)
-item(tt(MULTIBYTE) <C> <K> <Z>)(
+item(tt(MULTIBYTE) <D>)(
Respect multibyte characters when found in strings.
When this option is set, strings are examined using the
system library to determine how many bytes form a character, depending
@@ -642,10 +642,8 @@ on the current locale. This affects the way characters are counted in
pattern matching, parameter values and various delimiters.
The option is on by default if the shell was compiled with
-tt(MULTIBYTE_SUPPORT) except in tt(sh) emulation; otherwise it is off by
-default and has no effect if turned on. The mode is off in tt(sh)
-emulation for compatibility but for interactive use may need to be
-turned on if the terminal interprets multibyte characters.
+tt(MULTIBYTE_SUPPORT); otherwise it is off by default and has no effect
+if turned on.
If the option is off a single byte is always treated as a single
character. This setting is designed purely for examining strings
@@ -1096,10 +1094,12 @@ pindex(NOCLOBBER)
cindex(clobbering, of files)
cindex(file clobbering, allowing)
item(tt(CLOBBER) (tt(PLUS()C), ksh: tt(PLUS()C)) <D>)(
-Allows `tt(>)' redirection to truncate existing files,
-and `tt(>>)' to create files.
-Otherwise `tt(>!)' or `tt(>|)' must be used to truncate a file,
-and `tt(>>!)' or `tt(>>|)' to create a file.
+Allows `tt(>)' redirection to truncate existing files.
+Otherwise `tt(>!)' or `tt(>|)' must be used to truncate a file.
+
+If the option is not set, and the option tt(APPEND_CREATE) is also
+not set, `tt(>>!)' or `tt(>>|)' must be used to create a file.
+If either option is set, `tt(>>)' may be used.
)
pindex(CORRECT)
pindex(NO_CORRECT)
@@ -1794,6 +1794,21 @@ enditem()
subsect(Shell Emulation)
startitem()
+pindex(APPEND_CREATE)
+pindex(NO_APPEND_CREATE)
+pindex(APPENDCREATE)
+pindex(NOAPPENDCREATE)
+cindex(clobbering, POSIX compatibility)
+cindex(file clobbering, POSIX compatibility)
+cindex(no clobber, POSIX compatible)
+item(tt(APPEND_CREATE) <K> <S>)(
+This option only applies when tt(NO_CLOBBER) (-tt(C)) is in effect.
+
+If this option is not set, the shell will report an error when a
+append redirection (tt(>>)) is used on a file that does not already
+exists (the traditional zsh behaviour of tt(NO_CLOBBER)). If the option
+is set, no error is reported (POSIX behaviour).
+)
pindex(BASH_REMATCH)
pindex(NO_BASH_REMATCH)
pindex(BASHREMATCH)
@@ -1930,7 +1945,13 @@ pindex(KSHTYPESET)
pindex(NOKSHTYPESET)
cindex(argument splitting, in typeset etc.)
cindex(ksh, argument splitting in typeset)
-item(tt(KSH_TYPESET) <K>)(
+item(tt(KSH_TYPESET))(
+This option is now obsolete: a better appropximation to the behaviour of
+other shells is obtained with the reserved word interface to
+tt(declare), tt(export), tt(float), tt(integer), tt(local), tt(readonly)
+and tt(typeset). Note that the option is only applied when the reserved
+word interface is em(not) in use.
+
Alters the way arguments to the tt(typeset) family of commands, including
tt(declare), tt(export), tt(float), tt(integer), tt(local) and
tt(readonly), are processed. Without this option, zsh will perform normal
@@ -2057,7 +2078,7 @@ of shell parameters and modules).
In addition, setting this option limits the effect of parameter
substitution with no braces, so that the expression tt($#) is treated as
the parameter tt($#) even if followed by a valid parameter name.
-When it is unset, zsh allows expresions of the form tt($#)var(name)
+When it is unset, zsh allows expressions of the form tt($#)var(name)
to refer to the length of tt($)var(name), even for special variables,
for example in expressions such as tt($#-) and tt($#*).
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index eb3eb367e..a4067883a 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1642,6 +1642,29 @@ item(tt(ZDOTDIR))(
The directory to search for shell startup files (.zshrc, etc),
if not tt($HOME).
)
+vindex(zle_bracketed_paste)
+cindex(bracketed paste)
+cindex(enabling bracketed paste)
+item(tt(zle_bracketed_paste))(
+Many terminal emulators have a feature that allows applications to
+identify when text is pasted into the terminal rather than being typed
+normally. For ZLE, this means that special characters such as tabs
+and newlines can be inserted instead of invoking editor commands.
+Furthermore, pasted text forms a single undo event and if the region is
+active, pasted text will replace the region.
+
+This two-element array contains the terminal escape sequences for
+enabling and disabling the feature. These escape sequences are used to
+enable bracketed paste when ZLE is active and disable it at other times.
+Unsetting the parameter has the effect of ensuring that bracketed paste
+remains disabled.
+)
+vindex(zle_highlight)
+item(tt(zle_highlight))(
+An array describing contexts in which ZLE should highlight the input text.
+See ifzman(em(Character Highlighting) in zmanref(zshzle))\
+ifnzman(noderef(Character Highlighting)).
+)
vindex(ZLE_LINE_ABORTED)
item(tt(ZLE_LINE_ABORTED))(
This parameter is set by the line editor when an error occurs. It
diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo
index 307587678..3c8f2a094 100644
--- a/Doc/Zsh/prompt.yo
+++ b/Doc/Zsh/prompt.yo
@@ -92,6 +92,10 @@ print as many as there are. This is most useful in prompts tt(PS2) for
continuation lines and tt(PS4) for debugging with the tt(XTRACE) option; in
the latter case it will also work non-interactively.
)
+item(tt(%^))(
+The status of the parser in reverse. This is the same as `tt(%_)' other than
+the order of strings. It is often used in tt(RPS2).
+)
xitem(tt(%d))
item(tt(%/))(
Current working directory. If an integer follows the `tt(%)',
@@ -202,9 +206,10 @@ The GNU extension that a `tt(-)' between the tt(%) and the
format character causes a leading zero or space to be stripped
is handled directly by the shell for the format characters tt(d), tt(f),
tt(H), tt(k), tt(l), tt(m), tt(M), tt(S) and tt(y); any other format
-characters are provided to tt(strftime+LPAR()RPAR()) with any leading `tt(-)',
-present, so the handling is system dependent. Further GNU
-extensions are not supported at present.
+characters are provided to the system's strftime+LPAR()3RPAR()
+with any leading `tt(-)' present, so the handling is system dependent.
+Further GNU (or other) extensions are also passed to strftime+LPAR()3RPAR()
+and may work if the system supports them.
)
enditem()
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 16d661f06..c06e2260e 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -29,6 +29,7 @@ line editor. See
ifzman(em(Parameters Used By The Shell) in zmanref(zshparam))\
ifnzman(noderef(Parameters Used By The Shell)).
+vindex(zle_highlight, use of)
The parameter tt(zle_highlight) is also used by the line editor; see
ifzman(em(Character Highlighting) below)\
ifnzman(noderef(Character Highlighting)). Highlighting
@@ -960,6 +961,24 @@ A number representing the state of the undo history. The only use
of this is passing as an argument to the tt(undo) widget in order to
undo back to the recorded point. Read-only.
)
+vindex(UNDO_LIMIT_NO)
+item(tt(UNDO_LIMIT_NO) (integer))(
+A number corresponding to an existing change in the undo history;
+compare tt(UNDO_CHANGE_NO). If this is set to a value greater
+than zero, the tt(undo) command will not allow the line to
+be undone beyond the given change number. It is still possible
+to use `tt(zle undo) var(change)' in a widget to undo beyond
+that point; in that case, it will not be possible to undo at
+all until tt(UNDO_LIMIT_NO) is reduced. Set to 0 to disable the limit.
+
+A typical use of this variable in a widget function is as follows (note
+the additional function scope is required):
+
+example(LPAR()RPAR() {
+ local UNDO_LIMIT_NO=$UNDO_CHANGE_NO
+ # Perform some form of recursive edit.
+})
+)
vindex(WIDGET)
item(tt(WIDGET) (scalar))(
The name of the widget currently being executed; read-only.
@@ -1360,7 +1379,9 @@ item(tt(clear-screen))(
Clear the screen, remaining in incremental search mode.
)
item(tt(history-incremental-search-backward))(
-Find the next occurrence of the contents of the mini-buffer.
+Find the next occurrence of the contents of the mini-buffer. If the
+mini-buffer is empty, the most recent previously used search string is
+reinstated.
)
item(tt(history-incremental-search-forward))(
Invert the sense of the search.
@@ -2057,6 +2078,18 @@ tindex(beep)
item(tt(beep))(
Beep, unless the tt(BEEP) option is unset.
)
+tindex(bracketed-paste)
+item(tt(bracketed-paste))(
+This widget is invoked when text is pasted to the terminal emulator. It
+is not intended to be bound to actual keys but instead to the special
+sequence generated by the terminal emulator when text is pasted.
+If a numeric argument is given, shell quoting will be applied to the
+pasted text before it is inserted. When called from a widget function,
+an argument can be given to specify a variable to which pasted text is
+assigned.
+
+See also the tt(zle_bracketed_paste) parameter.
+)
tindex(vi-cmd-mode)
item(tt(vi-cmd-mode) (tt(^X^V)) (unbound) (tt(^[)))(
Enter command mode; that is, select the `tt(vicmd)' keymap.
@@ -2072,6 +2105,11 @@ tindex(clear-screen)
item(tt(clear-screen) (tt(^L ESC-^L)) (tt(^L)) (tt(^L)))(
Clear the screen and redraw the prompt.
)
+tindex(deactivate-region)
+item(tt(deactivate-region))(
+Make the current region inactive. This disables vim-style visual
+selection mode if it is active.
+)
tindex(describe-key-briefly)
item(tt(describe-key-briefly))(
Reads a key sequence, then prints the function bound to that sequence.
@@ -2319,7 +2357,8 @@ item(tt(undo) (tt(^_ ^Xu ^X^U)) (tt(u)) (unbound))(
Incrementally undo the last text modification. When called from a
user-defined widget, takes an optional argument indicating a previous state
of the undo history as returned by the tt(UNDO_CHANGE_NO) variable;
-modifications are undone until that state is reached.
+modifications are undone until that state is reached, subject to
+any limit imposed by the tt(UNDO_LIMIT_NO) variable.
Note that when invoked from vi command mode, the full prior change made in
insert mode is reverted, the changes having been merged when command mode was
@@ -2422,6 +2461,7 @@ enditem()
texinode(Character Highlighting)()(Zle Widgets)(Zsh Line Editor)
sect(Character Highlighting)
+vindex(zle_highlight, setting)
The line editor has the ability to highlight characters or regions
of the line that have a particular significance. This is controlled
by the array parameter tt(zle_highlight), if it has been set by the user.
@@ -2475,6 +2515,9 @@ a directory name. Note that suffix removal is configurable; the
circumstances under which the suffix will be removed may differ
for different completions.
)
+item(tt(paste))(
+Following a command to paste text, the characters that were inserted.
+)
enditem()
tt(zle_highlight) may contain additional fields for controlling how