summaryrefslogtreecommitdiff
path: root/Doc/Zsh
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/builtins.yo36
-rw-r--r--Doc/Zsh/contrib.yo22
-rw-r--r--Doc/Zsh/expn.yo29
-rw-r--r--Doc/Zsh/grammar.yo9
-rw-r--r--Doc/Zsh/mod_computil.yo12
-rw-r--r--Doc/Zsh/mod_parameter.yo8
-rw-r--r--Doc/Zsh/mod_zutil.yo2
-rw-r--r--Doc/Zsh/options.yo4
-rw-r--r--Doc/Zsh/params.yo2
-rw-r--r--Doc/Zsh/prompt.yo7
-rw-r--r--Doc/Zsh/zle.yo2
11 files changed, 97 insertions, 36 deletions
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index f709f5020..46f40cc3a 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -603,7 +603,7 @@ tt(enable -p) reenables patterns disabled with tt(disable -p). Note
that it does not override globbing options; for example, `tt(enable -p
"~")' does not cause the pattern character tt(~) to be active unless
the tt(EXTENDED_GLOB) option is also set. To enable all possible
-patterns (so that they may be invidually disabled with tt(disable -p)),
+patterns (so that they may be individually disabled with tt(disable -p)),
use `tt(setopt EXTENDED_GLOB KSH_GLOB NO_SH_GLOB)'.
)
findex(eval)
@@ -773,7 +773,7 @@ findex(functions)
xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UXkmtTuz) ] [ 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))(
+item(tt(functions +M) [ tt(-m) ] var(mathfn) ... )(
Equivalent to tt(typeset -f), with the exception of the tt(-M) option.
Use of the tt(-M) option may not be combined with any of the options
handled by tt(typeset -f).
@@ -1639,14 +1639,26 @@ Do nothing and return an exit status of 0.
findex(ttyctl)
cindex(tty, freezing)
item(tt(ttyctl) tt(-fu))(
-The tt(-f) option freezes the tty, and tt(-u) unfreezes it.
+The tt(-f) option freezes the tty (i.e. terminal or terminal emulator), and
+tt(-u) unfreezes it.
When the tty is frozen, no changes made to the tty settings by
external programs will be honored by the shell, except for changes in the
size of the screen; the shell will
simply reset the settings to their previous values as soon as each
command exits or is suspended. Thus, tt(stty) and similar programs have
-no effect when the tty is frozen. Without options it reports whether the
-terminal is frozen or not.
+no effect when the tty is frozen. Freezing the tty does not cause
+the current state to be remembered: instead, it causes future changes
+to the state to be blocked.
+
+Without options it reports whether the terminal is frozen or not.
+
+Note that, regardless of whether the tty is frozen or not, the
+shell needs to change the settings when the line editor starts, so
+unfreezing the tty does not guarantee settings made on the
+command line are preserved. Strings of commands run between
+editing the command line will see a consistent tty state.
+See also the shell variable tt(STTY) for a means of initialising
+the tty before running external commands.
)
findex(type)
item(tt(type) [ tt(-wfpams) ] var(name) ...)(
@@ -2162,6 +2174,20 @@ match one of these patterns will be written. If no var(name) is given,
the definitions of all functions currently defined or marked as
autoloaded will be written.
+Note the second form cannot be used for compiling functions that
+include redirections as part of the definition rather than within
+the body of the function; for example
+
+example(fn1() { { ... } >~/logfile })
+
+can be compiled but
+
+example(fn1() { ... } >~/logfile)
+
+cannot. It is possible to use the first form of tt(zcompile) to compile
+autoloadable functions that include the full function definition instead
+of just the body of the function.
+
The third form, with the tt(-t) option, examines an existing
compiled file. Without further arguments, the names of the original
files compiled into it are listed. The first line of output shows
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index 1c1a66a3b..8c5e66b17 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -1156,8 +1156,8 @@ item(tt(vcs_info_hookdel))(
Remove hook-functions from a given hook. The hook needs to be given as the
first non-option argument; what follows is a list of hook-function
names to un-register from the hook. If `tt(-a)' is used as the first
-argument, tt(all) occurances of the functions are unregistered. Otherwise
-only the last occurance is removed (if a function was registered to a hook
+argument, tt(all) occurrences of the functions are unregistered. Otherwise
+only the last occurrence is removed (if a function was registered to a hook
more than once) . The `tt(+vi-)' prefix needs to be left out here. See
bf(Hooks in vcs_info) below for details.
)
@@ -1292,14 +1292,14 @@ tt(vcs_info) collected from `hg'.
When setting tt(ret) to non-zero, the string in
tt(${hook_com[hg-bookmark-string]}) will be used in the tt(%m) escape in
-tt(formats) and tt(actionformats) and will be availabe in the global
+tt(formats) and tt(actionformats) and will be available in the global
tt(backend_misc) array as tt(${backend_misc[bookmarks]}).
)
item(tt(gen-applied-string))(
-Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backends
-and in tt(quilt) support when the tt(applied-string) is generated; the
-tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq) and tt(stgit)
-backends are active by default).
+Called in the tt(git) (with tt(stgit) or during rebase), and tt(hg)
+(with tt(mq)) backends and in tt(quilt) support when the tt(applied-string)
+is generated; the tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq)
+and tt(stgit) backends are active by default).
This hook gets the names of all applied patches which tt(vcs_info) collected
so far in the opposite order, which means that the first argument is the
@@ -1312,9 +1312,9 @@ tt(backend_misc) array as tt($backend_misc[patches]}); and it will be
available as tt(%p) in the tt(patch-format) and tt(nopatch-format) styles.
)
item(tt(gen-unapplied-string))(
-Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backend
-and in tt(quilt) support when the tt(unapplied-string) is generated; the
-tt(get-unapplied) style must be true.
+Called in the tt(git) (with tt(stgit) or during rebase), and tt(hg) (with
+tt(mq)) backend and in tt(quilt) support when the tt(unapplied-string) is
+generated; the tt(get-unapplied) style must be true.
This hook gets the names of all unapplied patches which tt(vcs_info)
collected so far in the opposite order, which mean that the first argument is
@@ -2965,7 +2965,7 @@ types even if they are executable. As this example shows, the complete
file name is matched against the pattern, regardless of how the file
was passed to the handler. The file is resolved to a full path using
the tt(:A) modifier described in
-ifzman(the subsection Modifers in zmanref(zshexpn))\
+ifzman(the subsection Modifiers in zmanref(zshexpn))\
ifnzman(noderef(Modifiers));
this means that symbolic links are resolved where possible, so that
links into other file systems behave in the correct fashion.
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index d01d804d2..5aab25954 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -316,7 +316,7 @@ the rightmost `tt(?)' in a context scan can similarly be omitted. Note
the same record of the last var(l) and var(r) is maintained across all
forms of expansion.
-Note that if a `tt(&)' is used within glob qualifers an extra backslash
+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.
If the option tt(HIST_SUBST_PATTERN) is set, var(l) is treated as
@@ -475,7 +475,7 @@ spawned from the parent shell which will wait for their completion.
Another problem arises any time a job with a substitution that requires
a temporary file is disowned by the shell, including the case where
`tt(&!)' or `tt(&|)' appears at the end of a command containing a
-subsitution. In that case the temporary file will not be cleaned up as
+substitution. In that case the temporary file will not be cleaned up as
the shell no longer has any memory of the job. A workaround is to use
a subshell, for example,
@@ -632,7 +632,7 @@ quoted, the elements of var(arrayname) are instead tested against the
entire expression.
)
item(tt(${)var(name)tt(:*)var(arrayname)tt(}))(
-Similar to the preceding subsitution, but in the opposite sense,
+Similar to the preceding substitution, but in the opposite sense,
so that entries present in both the original substitution and as
elements of var(arrayname) are retained and others removed.
)
@@ -701,7 +701,7 @@ print ${foo:$(( 1 + 2))}
print ${foo:$(echo 1 + 2)})
all have the same effect, extracting the string starting at the fourth
-character of tt($foo) if the substution would otherwise return a scalar,
+character of tt($foo) if the substitution would otherwise return a scalar,
or the array starting at the fourth element if tt($foo) would return an
array. Note that with the option tt(KSH_ARRAYS) tt($foo) always returns
a scalar (regardless of the use of the offset syntax) and a form
@@ -924,7 +924,7 @@ that result from field splitting.
item(tt(D))(
Assume the string or array elements contain directories and attempt
to substitute the leading part of these by names. The remainder of
-the path (the whole of it if the leading part was not subsituted)
+the path (the whole of it if the leading part was not substituted)
is then quoted so that the whole string can be used as a shell
argument. This is the reverse of `tt(~)' substitution: see
ifnzman(noderef(Filename Expansion))\
@@ -1126,13 +1126,14 @@ in string arguments to any of the flags described below that
follow this argument.
)
item(tt(~))(
-Force string arguments to any of the flags below that follow within
-the parentheses to be treated as patterns. Compare with a tt(~)
+Strings inserted into the expansion by any of the flags below are to
+be treated as patterns. This applies to the string arguments of flags
+that follow tt(~) within the same set of parentheses. Compare with tt(~)
outside parentheses, which forces the entire substituted string to
be treated as a pattern. Hence, for example,
example([[ "?" = ${(~j.|.)array} ]])
-with the tt(EXTENDED_GLOB) option set succeeds if and only if tt($array)
-contains the string `tt(?)' as an element. The argument may be
+treats `tt(|)' as a pattern and succeeds if and only if tt($array)
+contains the string `tt(?)' as an element. The tt(~) may be
repeated to toggle the behaviour; its effect only lasts to the
end of the parenthesised group.
)
@@ -1155,6 +1156,10 @@ var(string1) and var(string2) are given, tt(string2) is inserted once
directly to the left of each word, truncated if necessary, before
var(string1) is used to produce any remaining padding.
+If either of var(string1) or tt(string2) is present but empty,
+i.e. there are two delimiters together at that point, the first
+character of tt($IFS) is used instead.
+
If the tt(MULTIBYTE) option is in effect, the flag tt(m) may also
be given, in which case widths will be used for the calculation of
padding; otherwise individual multibyte characters are treated as occupying
@@ -2658,6 +2663,12 @@ list of glob qualifiers.
A typical use for this is to prepend an option before all occurrences
of a file name; for example, the pattern `tt(*(P:-f:))' produces the
command line arguments `tt(-f) var(file1) tt(-f) var(file2) ...'
+
+If the modifier tt(^) is active, then var(string) will be appended
+instead of prepended. Prepending and appending is done independently
+so both can be used on the same glob expression; for example by writing
+`tt(*(P:foo:^P:bar:^P:baz:))' which produces the command line arguments
+`tt(foo) tt(baz) var(file1) tt(bar) ...'
)
enditem()
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 77f0098e3..4d04c2470 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -352,6 +352,15 @@ If the option tt(SH_GLOB) is set for compatibility with other shells, then
whitespace may appear between between the left and right parentheses when
there is a single var(word); otherwise, the parentheses will be treated as
forming a globbing pattern in that case.
+
+In any of the forms above, a redirection may appear outside the
+function body, for example
+
+example(func+LPAR()RPAR() { ... } 2>&1)
+
+The redirection is stored with the function and applied whenever the
+function is executed. Any variables in the redirection are expanded
+at the point the function is executed, but outside the function scope.
)
cindex(timing)
findex(time)
diff --git a/Doc/Zsh/mod_computil.yo b/Doc/Zsh/mod_computil.yo
index 593f85ad3..af537c9c0 100644
--- a/Doc/Zsh/mod_computil.yo
+++ b/Doc/Zsh/mod_computil.yo
@@ -33,12 +33,12 @@ arguments are like the definition arguments to tt(_describe) itself.
Once tt(compdescribe) has been called with either the tt(-i) or the
tt(-I) option, it can be repeatedly called with the tt(-g) option and
-the names of five arrays as its arguments. This will step through the
-different sets of matches and store the options in the first array,
-the strings with descriptions in the second, the matches for these in
-the third, the strings without descriptions in the fourth, and the
-matches for them in the fifth array. These are then directly given to
-tt(compadd) to register the matches with the completion code.
+the names of four parameters as its arguments. This will step through
+the different sets of matches and store the value of tt(compstate[list])
+in the first scalar, the options for tt(compadd) in the second array,
+the matches in the third array, and the strings to be displayed in the
+completion listing in the fourth array. The arrays may then be directly
+given to tt(compadd) to register the matches with the completion code.
)
findex(compfiles)
item(tt(compfiles))(
diff --git a/Doc/Zsh/mod_parameter.yo b/Doc/Zsh/mod_parameter.yo
index 32d4796f7..09ceba258 100644
--- a/Doc/Zsh/mod_parameter.yo
+++ b/Doc/Zsh/mod_parameter.yo
@@ -212,6 +212,14 @@ This array contains the names of the functions, sourced files,
and (if tt(EVAL_LINENO) is set) tt(eval) commands. currently being
executed. The first element is the name of the function using the
parameter.
+
+The standard shell array tt(zsh_eval_context) can be used to
+determine the type of shell construct being executed at each depth:
+note, however, that is in the opposite order, with the most recent
+item last, and it is more detailed, for example including an
+entry for tt(toplevel), the main shell code being executed
+either interactively or from a script, which is not present
+in tt($funcstack).
)
vindex(functrace)
item(tt(functrace))(
diff --git a/Doc/Zsh/mod_zutil.yo b/Doc/Zsh/mod_zutil.yo
index ee9ec3adf..7e8911113 100644
--- a/Doc/Zsh/mod_zutil.yo
+++ b/Doc/Zsh/mod_zutil.yo
@@ -265,7 +265,7 @@ string var(array) is interpreted as the name of another var(spec),
which is used to choose where to store the values. If no other var(spec)
is found, the values are stored as usual. This changes only the way the
values are stored, not the way tt($*) is parsed, so results may be
-unpredicable if the `var(name)tt(+)' specifier is used inconsistently.
+unpredictable if the `var(name)tt(+)' specifier is used inconsistently.
)
item(tt(-E))(
This changes the parsing rules to em(not) stop at the first string
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index ec1f1645a..068a253ac 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -1780,7 +1780,7 @@ cindex(tracing, of commands)
cindex(commands, tracing)
item(tt(XTRACE) (tt(-x), ksh: tt(-x)))(
Print commands and their arguments as they are executed. The
-output is proceded by the value of tt($PS4), formatted as described
+output is preceded by the value of tt($PS4), formatted as described
in
ifzman(the section EXPANSION OF PROMPT SEQUENCES in zmanref(zshmisc))\
ifnzman(noderef(Prompt Expansion)).
@@ -2079,7 +2079,7 @@ variables, or in arguments to external programs.
When this option is set, the tt($')var(...)tt(') expression is truncated at
the null character. Note that remaining parts of the same string
-beyond the termination of the quotes are not trunctated.
+beyond the termination of the quotes are not truncated.
For example, the command line argument tt(a$'b\0c'd) is treated with
the option off as the characters tt(a), tt(b), null, tt(c), tt(d),
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index dbac51182..3698829f3 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1042,7 +1042,7 @@ backquotes only. Should the chosen character be one of singlequote,
doublequote or backquote, there must also be an odd number of them
on the command line for the last one to be removed.
-For backward compabitility, if the tt(SUNKEYBOARDHACK) option is
+For backward compatibility, if the tt(SUNKEYBOARDHACK) option is
explicitly set, the value of tt(KEYBOARD_HACK) reverts to backquote.
If the option is explicitly unset, this variable is set to empty.
)
diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo
index 0ed52b580..17af5b0fb 100644
--- a/Doc/Zsh/prompt.yo
+++ b/Doc/Zsh/prompt.yo
@@ -108,6 +108,12 @@ the full path;
ifzman(see em(Dynamic) and em(Static named directories) in zmanref(zshexpn))\
ifnzman(noderef(Filename Expansion)).
)
+item(tt(%e))(
+Evaluation depth of the current sourced file, shell function, or tt(eval).
+This is incremented or decremented every time the value of tt(%N) is
+set or reverted to a previous value, respectively. This is most useful
+for debugging as part of tt($PS4).
+)
xitem(tt(%h))
item(tt(%!))(
Current history event number.
@@ -299,6 +305,7 @@ least var(n) elements relative to the root directory, hence tt(/) is
counted as 0 elements.)
sitem(tt(D))(True if the month is equal to var(n) (January = 0).)
sitem(tt(d))(True if the day of the month is equal to var(n).)
+sitem(tt(e))(True if the evaluation depth is at least var(n).)
sitem(tt(g))(True if the effective gid of the current process is var(n).)
sitem(tt(j))(True if the number of jobs is at least var(n).)
sitem(tt(L))(True if the tt(SHLVL) parameter is at least var(n).)
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 2a907c52c..98f38025a 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -2315,7 +2315,7 @@ These characters are described below.
)
cindex(completion removable suffix, highlighting)
cindex(suffix, highlighting removable, in completion)
-cindex(removable suffix, highlighting in completino)
+cindex(removable suffix, highlighting in completion)
item(tt(suffix))(
This context is used in completion for characters that are
marked as suffixes that will be removed if the completion ends