diff options
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/arith.yo | 10 | ||||
-rw-r--r-- | Doc/Zsh/builtins.yo | 85 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 26 | ||||
-rw-r--r-- | Doc/Zsh/contrib.yo | 8 | ||||
-rw-r--r-- | Doc/Zsh/expn.yo | 94 | ||||
-rw-r--r-- | Doc/Zsh/ftp_sites.yo | 21 | ||||
-rw-r--r-- | Doc/Zsh/grammar.yo | 54 | ||||
-rw-r--r-- | Doc/Zsh/options.yo | 16 | ||||
-rw-r--r-- | Doc/Zsh/params.yo | 10 |
9 files changed, 242 insertions, 82 deletions
diff --git a/Doc/Zsh/arith.yo b/Doc/Zsh/arith.yo index dd18ee720..2674c7817 100644 --- a/Doc/Zsh/arith.yo +++ b/Doc/Zsh/arith.yo @@ -48,6 +48,12 @@ The var(base)tt(#) may also be omitted, in which case base 10 is used. For backwards compatibility the form `tt([)var(base)tt(])var(n)' is also accepted. +An integer expression or a base given in the form +`var(base)tt(#)var(n)' may contain underscores (`tt(_)') after the +leading digit for visual guidance; these are ignored in computation. +Examples are tt(1_000_000) or tt(0xffff_ffff) which are equivalent to +tt(1000000) and tt(0xffffffff) respectively. + It is also possible to specify a base to be used for output in the form `tt([#)var(base)tt(])', for example `tt([#16])'. This is used when outputting arithmetical substitutions or when assigning to scalar @@ -87,7 +93,9 @@ output is valid syntax for input. If the tt(#) is doubled, for example Floating point constants are recognized by the presence of a decimal point or an exponent. The decimal point may be the first character of the constant, but the exponent character tt(e) or tt(E) may not, as it will be -taken for a parameter name. +taken for a parameter name. All numeric parts (before and after the +decimal point and in the exponent) may contain underscores after the +leading digit for visual guidance; these are ignored in computation. cindex(arithmetic operators) cindex(operators, arithmetic) diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 98c470a54..f3a7f6a97 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -108,7 +108,7 @@ ifnzman(noderef(Aliasing)). findex(autoload) cindex(functions, autoloading) cindex(autoloading functions) -item(tt(autoload) [ {tt(PLUS())|tt(-)}tt(UXktz) ] [ tt(-w) ] [ var(name) ... ])( +item(tt(autoload) [ {tt(PLUS())|tt(-)}tt(UXkmtz) ] [ tt(-w) ] [ var(name) ... ])( Equivalent to tt(functions -u), with the exception of tt(-X)/tt(+X) and tt(-w). @@ -129,15 +129,27 @@ undefined and marked for autoloading. If ksh-style autoloading is enabled, the function created will contain the contents of the file plus a call to the function itself appended to it, thus giving normal ksh autoloading behaviour on the first call to the function. +If the tt(-m) flag is also given each var(name) is treated as a +pattern and all functions already marked for autoload that match the +pattern are loaded. With the tt(-w) flag, the var(name)s are taken as names of files compiled with the tt(zcompile) builtin, and all functions defined in them are marked for autoloading. -The flags tt(-z) and tt(-k) mark the function to be autoloaded in -native or ksh emulation, as if the option tt(KSH_AUTOLOAD) were -unset or were set, respectively. The flags override the setting of -the option at the time the function is loaded. +The flags tt(-z) and tt(-k) mark the function to be autoloaded using the +zsh or ksh style, as if the option tt(KSH_AUTOLOAD) were unset or were +set, respectively. The flags override the setting of the option at the +time the function is loaded. + +Note that the tt(autoload) command makes no attempt to ensure the +shell options set during the loading or execution of the file have +any particular value. For this, the tt(emulate) command can be used: + +example(emulate zsh -c 'autoload -Uz var(func)') + +arranges that when var(func) is loaded the shell is in native tt(zsh) +emulation, and this emulation is also applied when var(func) is run. ) findex(bg) cindex(jobs, backgrounding) @@ -390,6 +402,7 @@ ifnzman(noderef(Invocation))\ ifzman(the section INVOCATION in zmanref(zsh)), except that `tt(-o EMACS)' and `tt(-o VI)' may not be used. Flags such as `tt(+r)'/`tt(+o RESTRICTED)' may be prohibited in some circumstances. + If tt(-c) var(arg) appears in var(flags), var(arg) is evaluated while the requested emulation is temporarily in effect. In this case the emulation mode and all options are restored to their previous values before @@ -406,7 +419,10 @@ If the function is called when the sticky emulation is already in effect, either within an `tt(emulate) var(shell) tt(-c)' expression or within another function with the same sticky emulation, entry and exit from the function do not cause options to be altered (except due to -standard processing such as the tt(LOCAL_OPTIONS) option). +standard processing such as the tt(LOCAL_OPTIONS) option). This also +applies to functions marked for autoload within the sticky emulation; +the appropriate set of options will be applied at the point the +function is loaded as well as when it is run. For example: @@ -446,6 +462,10 @@ sitem(4.)(The presence or absence of the tt(-R) switch to tt(emulate) corresponds to different sticky emulation modes, so for example `tt(emulate sh -c)', `tt(emulate -R sh -c)' and `tt(emulate csh -c)' are treated as three distinct sticky emulations.) +sitem(5.)(Difference in shell options supplied in addition to the +basic emulation also mean the sticky emulations are different, so for +example `tt(emulate zsh -c)' and `tt(emulate zsh -o cbases -c)' are +treated as distinct sticky emulations.) endsitem() ) findex(enable) @@ -620,7 +640,7 @@ 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(UXkmtuz) ] [ var(name) ... ]) +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))( @@ -1341,6 +1361,11 @@ or without the tt(no) prefix remains the same in this case. If the tt(-m) flag is given the arguments are taken as patterns (which should be quoted to protect them from filename expansion), and all options with names matching these patterns are set. + +Note that a bad option name does not cause execution of subsequent shell +code to be aborted; this is behaviour is different from that of `tt(set +-o)'. This is because tt(set) is regarded as a special builtin by the +POSIX standard, but tt(setopt) is not. ) findex(shift) cindex(parameters, positional) @@ -1552,7 +1577,10 @@ an array to var(SCALAR) is an error, and assigning a scalar to var(array) sets it to be a single-element array. Note that both `tt(typeset -xT ...)' and `tt(export -T ...)' work, but only the scalar will be marked for export. Setting the value using the scalar version causes a split on all -separators (which cannot be quoted). +separators (which cannot be quoted). It is possible to use the +same two tied variables with a different separator character in which +case the variables remain joined as before but the separator is changed. +This flag has a different meaning when used with tt(-f); see below. The tt(-g) (global) flag is treated specially: it means that any resulting parameter will not be restricted to local scope. Note that this @@ -1650,16 +1678,18 @@ shown. ) item(tt(-f))( The names refer to functions rather than parameters. No assignments -can be made, and the only other valid flags are tt(-t), tt(-k), tt(-u), -tt(-U) and tt(-z). The flag tt(-t) turns on execution tracing for this -function. The tt(-u) and tt(-U) flags cause the function to be -marked for autoloading; tt(-U) also causes alias expansion to be -suppressed when the function is loaded. The tt(fpath) parameter -will be searched to find the function definition when the 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 KSH_AUTOLOAD option -determines how the function is loaded. +can be made, and the only other valid flags are tt(-t), tt(-T), tt(-k), +tt(-u), tt(-U) and tt(-z). The flag tt(-t) turns on execution tracing +for this function; the flag tt(-T) does the same, but turns off tracing +on any function called from the present one, unless that function also +has the tt(-t) or tt(-T) flag. The tt(-u) and tt(-U) flags cause the +function to be marked for autoloading; tt(-U) also causes alias +expansion to be suppressed when the function is loaded. The tt(fpath) +parameter will be searched to find the function definition when the +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 +KSH_AUTOLOAD option determines how the function is loaded. ) item(tt(-h))( Hide: only useful for special parameters (those marked `<S>' in the table in @@ -1736,7 +1766,7 @@ enditem() findex(ulimit) cindex(resource limits) cindex(limits, resource) -item(tt(ulimit) [ [ tt(-SHacdfilmnpqstvx) | tt(-N) var(resource) [ var(limit) ] ... ])( +item(tt(ulimit) [ [ tt(-SHacdfilmnpqrstvx) | tt(-N) var(resource) [ var(limit) ] ... ])( Set or display resource limits of the shell and the processes started by the shell. The value of var(limit) can be a number in the unit specified below or one of the values `tt(unlimited)', which removes the limit on the @@ -1757,20 +1787,25 @@ When looping over multiple resources, the shell will abort immediately if it detects a badly formed argument. However, if it fails to set a limit for some other reason it will continue trying to set the remaining limits. +Not all the following resources are supported on all systems. Running +tt(ulimit -a) will show which are supported. + startsitem() sitem(tt(-a))(Lists all of the current resource limits.) +sitem(tt(-b))(Socket buffer size in bytes LPAR()N.B. not kilobytes+RPAR()) sitem(tt(-c))(512-byte blocks on the size of core dumps.) -sitem(tt(-d))(K-bytes on the size of the data segment.) +sitem(tt(-d))(Kilobytes on the size of the data segment.) sitem(tt(-f))(512-byte blocks on the size of files written.) sitem(tt(-i))(The number of pending signals.) -sitem(tt(-l))(K-bytes on the size of locked-in memory.) -sitem(tt(-m))(K-bytes on the size of physical memory.) +sitem(tt(-l))(Kilobytes on the size of locked-in memory.) +sitem(tt(-m))(Kilobytes on the size of physical memory.) sitem(tt(-n))(open file descriptors.) sitem(tt(-q))(Bytes in POSIX message queues.) -sitem(tt(-s))(K-bytes on the size of the stack.) +sitem(tt(-s))(Kilobytes on the size of the stack.) sitem(tt(-t))(CPU seconds to be used.) -sitem(tt(-u))(processes available to the user.) -sitem(tt(-v))(K-bytes on the size of virtual memory. On some systems this +sitem(tt(-r))(The number of simultaneous threads available to the user.) +sitem(tt(-u))(The number of processes available to the user.) +sitem(tt(-v))(Kilobytes on the size of virtual memory. On some systems this refers to the limit called `address space'.) sitem(tt(-x))(The number of locks on files.) endsitem() diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 135a60a41..2991c1f4a 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -2355,6 +2355,28 @@ found, or var(max) words have been tried. The default is to complete all words from the history at once. ) +kindex(recursive-files, completion style) +item(tt(recursive-files))( +If this style is set, its value is an array of patterns to be +tested against `tt($PWD/)': note the trailing slash, which allows +directories in the pattern to be delimited unambiguously by including +slashes on both sides. If an ordinary file completion fails +and the word on the command line does not yet have a directory part to its +name, the style is retrieved using the same tag as for the completion +just attempted, then the elements tested against tt($PWD/) in turn. +If one matches, then the shell reattempts completion by prepending the word +on the command line with each directory in the expansion of tt(**/*(/)) +in turn. Typically the elements of the style will be set to restrict +the number of directories beneath the current one to a manageable +number, for example `tt(*/.git/*)'. + +For example, + +example(zstyle ':completion:*' recursive-files '*/zsh/*') + +If the current directory is tt(/home/pws/zsh/Src), then +tt(zle_tr)em(TAB) can be completed to tt(Zle/zle_tricky.c). +) kindex(regular, completion style) item(tt(regular))( This style is used by the tt(_expand_alias) completer and bindable @@ -3158,7 +3180,9 @@ var(_func) is the name of a shell function whose name must begin with tt(_) but is not otherwise special to the completion system. The function is called with the trial word as an argument. If the word is to be expanded, the function should set the array tt(reply) to a list of -expansions. The return status of the function is irrelevant. +expansions. Optionally, it can set tt(REPLY) to a word that will +be used as a description for the set of expansions. +The return status of the function is irrelevant. ) endsitem() ) diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 139a68150..8dbc095fd 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -768,7 +768,10 @@ item(tt(hgrevformat))( tt(hg) uses both a hash and a revision number to reference a specific changeset in a repository. With this style you can format the revision string (see tt(branchformat)) to include either or both. It's only -useful when tt(get-revision) is true. +useful when tt(get-revision) is true. Note, the full 40-character revision id +is not available (except when using the tt(use-simple) option) because +executing hg more than once per prompt is too slow; you may customize this +behavior using hooks. ) kindex(max-exports) item(tt(max-exports))( @@ -993,7 +996,7 @@ In tt(hgrevformat) these replacements are done: startsitem() sitem(tt(%r))(The current local revision number.) -sitem(tt(%h))(The current 40-character changeset ID hash identifier.) +sitem(tt(%h))(The current global revision identifier.) endsitem() In tt(patch-format) and tt(nopatch-format) these replacements are done: @@ -1003,6 +1006,7 @@ sitem(tt(%p))(The name of the top-most applied patch (tt(applied-string)).) sitem(tt(%u))(The number of unapplied patches (tt(unapplied-string)).) sitem(tt(%n))(The number of applied patches.) sitem(tt(%c))(The number of unapplied patches.) +sitem(tt(%a))(The number of all patches.) sitem(tt(%g))(The names of active tt(mq) guards (tt(hg) backend).) sitem(tt(%G))(The number of active tt(mq) guards (tt(hg) backend).) endsitem() diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 8afd92532..da68b4ff7 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -483,6 +483,24 @@ example(LPAR()mycmd =(myoutput)RPAR() &!) as the forked subshell will wait for the command to finish then remove the temporary file. +A general workaround to ensure a process substitution endures for +an appropriate length of time is to pass it as a parameter to +an anonymous shell function (a piece of shell code that is run +immediately with function scope). For example, this code: + +example(LPAR()RPAR() { + print File $1: + cat $1 +} =+LPAR()print This be the verse+RPAR()) + +outputs something resembling the following + +example(File /tmp/zsh6nU0kS: +This be the verse) + +The temporary file created by the process substitution will be deleted +when the function exits. + texinode(Parameter Expansion)(Command Substitution)(Process Substitution)(Expansion) sect(Parameter Expansion) cindex(parameter expansion) @@ -1051,12 +1069,13 @@ item(tt(z))( Split the result of the expansion into words using shell parsing to find the words, i.e. taking into account any quoting in the value. Comments are not treated specially but as ordinary strings, similar -to interactive shells with the tt(INTERACTIVE_COMMENTS) option unset. +to interactive shells with the tt(INTERACTIVE_COMMENTS) option unset +(however, see the tt(Z) flag below for related options) -Note that this is done very late, as for the `tt((s))' flag. So to -access single words in the result, one has to use nested expansions as +Note that this is done very late, even later than the `tt((s))' flag. So to +access single words in the result use nested expansions as in `tt(${${(z)foo}[2]})'. Likewise, to remove the quotes in the -resulting words one would do: `tt(${(Q)${(z)foo}})'. +resulting words use `tt(${(Q)${(z)foo}})'. ) item(tt(0))( Split the result of the expansion on null bytes. This is a shorthand @@ -1165,7 +1184,8 @@ i.e. tt("${(@s.:.)line}"). ) item(tt(Z:)var(opts)tt(:))( As tt(z) but takes a combination of option letters between a following -pair of delimiter characters. tt(LPAR()Z+PLUS()c+PLUS()RPAR()) +pair of delimiter characters. With no options the effect is identical +to tt(z). tt(LPAR()Z+PLUS()c+PLUS()RPAR()) causes comments to be parsed as a string and retained; any field in the resulting array beginning with an unquoted comment character is a comment. tt(LPAR()Z+PLUS()C+PLUS()RPAR()) causes comments to be parsed @@ -1174,7 +1194,8 @@ starting with the third character of tt($HISTCHARS), default tt(#), up to the next newline is a comment. tt(LPAR()Z+PLUS()n+PLUS()RPAR()) causes unquoted newlines to be treated as ordinary whitespace, else they are treated as if they are shell code delimiters and converted to -semicolons. +semicolons. Options are combined within the same set of delimiters, +e.g. tt(LPAR()Z+PLUS()Cn+PLUS()RPAR()). ) item(tt(_:)var(flags)tt(:))( The underscore (tt(_)) flag is reserved for future use. As of this @@ -1248,7 +1269,7 @@ em(no responsibility) for any brain damage which may occur during the reading of the following rules. startitem() -item(tt(1.) em(Nested Substitution))( +item(tt(1.) em(Nested substitution))( If multiple nested tt(${...}) forms are present, substitution is performed from the inside outwards. At each level, the substitution takes account of whether the current value is a scalar or an array, whether the @@ -1272,12 +1293,14 @@ which is expanded by filename expansion to a full path; the outer substitution then applies the modifier tt(:h) and takes the directory part of the path.) ) -item(tt(2.) em(Internal Parameter Flags))( +item(tt(2.) em(Internal parameter flags))( Any parameter flags set by one of the tt(typeset) family of commands, in particular the tt(L), tt(R), tt(Z), tt(u) and tt(l) flags for padding and capitalization, are applied directly to the parameter value. +Note these flags are options to the command, e.g. `tt(typeset -Z)'; +they are not the same as the flags used within parameter substitutions. ) -item(tt(3.) em(Parameter Subscripting))( +item(tt(3.) em(Parameter subscripting))( If the value is a raw parameter reference with a subscript, such as tt(${)var(var)tt([3]}), the effect of subscripting is applied directly to the parameter. Subscripts are evaluated left to right; subsequent @@ -1287,11 +1310,11 @@ character of the first word, but tt(${var[2,4][2]}) is the entire third word (the second word of the range of words two through four of the original array). Any number of subscripts may appear. ) -item(tt(4.) em(Parameter Name Replacement))( +item(tt(4.) em(Parameter name replacement))( The effect of any tt((P)) flag, which treats the value so far as a parameter name and replaces it with the corresponding value, is applied. ) -item(tt(5.) em(Double-Quoted Joining))( +item(tt(5.) em(Double-quoted joining))( If the value after this process is an array, and the substitution appears in double quotes, and no tt((@)) flag is present at the current level, the words of the value are joined with the first character of the @@ -1299,7 +1322,7 @@ parameter tt($IFS), by default a space, between each word (single word arrays are not modified). If the tt((j)) flag is present, that is used for joining instead of tt($IFS). ) -item(tt(6.) em(Nested Subscripting))( +item(tt(6.) em(Nested subscripting))( Any remaining subscripts (i.e. of a nested substitution) are evaluated at this point, based on whether the value is an array or a scalar. As with tt(3.), multiple subscripts can appear. Note that tt(${foo[2,4][2]}) is @@ -1322,44 +1345,51 @@ item(tt(9.) em(Length))( Any initial tt(#) modifier, i.e. in the form tt(${#)var(var)tt(}), is used to evaluate the length of the expression so far. ) -item(tt(10.) em(Forced Joining))( +item(tt(10.) em(Forced joining))( If the `tt((j))' flag is present, or no `tt((j))' flag is present but -the string is to be split as given by rules tt(16.) or tt(17.), and joining +the string is to be split as given by rule tt(11.), and joining did not take place at step tt(5.), any words in the value are joined together using the given string or the first character of tt($IFS) if none. Note that the `tt((F))' flag implicitly supplies a string for joining in this manner. ) -item(tt(11.) em(Case modification))( +item(tt(11.) em(Simple word splitting))( +If one of the `tt((s))' or `tt((f))' flags are present, or the `tt(=)' +specifier was present (e.g. tt(${=)var(var)tt(})), the word is split on +occurrences of the specified string, or (for tt(=) with neither of the two +flags present) any of the characters in tt($IFS). + +If no `tt((s))', `tt((f))' or `tt(=)' was given, but the word is not +quoted and the option tt(SH_WORD_SPLIT) is set, the word is split on +occurrences of any of the characters in tt($IFS). Note this step, too, +takes place at all levels of a nested substitution. +) +item(tt(12.) em(Case modification))( Any case modification from one of the flags tt((L)), tt((U)) or tt((C)) is applied. ) -item(tt(12.) em(Escape sequence replacement))( +item(tt(13.) em(Escape sequence replacement))( First any replacements from the tt((g)) flag are performed, then any prompt-style formatting from the tt((%)) family of flags is applied. ) -item(tt(13.) em(Quote application))( +item(tt(14.) em(Quote application))( Any quoting or unquoting using tt((q)) and tt((Q)) and related flags is applied. ) -item(tt(14.) em(Directory naming))( +item(tt(15.) em(Directory naming))( Any directory name substitution using tt((D)) flag is applied. ) -item(tt(15.) em(Visibility enhancment))( +item(tt(16.) em(Visibility enhancement))( Any modifications to make characters visible using the tt((V)) flag are applied. ) -item(tt(16.) em(Forced Splitting))( -If one of the `tt((s))', `tt((f))' or `tt((z))' flags are present, or the `tt(=)' -specifier was present (e.g. tt(${=)var(var)tt(})), the word is split on -occurrences of the specified string, or (for tt(=) with neither of the two -flags present) any of the characters in tt($IFS). -) -item(tt(17.) em(Shell Word Splitting))( -If no `tt((s))', `tt((f))' or `tt(=)' was given, but the word is not -quoted and the option tt(SH_WORD_SPLIT) is set, the word is split on -occurrences of any of the characters in tt($IFS). Note this step, too, -takes place at all levels of a nested substitution. +item(tt(17.) em(Lexical word splitting))( +If the 'tt((z))' flag or one of the forms of the 'tt((Z))' flag is +present, the word is split as if it were a shell command line, so that +quotation marks and other metacharacters are used to decide what +constitutes a word. Note this form of splitting is entirely distinct +from that described by rule tt(11.): it does not use tt($IFS), and +does not cause forced joining. ) item(tt(18.) em(Uniqueness))( If the result is an array and the `tt((u))' flag was present, duplicate @@ -1369,7 +1399,7 @@ item(tt(19.) em(Ordering))( If the result is still an array and one of the `tt((o))' or `tt((O))' flags was present, the array is reordered. ) -item(tt(20.) em(Re-Evaluation))( +item(tt(20.) em(Re-evaluation))( Any `tt((e))' flag is applied to the value, forcing it to be re-examined for new parameter substitutions, but also for command and arithmetic substitutions. @@ -1378,7 +1408,7 @@ item(tt(21.) em(Padding))( Any padding of the value by the `tt(LPAR()l.)var(fill)tt(.RPAR())' or `tt(LPAR()r.)var(fill)tt(.RPAR())' flags is applied. ) -item(tt(22.) em(Semantic Joining))( +item(tt(22.) em(Semantic joining))( In contexts where expansion semantics requires a single word to result, all words are rejoined with the first character of tt(IFS) between. So in `tt(${LPAR()P)tt(RPAR()${LPAR()f)tt(RPAR()lines}})' diff --git a/Doc/Zsh/ftp_sites.yo b/Doc/Zsh/ftp_sites.yo index 3ed675ab1..62c1bff06 100644 --- a/Doc/Zsh/ftp_sites.yo +++ b/Doc/Zsh/ftp_sites.yo @@ -5,24 +5,11 @@ tt(http://www.zsh.org/pub/)) ) item(Australia)( nofill(tt(ftp://ftp.zsh.org/pub/) -tt(http://www.zsh.org/pub/)) -) -item(Denmark)( -nofill(tt(ftp://mirrors.dotsrc.org/zsh/)) -) -item(Finland)( -nofill(tt(ftp://ftp.funet.fi/pub/unix/shells/zsh/)) -) -item(France)( -nofill(tt(ftp://nephtys.lip6.fr/pub/unix/shells/zsh/)) -) -item(Germany)( -nofill(tt(ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/)) +tt(http://www.zsh.org/pub/) +tt(http://mirror.dejanseo.com.au/pub/zsh/)) ) item(Hungary)( -nofill(tt(ftp://ftp.kfki.hu/pub/packages/zsh/)) -) -item(Poland)( -nofill(tt(ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/)) +nofill(tt(ftp://ftp.cs.elte.hu/pub/zsh/) +tt(http://www.cs.elte.hu/pub/zsh/)) ) enditem() diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo index 1eb358ea3..b452e4cc9 100644 --- a/Doc/Zsh/grammar.yo +++ b/Doc/Zsh/grammar.yo @@ -8,6 +8,7 @@ menu(Precommand Modifiers) menu(Complex Commands) menu(Alternate Forms For Complex Commands) menu(Reserved Words) +menu(Errors) menu(Comments) menu(Aliasing) menu(Quoting) @@ -438,7 +439,7 @@ where var(term) is at least one newline or tt(;). A short form of tt(select). ) enditem() -texinode(Reserved Words)(Comments)(Alternate Forms For Complex Commands)(Shell Grammar) +texinode(Reserved Words)(Errors)(Alternate Forms For Complex Commands)(Shell Grammar) sect(Reserved Words) cindex(reserved words) findex(disable, use of) @@ -451,7 +452,56 @@ select coproc nocorrect foreach end ! [[ { }) 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) +texinode(Errors)(Comments)(Reserved Words)(Shell Grammar) +sect(Errors) +cindex(errors, handling of) +Certain errors are treated as fatal by the shell: in an interactive +shell, they cause control to return to the command line, and in a +non-interactive shell they cause the shell to be aborted. In older +versions of zsh, a non-interactive shell running a script would not +abort completely, but would resume execution at the next command to be +read from the script, skipping the remainder of any functions or +shell constructs such as loops or conditions; this somewhat illogical +behaviour can be recovered by setting the option tt(CONTINUE_ON_ERROR). + +Fatal errors found in non-interactive shells include: +startlist() +list(Failure to parse shell options passed when invoking the shell) +list(Failure to change options with the tt(set) builtin) +list(Parse errors of all sorts, including failures to parse +mathematical expressions) +list(Failures to set or modify variable behaviour with tt(typeset), +tt(local), tt(declare), tt(export), tt(integer), tt(float)) +list(Execution of incorrectly positioned loop control structures +(tt(continue), tt(break))) +list(Attempts to use regular expression with no regular expression +module available) +list(Disallowed operations when the tt(RESTRICTED) options is set) +list(Failure to create a pipe needed for a pipeline) +list(Failure to create a multio) +list(Failure to autoload a module needed for a declared shell feature) +list(Errors creating command or process substitutions) +list(Syntax errors in glob qualifiers) +list(File generation errors where not caught by the option tt(BAD_PATTERN)) +list(All bad patterns used for matching within case statements) +list(File generation failures where not caused by tt(NO_MATCH) or +list(All file generation errors where the pattern was used to create a +multio) +list(Memory errors where detected by the shell) +list(Invalid subscripts to shell variables) +list(Attempts to assign read-only variables) +list(Logical errors with variables such as assignment to the wrong type) +list(Use of invalid variable names) +list(Errors in variable substitution syntax) +list(Failure to convert characters in tt($')...tt(') expressions) +similar options) +endlist() + +If the tt(POSIX_BUILTINS) option is set, more errors associated with +shell builtin commands are treated as fatal, as specified by the POSIX +standard. + +texinode(Comments)(Aliasing)(Errors)(Shell Grammar) sect(Comments) cindex(comments) pindex(INTERACTIVE_COMMENTS, use of) diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 3114ecc05..6c8d423cb 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1733,6 +1733,22 @@ Make the tt(echo) builtin compatible with the BSD manref(echo)(1) command. This disables backslashed escape sequences in echo strings unless the tt(-e) option is specified. ) +pindex(CONTINUE_ON_ERROR) +pindex(NO_CONTINUE_ON_ERROR) +pindex(CONTINUEONERROR) +pindex(NOCONTINUEONERROR) +cindex(error, option to continue script on) +item(tt(CONTINUE_ON_ERROR))( +If a fatal error is encountered (see +ifnzman(noderef(Errors))\ +ifzman(the section ERRORS in zmanref(zshmisc))), and the code is running +in a script, the shell will resume execution at the next statement +in the script at the top level, in other words outside all functions +or shell constructs such as loops and conditions. This mimics the +behaviour of interactive shells, where the shell returns to the +line editor to read a new command; it was the normal behaviour in versions +of zsh before 5.0.1. +) pindex(CSH_JUNKIE_HISTORY) pindex(NO_CSH_JUNKIE_HISTORY) pindex(CSHJUNKIEHISTORY) diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index 5991921f8..b7b7750ff 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -182,7 +182,10 @@ to the matching closing one is considered to be a list of flags, as in The flags tt(s), tt(n) and tt(b) take an argument; the delimiter is shown below as `tt(:)', but any character, or the matching pairs `tt(LPAR())...tt(RPAR())', `tt({)...tt(})', `tt([)...tt(])', or -`tt(<)...tt(>)', may be used. +`tt(<)...tt(>)', may be used, but note that `tt(<)...tt(>)' can only be +used if the subscript is inside a double quoted expression or a +parameter substitution enclosed in braces as otherwise the expression is +interpreted as a redirection. The flags currently understood are: @@ -1225,7 +1228,10 @@ vindex(REPORTTIME) item(tt(REPORTTIME))( If nonnegative, commands whose combined user and system execution times (measured in seconds) are greater than this value have timing -statistics printed for them. +statistics printed for them. Output is suppressed for commands +executed within the line editor, including completion; commands +explicitly marked with the tt(time) keyword still cause the summary +to be printed in this case. ) vindex(REPLY) item(tt(REPLY))( |