diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/Makefile.in | 2 | ||||
-rw-r--r-- | Doc/Zsh/builtins.yo | 11 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 14 | ||||
-rw-r--r-- | Doc/Zsh/compwid.yo | 5 | ||||
-rw-r--r-- | Doc/Zsh/cond.yo | 2 | ||||
-rw-r--r-- | Doc/Zsh/contrib.yo | 295 | ||||
-rw-r--r-- | Doc/Zsh/expn.yo | 48 | ||||
-rw-r--r-- | Doc/Zsh/func.yo | 23 | ||||
-rw-r--r-- | Doc/Zsh/mod_datetime.yo | 25 | ||||
-rw-r--r-- | Doc/Zsh/mod_zutil.yo | 3 | ||||
-rw-r--r-- | Doc/Zsh/modules.yo | 8 | ||||
-rw-r--r-- | Doc/Zsh/params.yo | 6 | ||||
-rw-r--r-- | Doc/Zsh/redirect.yo | 57 | ||||
-rw-r--r-- | Doc/Zsh/zle.yo | 15 |
14 files changed, 313 insertions, 201 deletions
diff --git a/Doc/Makefile.in b/Doc/Makefile.in index f7f5915c1..d30149da0 100644 --- a/Doc/Makefile.in +++ b/Doc/Makefile.in @@ -59,7 +59,7 @@ Zsh/mod_attr.yo Zsh/mod_cap.yo Zsh/mod_clone.yo \ Zsh/mod_compctl.yo Zsh/mod_complete.yo Zsh/mod_complist.yo \ Zsh/mod_computil.yo Zsh/mod_curses.yo \ Zsh/mod_datetime.yo Zsh/mod_deltochar.yo \ -Zsh/mod_example.yo Zsh/mod_files.yo \ +Zsh/mod_example.yo Zsh/mod_files.yo Zsh/mod_langinfo.yo \ Zsh/mod_mapfile.yo Zsh/mod_mathfunc.yo Zsh/mod_newuser.yo \ Zsh/mod_parameter.yo Zsh/mod_pcre.yo Zsh/mod_regex.yo \ Zsh/mod_sched.yo Zsh/mod_socket.yo \ diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 7170b13b9..5d717479a 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -914,7 +914,7 @@ and the new directory stack is not printed. This is useful for calls to tt(popd) that do not change the environment seen by an interactive user. ) findex(print) -xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ]) +xitem(tt(print) [ tt(-abcDilmnNoOpPrsSz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ]) item( [ 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 @@ -994,6 +994,15 @@ tt(-R); all other arguments and options are printed. ) item(tt(-s))( Place the results in the history list instead of on the standard output. +Each argument to the tt(print) command is treated as a single word in the +history, regardless of its content. +) +item(tt(-S))( +Place the results in the history list instead of on the standard output. +In this case only a single argument is allowed; it will be split into +words as if it were a full shell command line. The effect is +similar to reading the line from a history file with the +tt(HIST_LEX_WORDS) option active. ) item(tt(-u) var(n))( Print the arguments to file descriptor var(n). diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index ad2562a26..e07ac0e9e 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1085,7 +1085,7 @@ Some of these styles are tested first for every possible tag corresponding to a type of match, and if no style was found, for the tt(default) tag. The most notable styles of this type are tt(menu), tt(list-colors) and styles controlling completion listing such as -tt(list-packed) and tt(last-prompt)). When tested for the tt(default) +tt(list-packed) and tt(last-prompt). When tested for the tt(default) tag, only the var(function) field of the context will be set so that a style using the default tag will normally be defined along the lines of: @@ -1684,8 +1684,8 @@ will be considered as possible completions. If it is set to `tt(current)', the word the cursor is on will not be considered as a possible completion. The value `tt(current-shown)' is similar but only applies if the list of completions is currently shown on the screen. -Finally, if the style is set to `tt(other)', no word apart from the -current one will be considered as a possible completion. +Finally, if the style is set to `tt(other)', all words on the line except +for the current one will be excluded from the possible completions. The values `tt(current)' and `tt(current-shown)' are a bit like the opposite of the tt(accept-exact) style: only strings with @@ -4387,7 +4387,9 @@ tt(ambiguous), tt(special-dirs), tt(list-suffixes) and tt(file-sort) described above. ) findex(_pick_variant) -item(tt(_pick_variant [ tt(-c) var(command) ] [ tt(-r) var(name) ] var(label)tt(=)var(pattern) ... var(label) [ var(args) ... ]))( +xitem(tt(_pick_variant) [ tt(-b) var(builtin-label) ] [ tt(-c) +var(command) ] [ tt(-r) var(name) ]) +item( var(label)tt(=)var(pattern) ... var(label) [ var(args) ... ])( This function is used to resolve situations where a single command name requires more than one type of handling, either because it has more than one variant or because there is a name clash between two @@ -4403,6 +4405,10 @@ tt(...)' contains var(pattern), then tt(label) is selected as the label for the command variant. If none of the patterns match, the final command label is selected and status 1 is returned. +If the `tt(-b) var(builtin-label)' is given, the command is tested to +see if it is provided as a shell builtin, possibly autoloaded; if so, +the label var(builtin-label) is selected as the label for the variant. + If the `tt(-r) var(name)' is given, the var(label) picked is stored in the parameter named var(name). diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index 3042fa373..37a568f58 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -162,7 +162,10 @@ this case the tt(words) array contains the words inside the parentheses. ) item(tt(brace_parameter))( when completing the name of a parameter in a parameter expansion beginning -with tt(${). +with tt(${). This context will also be set when completing parameter +flags following tt(${LPAR()); the full command line argument is presented +and the handler must test the value to be completed to ascertain that +this is the case. ) item(tt(assign_parameter))( when completing the name of a parameter in a parameter assignment. diff --git a/Doc/Zsh/cond.yo b/Doc/Zsh/cond.yo index 489ee356b..71971b4b3 100644 --- a/Doc/Zsh/cond.yo +++ b/Doc/Zsh/cond.yo @@ -184,7 +184,7 @@ enditem() Normal shell expansion is performed on the var(file), var(string) and var(pattern) arguments, but the result of each expansion is constrained to be a single word, similar to the effect of double quotes. -File generation is not performed on any form of argument to conditions. +Filename generation is not performed on any form of argument to conditions. However, pattern metacharacters are active for the var(pattern) arguments; the patterns are the same as those used for filename generation, see ifzman(\ diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index cf42e28a9..aee0bd7f4 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -614,7 +614,7 @@ There is also support for the patch management system tt(quilt) (http://savannah.nongnu.org/projects/quilt). See tt(Quilt Support) below for details. -To load var(vcs_info): +To load tt(vcs_info): example(autoload -Uz vcs_info) @@ -624,21 +624,21 @@ tt($psvar) entries to be left available. subsect(Quickstart) To get this feature working quickly (including colors), you can do the -following (assuming, you loaded var(vcs_info) properly - see above): +following (assuming, you loaded tt(vcs_info) properly - see above): -example(zstyle ':vcs_info:*' actionformats \ +example(zstyle ':vcs_info:*' actionformats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ +zstyle ':vcs_info:*' formats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' precmd () { vcs_info } PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# ') Obviously, the last two lines are there for demonstration. You need to -call var(vcs_info) from your var(precmd) function. Once that is done you need -a tt(single quoted) var('${vcs_info_msg_0_}') in your prompt. +call tt(vcs_info) from your tt(precmd) function. Once that is done you need +a tt(single quoted) tt('${vcs_info_msg_0_}') in your prompt. -To be able to use var('${vcs_info_msg_0_}') directly in your prompt like +To be able to use tt('${vcs_info_msg_0_}') directly in your prompt like this, you will need to have the tt(PROMPT_SUBST) option enabled. Now call the tt(vcs_info_printsys) utility from the command line: @@ -678,54 +678,55 @@ You may also pick a few from that list and enable only those: example(zstyle ':vcs_info:*' enable git cvs svn) If you rerun tt(vcs_info_printsys) after one of these commands, you will -see the backends listed in the var(disable) style (or backends not in the -var(enable) style - if you used that) marked as disabled by a hash sign. -That means the detection of these systems is skipped tt(completely). No +see the backends listed in the tt(disable) style (or backends not in the +tt(enable) style - if you used that) marked as disabled by a hash sign. +That means the detection of these systems is skipped em(completely). No wasted time there. subsect(Configuration) -The var(vcs_info) feature can be configured via var(zstyle). +The tt(vcs_info) feature can be configured via tt(zstyle). First, the context in which we are working: -example(:vcs_info:<vcs-string>:<user-context>:<repo-root-name>) +example(:vcs_info:var(vcs-string):var(user-context):var(repo-root-name)) startitem() -item(tt(<vcs-string>))( -is one of: git, git-svn, git-p4, hg, hg-git, hg-hgsubversion, hg-hgsvn, -darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil. When hooks are -active the hooks name is added after a `+'. (See tt(Hooks in vcs_info) +item(var(vcs-string))( +is one of: bf(git), bf(git-svn), bf(git-p4), bf(hg), bf(hg-git), +bf(hg-hgsubversion), bf(hg-hgsvn), bf(darcs), bf(bzr), bf(cdv), bf(mtn), +bf(svn), bf(cvs), bf(svk), bf(tla), bf(p4) or bf(fossil). When hooks are +active the hooks name is added after a `+'. (See bf(Hooks in vcs_info) below.) ) -item(tt(<user-context>))( +item(var(user-context))( is a freely configurable string, assignable by -the user as the first argument to var(vcs_info) (see its description +the user as the first argument to tt(vcs_info) (see its description below). ) -item(tt(<repo-root-name>))( +item(var(repo-root-name))( is the name of a repository in which you want a -style to match. So, if you want a setting specific to var(/usr/src/zsh), -with that being a CVS checkout, you can set tt(<repo-root-name>) to -var(zsh) to make it so. +style to match. So, if you want a setting specific to tt(/usr/src/zsh), +with that being a CVS checkout, you can set var(repo-root-name) to +tt(zsh) to make it so. ) enditem() -There are three special values for tt(<vcs-string>): The first is named -var(-init-), that is in effect as long as there was no decision what VCS -backend to use. The second is var(-preinit-); it is used tt(before) -var(vcs_info) is run, when initializing the data exporting variables. The -third special value is var(formats) and is used by the tt(vcs_info_lastmsg) +There are three special values for var(vcs-string): The first is named +tt(-init-), that is in effect as long as there was no decision what VCS +backend to use. The second is tt(-preinit-); it is used em(before) +tt(vcs_info) is run, when initializing the data exporting variables. The +third special value is tt(formats) and is used by the tt(vcs_info_lastmsg) for looking up its styles. -The initial value of tt(<repo-root-name>) is var(-all-) and it is replaced +The initial value of var(repo-root-name) is tt(-all-) and it is replaced with the actual name, as soon as it is known. Only use this part of the -context for defining the var(formats), var(actionformats) or -var(branchformat) styles, as it is guaranteed that tt(<repo-root-name>) is +context for defining the tt(formats), tt(actionformats) or +tt(branchformat) styles, as it is guaranteed that var(repo-root-name) is set up correctly for these only. For all other styles, just use tt('*') instead. -There are two pre-defined values for tt(<user-context>): +There are two pre-defined values for var(user-context): startsitem() sitem(tt(default))(the one used if none is specified) sitem(tt(command))(used by vcs_info_lastmsg to lookup its styles) @@ -750,15 +751,15 @@ a merge conflict. ) kindex(branchformat) item(tt(branchformat))( -Some backends replace var(%b) in the formats and +Some backends replace tt(%b) in the formats and actionformats styles above, not only by a branch name but also by a 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 -for the current directory or var(vcs_info) was disabled. This is useful if -you want var(vcs_info) to completely take over the generation of your +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 accomplish that. ) @@ -766,36 +767,36 @@ kindex(hgrevformat) 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 var(branchformat)) to include either or both. It's only -useful when var(get-revision) is true. +string (see tt(branchformat)) to include either or both. It's only +useful when tt(get-revision) is true. ) kindex(max-exports) item(tt(max-exports))( Defines the maximum number of -var(vcs_info_msg_*_) variables var(vcs_info) will export. +tt(vcs_info_msg_*_) variables tt(vcs_info) will export. ) kindex(enable) item(tt(enable))( -A list of backends you want to use. Checked in the var(-init-) context. If +A list of backends you want to use. Checked in the tt(-init-) context. If this list contains an item called tt(NONE) no backend is used at all and -var(vcs_info) will do nothing. If this list contains tt(ALL) var(vcs_info) +tt(vcs_info) will do nothing. If this list contains tt(ALL), tt(vcs_info) will use all known backends. Only with tt(ALL) in tt(enable) will the tt(disable) style have any effect. tt(ALL) and tt(NONE) are case insensitive. ) kindex(disable) item(tt(disable))( -A list of VCSs you don't want var(vcs_info) to test for -repositories (checked in the var(-init-) context, too). Only used if +A list of VCSs you don't want tt(vcs_info) to test for +repositories (checked in the tt(-init-) context, too). Only used if tt(enable) contains tt(ALL). ) kindex(disable-patterns) item(tt(disable-patterns))( A list of patterns that are checked against tt($PWD). If a pattern -matches, var(vcs_info) will be disabled. This style is checked in the -var(:vcs_info:-init-:*:-all-) context. +matches, tt(vcs_info) will be disabled. This style is checked in the +tt(:vcs_info:-init-:*:-all-) context. Say, tt(~/.zsh) is a directory under version control, in which you do -not want var(vcs_info) to be active, do: +not want tt(vcs_info) to be active, do: example(zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+LPAR()|/*+RPAR()") ) kindex(use-quilt) @@ -810,7 +811,7 @@ in a given directory. See tt(Quilt Support) for details. ) kindex(quilt-patch-dir) item(tt(quilt-patch-dir))( -Overwrite the value of the var($QUILT_PATCHES) environment variable. See +Overwrite the value of the tt($QUILT_PATCHES) environment variable. See tt(Quilt Support) for details. ) kindex(quiltcommand) @@ -822,12 +823,12 @@ kindex(check-for-changes) item(tt(check-for-changes))( If enabled, this style causes the tt(%c) and tt(%u) format escapes to show when the working directory has uncommitted changes. The strings displayed by -these escapes can be controlled via the var(stagedstr) and var(unstagedstr) +these escapes can be controlled via the tt(stagedstr) and tt(unstagedstr) styles. The only backends that currently support this option are tt(git) and tt(hg) (tt(hg) only supports unstaged). -For this style to be evaluated with the tt(hg) backend, the var(get-revision) -style needs to be set and the var(use-simple) style needs to be unset. The +For this style to be evaluated with the tt(hg) backend, the tt(get-revision) +style needs to be set and the tt(use-simple) style needs to be unset. The latter is the default; the former is not. Note, the actions taken if this style is enabled are potentially expensive @@ -846,19 +847,19 @@ in the repository. ) kindex(command) item(tt(command))( -This style causes var(vcs_info) to use the supplied string as the command +This style causes tt(vcs_info) to use the supplied string as the command to use as the VCS's binary. Note, that setting this in ':vcs_info:*' is not a good idea. If the value of this style is empty (which is the default), the used binary -name is the name of the backend in use (e.g. var(svn) is used in an var(svn) +name is the name of the backend in use (e.g. tt(svn) is used in an tt(svn) repository). -The var(repo-root-name) part in the context is always the default tt(-all-) +The tt(repo-root-name) part in the context is always the default tt(-all-) when this style is looked up. For example, this style can be used to use binaries from non-default -installation directories. Assume, var(git) is installed in /usr/bin but +installation directories. Assume, tt(git) is installed in /usr/bin but your sysadmin installed a newer version in /usr/bin/local. Instead of changing the order of your tt($PATH) parameter, you can do this: example(zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git) @@ -869,7 +870,7 @@ This is used by the Perforce backend (tt(p4)) to decide if it should contact the Perforce server to find out if a directory is managed by Perforce. This is the only reliable way of doing this, but runs the risk of a delay if the server name cannot be found. If the -server (more specifically, the var(host)tt(:)var(port) pair describing the +server (more specifically, the tt(host)tt(:)tt(port) pair describing the server) cannot be contacted, its name is put into the associative array tt(vcs_info_p4_dead_servers) and is not contacted again during the session until it is removed by hand. If you do not set this style, the tt(p4) @@ -910,17 +911,17 @@ bookmarks. They will be available via the `tt(%m)' replacement. kindex(use-prompt-escapes) item(tt(use-prompt-escapes))( Determines if we assume that the assembled -string from var(vcs_info) includes prompt escapes. (Used by +string from tt(vcs_info) includes prompt escapes. (Used by tt(vcs_info_lastmsg).) ) kindex(debug) item(tt(debug))( Enable debugging output to track possible problems. Currently this style -is only used by var(vcs_info)'s hooks system. +is only used by tt(vcs_info)'s hooks system. ) kindex(hooks) item(tt(hooks))( -A list style that defines hook-function names. See tt(Hooks in vcs_info) +A list style that defines hook-function names. See bf(Hooks in vcs_info) below for details. ) enditem() @@ -951,7 +952,7 @@ sitem(tt(debug))(false) sitem(tt(hooks))((empty list)) sitem(tt(use-quilt))(false) sitem(tt(quilt-standalone))(false) -sitem(tt(quilt-patch-dir))(empty - use var($QUILT_PATCHES)) +sitem(tt(quilt-patch-dir))(empty - use tt($QUILT_PATCHES)) sitem(tt(quiltcommand))(quilt) endsitem() @@ -962,18 +963,18 @@ startsitem() sitem(tt(%s))(The VCS in use (git, hg, svn, etc.).) sitem(tt(%b))(Information about the current branch.) sitem(tt(%a))(An identifier that describes the action. Only makes sense in -var(actionformats).) +tt(actionformats).) sitem(tt(%i))(The current revision number or identifier. For tt(hg) -the var(hgrevformat) style may be used to customize the output.) -sitem(tt(%c))(The string from the var(stagedstr) style if there are staged +the tt(hgrevformat) style may be used to customize the output.) +sitem(tt(%c))(The string from the tt(stagedstr) style if there are staged changes in the repository.) -sitem(tt(%u))(The string from the var(unstagedstr) style if there are +sitem(tt(%u))(The string from the tt(unstagedstr) style if there are unstaged changes in the repository.) sitem(tt(%R))(The base directory of the repository.) -sitem(tt(%r))(The repository name. If tt(%R) is var(/foo/bar/repoXY), tt(%r) -is var(repoXY).) +sitem(tt(%r))(The repository name. If tt(%R) is tt(/foo/bar/repoXY), tt(%r) +is tt(repoXY).) sitem(tt(%S))(A subdirectory within a repository. If tt($PWD) is -var(/foo/bar/repoXY/beer/tasty), tt(%S) is var(beer/tasty).) +tt(/foo/bar/repoXY/beer/tasty), tt(%S) is tt(beer/tasty).) sitem(tt(%m))(A "misc" replacement. It is at the discretion of the backend to decide what this replacement expands to. It is currently used by the tt(hg) and tt(git) backends to display patch information from the tt(mq) and @@ -984,7 +985,7 @@ In tt(branchformat) these replacements are done: startsitem() sitem(tt(%b))(The branch name.) -sitem(tt(%r))(The current revision number or the var(hgrevformat) style for +sitem(tt(%r))(The current revision number or the tt(hgrevformat) style for tt(hg).) endsitem() @@ -1011,18 +1012,18 @@ no replacements are performed at all, it is just a string. subsect(Oddities) -If you want to use the tt(%b) (bold off) prompt expansion in var(formats), -which expands tt(%b) itself, use tt(%%b). That will cause the var(vcs_info) +If you want to use the tt(%b) (bold off) prompt expansion in tt(formats), +which expands tt(%b) itself, use tt(%%b). That will cause the tt(vcs_info) expansion to replace tt(%%b) with tt(%b), so that zsh's prompt expansion mechanism can handle it. Similarly, to hand down tt(%b) from -var(branchformat), use tt(%%%%b). Sorry for this inconvenience, but it +tt(branchformat), use tt(%%%%b). Sorry for this inconvenience, but it cannot be easily avoided. Luckily we do not clash with a lot of prompt expansions and this only needs to be done for those. subsect(Quilt Support) -tt(Quilt) is not a version control system, therefore this is not implemented +bf(Quilt) is not a version control system, therefore this is not implemented as a backend. It can help keeping track of a series of patches. People use it to keep a set of changes they want to use on top of software packages (which is tightly integrated into the package build process - the Debian project @@ -1030,63 +1031,63 @@ does this for a large number of packages). Quilt can also help individual developers keep track of their own patches on top of real version control systems. -The var(vcs_info) integration tries to support both ways of using quilt by +The tt(vcs_info) integration tries to support both ways of using quilt by having two slightly different modes of operation: `addon' mode and `standalone' mode). -For `addon' mode to become active var(vcs_info) must have already detected a +For `addon' mode to become active tt(vcs_info) must have already detected a real version control system controlling the directory. If that is the case, a directory that holds quilt's patches needs to be found. That directory is -configurable via the var(`QUILT_PATCHES') environment variable. If that -variable exists its value is used, otherwise the value tt(`patches') is -assumed. The value from var($QUILT_PATCHES) can be overwritten using the -tt(`quilt-patches') style. (Note: you can use var(vcs_info) to keep the value -of var($QUILT_PATCHES) correct all the time via the tt(post-quilt) hook). +configurable via the `tt(QUILT_PATCHES)' environment variable. If that +variable exists its value is used, otherwise the value `tt(patches)' is +assumed. The value from tt($QUILT_PATCHES) can be overwritten using the +tt(`quilt-patches') style. (Note: you can use tt(vcs_info) to keep the value +of tt($QUILT_PATCHES) correct all the time via the tt(post-quilt) hook). When the directory in question is found, quilt is assumed to be active. To -gather more information, var(vcs_info) looks for a directory called `.pc'; +gather more information, tt(vcs_info) looks for a directory called `.pc'; Quilt uses that directory to track its current state. If this directory does not exist we know that quilt has not done anything to the working directory (read: no patches have been applied yet). -If patches are applied, var(vcs_info) will try to find out which. If you want +If patches are applied, tt(vcs_info) will try to find out which. If you want to know which patches of a series are not yet applied, you need to activate the tt(get-unapplied) style in the appropriate context. -var(vcs_info) allows for very detailed control over how the gathered -information is presented (see the below sections, tt(Styles) and tt(Hooks in +tt(vcs_info) allows for very detailed control over how the gathered +information is presented (see the below sections, bf(Styles) and bf(Hooks in vcs_info)), all of which are documented below. Note there are a number of other patch tracking systems that work on top of a certain version control -system (like tt(stgit) for tt(git), or tt(mq) for tt(hg)); the configuration -for systems like that are generally configured the same way as the tt(quilt) +system (like tt(stgit) for bf(git), or tt(mq) for bf(hg)); the configuration +for systems like that are generally configured the same way as the bf(quilt) support. -If the tt(quilt) support is working in `addon' mode, the produced string is -available as a simple format replacement (var(%Q) to be precise), which can +If the bf(quilt) support is working in `addon' mode, the produced string is +available as a simple format replacement (tt(%Q) to be precise), which can be used in tt(formats) and tt(actionformats); see below for details). If, on the other hand, the support code is working in `standalone' mode, -var(vcs_info) will pretend as if tt(quilt) were an actual version control +tt(vcs_info) will pretend as if tt(quilt) were an actual version control system. That means that the version control system identifier (which otherwise would be something like `svn' or `cvs') will be set to `tt(-quilt-)'. This has implications on the used style context where this -identifier is the second element. var(vcs_info) will have filled in a proper +identifier is the second element. tt(vcs_info) will have filled in a proper value for the "repository's" root directory and the string containing the information about quilt's state will be available as the `misc' replacement -(and var(%Q) for compatibility with `addon' mode. +(and tt(%Q) for compatibility with `addon' mode. What is left to discuss is how `standalone' mode is detected. The detection itself is a series of searches for directories. You can have this detection enabled all the time in every directory that is not otherwise under version control. If you know there is only a limited set of trees where you would -like var(vcs_info) to try and look for Quilt in `standalone' mode to minimise -the amount of searching on every call to var(vcs_info), there are a number of +like tt(vcs_info) to try and look for Quilt in `standalone' mode to minimise +the amount of searching on every call to tt(vcs_info), there are a number of ways to do that: Essentially, `standalone' mode detection is controlled by a style called `tt(quilt-standalone)'. It is a string style and its value can have different effects. The simplest values are: `tt(always)' to run detection every time -var(vcs_info) is run, and `tt(never)' to turn the detection off entirely. +tt(vcs_info) is run, and `tt(never)' to turn the detection off entirely. If the value of tt(quilt-standalone) is something else, it is interpreted differently. If the value is the name of a scalar variable the value of that @@ -1115,10 +1116,10 @@ startitem() findex(vcs_info) item(tt(vcs_info) [var(user-context)])( The main function, that runs all backends and assembles all data into -var(${vcs_info_msg_*_}). This is the function you want to call from +tt(${vcs_info_msg_*_}). This is the function you want to call from tt(precmd) if you want to include up-to-date information in your prompt (see tt(Variable description) below). If an argument is given, that string will be -used instead of tt(default) in the tt(user-context) field of the style +used instead of tt(default) in the var(user-context) field of the style context. ) findex(vcs_info_hookadd) @@ -1126,7 +1127,7 @@ item(tt(vcs_info_hookadd))( Statically registers a number of functions to a given hook. The hook needs to be given as the first argument; what follows is a list of hook-function names to register to the hook. The `tt(+vi-)' prefix needs to be left out -here. See tt(Hooks in vcs_info) below for details. +here. See bf(Hooks in vcs_info) below for details. ) findex(vcs_info_hookdel) item(tt(vcs_info_hookdel))( @@ -1136,24 +1137,24 @@ 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 more than once) . The `tt(+vi-)' prefix needs to be left out here. See -tt(Hooks in vcs_info) below for details. +bf(Hooks in vcs_info) below for details. ) findex(vcs_info_lastmsg) item(tt(vcs_info_lastmsg))( -Outputs the last var(${vcs_info_msg_*_}) value. +Outputs the last tt(${vcs_info_msg_*_}) value. Takes into account the value of the tt(use-prompt-escapes) style in -var(':vcs_info:formats:command:-all-'). It also only prints tt(max-exports) +tt(':vcs_info:formats:command:-all-'). It also only prints tt(max-exports) values. ) findex(vcs_info_printsys) item(tt(vcs_info_printsys) [var(user-context)])( Prints a list of all supported version control systems. Useful to find out possible contexts -(and which of them are enabled) or values for the var(disable) style. +(and which of them are enabled) or values for the tt(disable) style. ) findex(vcs_info_setsys) item(tt(vcs_info_setsys))( -Initializes var(vcs_info)'s internal list of +Initializes tt(vcs_info)'s internal list of available backends. With this function, you can add support for new VCSs without restarting the shell. ) @@ -1164,15 +1165,15 @@ All functions named VCS_INFO_* are for internal use only. subsect(Variable Description) startitem() -item(tt(${vcs_info_msg_N_}) (Note the trailing underscore)) +item(tt(${vcs_info_msg_)var(N)tt(_}) (Note the trailing underscore)) ( -Where var(N) is an integer, e.g., var(vcs_info_msg_0_). These variables -are the storage for the informational message the last var(vcs_info) call +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 -var(${vcs_info_msg_0_}), the second into var(${vcs_info_msg_1_}) -and the Nth into var(${vcs_info_msg_N-1_}). These parameters are +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.) ) enditem() @@ -1181,12 +1182,12 @@ All variables named VCS_INFO_* are for internal use only. subsect(Hooks in vcs_info) -Hooks are places in var(vcs_info) where you can run your own code. That +Hooks are places in tt(vcs_info) where you can run your own code. That code can communicate with the code that called it and through that, change the system's behaviour. For configuration, hooks change the style context: -example(:vcs_info:<vcs-string>+<hook-name>:<user-context>:<repo-root-name>) +example(:vcs_info:var(vcs-string)PLUS()var(hook-name):var(user-context):var(repo-root-name)) To register functions to a hook, you need to list them in the tt(hooks) style in the appropriate context. @@ -1200,8 +1201,8 @@ a `+vi-', so the actual functions called for the `foo' hook are `tt(+vi-bar)' and `tt(+vi-baz)'. If you would like to register a function to a hook regardless of the -current context, you may use the var(vcs_info_hookadd) function. To remove -a function that was added like that, the var(vcs_info_hookdel) function +current context, you may use the tt(vcs_info_hookadd) function. To remove +a function that was added like that, the tt(vcs_info_hookdel) function can be used. If something seems weird, you can enable the `debug' boolean style in @@ -1212,7 +1213,7 @@ When you register more than one function to a hook, all functions are executed one after another until one function returns non-zero or until all functions have been called. Context-sensitive hook functions are executed tt(before) statically registered ones (the ones added by -var(vcs_info_hookadd)). +tt(vcs_info_hookadd)). You may pass data between functions via an associative array, tt(user_data). For example: @@ -1251,10 +1252,10 @@ Finally, the full list of currently available hooks: startitem() item(tt(start-up))( -Called after starting var(vcs_info) but before the VCS in this directory is -determined. It can be used to deactivate var(vcs_info) temporarily if -necessary. When tt(ret) is set to var(1), var(vcs_info) aborts and does -nothing; when set to var(2), var(vcs_info) sets up everything as if no +Called after starting tt(vcs_info) but before the VCS in this directory is +determined. It can be used to deactivate tt(vcs_info) temporarily if +necessary. When tt(ret) is set to tt(1), tt(vcs_info) aborts and does +nothing; when set to tt(2), tt(vcs_info) sets up everything as if no version control were active and exits. ) item(tt(pre-get-data))( @@ -1265,40 +1266,40 @@ Called in the Mercurial backend when a bookmark string is generated; the tt(get-revision) and tt(get-bookmarks) styles must be true. This hook gets the names of the Mercurial bookmarks that -var(vcs_info) collected from `hg'. +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 var(%m) escape 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 -var(backend_misc) array as tt(${backend_misc[bookmarks]}). +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 var(applied-string) is generated; the +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 var(vcs_info) collected +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 top-most patch and so forth. When setting tt(ret) to non-zero, the string in -tt(${hook_com[applied-string]}) will be used in the var(%m) escape in +tt(${hook_com[applied-string]}) will be used in the tt(%m) escape in tt(formats) and tt(actionformats); it will be available in the global -var(backend_misc) array as tt($backend_misc[patches]}); and it will be -available as var(%p) in the tt(patch-format) and tt(nopatch-format) styles. +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 var(unapplied-string) is generated; the +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 var(vcs_info) +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 the patch next-in-line to be applied and so forth. When setting tt(ret) to non-zero, the string in -tt(${hook_com[unapplied-string]}) will be available as var(%u) in the +tt(${hook_com[unapplied-string]}) will be available as tt(%u) in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(gen-mqguards-string))( @@ -1308,7 +1309,7 @@ tt(get-mq) style must be true (default). This hook gets the names of any active tt(mq) guards. When setting tt(ret) to non-zero, the string in -tt(${hook_com[guards-string]}) will be used in the var(%g) escape in the +tt(${hook_com[guards-string]}) will be used in the tt(%g) escape in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(no-vcs))( @@ -1330,24 +1331,24 @@ Called before `tt(branchformat)' is set. The only argument to the hook is the format that is configured at this point. The `tt(hook_com)' keys considered are `tt(branch)' and `tt(revision)'. -They are set to the values figured out so far by var(vcs_info) and any +They are set to the values figured out so far by tt(vcs_info) and any change will be used directly when the actual replacement is done. If tt(ret) is set to non-zero, the string in tt(${hook_com[branch-replace]}) will be used unchanged as the -`tt(%b)' replacement in the variables set by var(vcs_info). +`tt(%b)' replacement in the variables set by tt(vcs_info). ) item(tt(set-hgrev-format))( Called before a `tt(hgrevformat)' is set. The only argument to the hook is the format that is configured at this point. The `tt(hook_com)' keys considered are `tt(hash)' and `tt(localrev)'. -They are set to the values figured out so far by var(vcs_info) and any +They are set to the values figured out so far by tt(vcs_info) and any change will be used directly when the actual replacement is done. If tt(ret) is set to non-zero, the string in tt(${hook_com[rev-replace]}) will be used unchanged as the -`tt(%i)' replacement in the variables set by var(vcs_info). +`tt(%i)' replacement in the variables set by tt(vcs_info). ) item(tt(set-message))( Called each time before a `tt(vcs_info_msg_N_)' message is set. @@ -1360,7 +1361,7 @@ There are a number of `tt(hook_com)' keys, that are used here: `tt(staged)', `tt(unstaged)', `tt(revision)', `tt(misc)', `tt(vcs)' and one `tt(miscN)' entry for each backend-specific data field (tt(N) starting at zero). They are set to the values figured out so far by -var(vcs_info) and any change will be used directly when the actual +tt(vcs_info) and any change will be used directly when the actual replacement is done. Since this hook is triggered multiple times (once for each configured @@ -1372,7 +1373,7 @@ probably not a good idea. If tt(ret) is set to non-zero, the string in tt(${hook_com[message]}) will be used unchanged as the message by -var(vcs_info). +tt(vcs_info). ) enditem() @@ -1382,7 +1383,7 @@ They contain some explanatory code. subsect(Examples) -Don't use var(vcs_info) at all (even though it's in your prompt): +Don't use tt(vcs_info) at all (even though it's in your prompt): example(zstyle ':vcs_info:*' enable NONE) Disable the backends for tt(bzr) and tt(svk): @@ -1415,7 +1416,7 @@ Display the revision number in yellow for tt(bzr) and tt(svn): example(zstyle ':vcs_info:(svn|bzr):*' branchformat '%b%{'${fg[yellow]}'%}:%r') If you want colors, make sure you enclose the color codes in tt(%{...%}) -if you want to use the string provided by var(vcs_info) in prompts. +if you want to use the string provided by tt(vcs_info) in prompts. Here is how to print the VCS information as a command (not in a prompt): example(alias vcsi='vcs_info command; vcs_info_lastmsg') @@ -1425,9 +1426,9 @@ tt(vcs_info_lastmsg) in the ':vcs_info:*:command:*' namespace. Now as promised, some code that uses hooks: say, you'd like to replace the string `svn' by `subversion' in -var(vcs_info)'s tt(%s) tt(formats) replacement. +tt(vcs_info)'s tt(%s) tt(formats) replacement. -First, we will tell var(vcs_info) to call a function when populating +First, we will tell tt(vcs_info) to call a function when populating the message variables with the gathered information: example(zstyle ':vcs_info:*+set-message:*' hooks svn2subversion) @@ -1503,7 +1504,7 @@ Some longer examples and code snippets which might be useful are available in the examples file located at Misc/vcs_info-examples in the Zsh source directory. -This concludes our guided tour through zsh's var(vcs_info). +This concludes our guided tour through zsh's tt(vcs_info). texinode(Prompt Themes)(ZLE Functions)(Version Control Information)(User Contributions) @@ -2334,6 +2335,11 @@ regular expression matching is performed, else a literal string replacement. Note that the previous source and replacement text are the same whether pattern, regular expression or string matching is used. +In addition, tt(replace-string) shows the previous replacement above +the prompt, so long as there was one during the current session; if the +source string is empty, that replacement will be repeated without +the widget prompting for a replacement string. + For example, starting from the line: example(print This line contains fan and fond) @@ -2355,7 +2361,7 @@ This is similar to read-from-minibuffer in that it may be called as a function from a widget or as a widget of its own, and interactively reads input from the keyboard. However, the input being typed is concealed and a string of asterisks (`tt(*)') is shown instead. The value is saved in -the paramter tt($INVISIBLE) to which a reference is inserted into the +the parameter tt($INVISIBLE) to which a reference is inserted into the editing buffer at the restored cursor position. If the read was aborted by a keyboard break (typically tt(^G)) or another escape from editing such as tt(push-line), tt($INVISIBLE) is set to empty and the original buffer @@ -2797,6 +2803,23 @@ start with tt(:mime:), with additional components in some cases. It is recommended that a trailing tt(*) (suitably quoted) be appended to style patterns in case the system is extended in future. Some examples are given below. + +For files that have multiple suffixes, e.g. tt(.pdf.gz), where the +context includes the suffix it will be looked up starting with the +longest possible suffix until a match for the style is found. +For example, if tt(.pdf.gz) produces a match for the handler, that +will be used; otherwise the handler for tt(.gz) will be used. Note +that, owing to the way suffix aliases work, it is always required that +there be a handler for the shortest possible suffix, so in this example +tt(.pdf.gz) can only be handled if tt(.gz) is also handled (though +not necessarily in the same way). Alternatively, if no handling +for tt(.gz) on its own is needed, simply adding the command + +example(alias -s gz=zsh-mime-handler) + +to the initialisation code is sufficient; tt(.gz) will not be handled +on its own, but may be in combination with other suffixes. + startitem() kindex(current-shell, MIME style) item(tt(current-shell))( diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index ce122cade..28d525f14 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -236,7 +236,10 @@ a glob qualifier unless a file of the same name is found in the current directory. ) item(tt(e))( -Remove all but the extension. +Remove all but the part of the filename extension following the `tt(.)'; +see the definition of the filename extension in the description of the +tt(r) modifier below. Note that according to that definition the result +will be empty if the string ends with a `tt(.)'. ) item(tt(h))( Remove a trailing pathname component, leaving the head. This works @@ -259,8 +262,12 @@ item(tt(Q))( Remove one level of quotes from the substituted words. ) item(tt(r))( -Remove a filename extension of the form `tt(.)var(xxx)', leaving -the root name. +Remove a filename extension leaving the root name. Strings with no +filename extension are not altered. A filename +extension is a `tt(.)' followed by any number of characters (including +zero) that are neither `tt(.)' nor `tt(/)' and that continue to the end +of the string. For example, the extension of +`tt(foo.orig.c)' is `tt(.c)', and `tt(dir.c/foo)' has no extension. ) item(tt(s/)var(l)tt(/)var(r)[tt(/)])( Substitute var(r) for var(l) as described below. @@ -464,6 +471,18 @@ example(tt({ paste <LPAR()cut -f1) var(file1)tt(RPAR() <LPAR()cut -f3) var(file2 The extra processes here are 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 +the shell no longer has any memory of the job. A workaround is to use +a subshell, for example, + +example(LPAR()mycmd =(myoutput)RPAR() &!) + +as the forked subshell will wait for the command to finish then remove +the temporary file. + texinode(Parameter Expansion)(Command Substitution)(Process Substitution)(Expansion) sect(Parameter Expansion) cindex(parameter expansion) @@ -1992,15 +2011,16 @@ point on. ) item(tt(c)var(N)tt(,)var(M))( The flag tt(LPAR()#c)var(N)tt(,)var(M)tt(RPAR()) can be used anywhere -that the tt(#) or tt(##) operators can be used; it cannot be combined -with other globbing flags and a bad pattern error occurs if it is -misplaced. It is equivalent to the form tt({)var(N)tt(,)var(M)tt(}) in -regular expressions. The previous character or group is required to -match between var(N) and var(M) times, inclusive. The form -tt(LPAR()#c)var(N)tt(RPAR()) requires exactly tt(N) matches; -tt(LPAR()#c,)var(M)tt(RPAR()) is equivalent to specifying var(N) as 0; -tt(LPAR()#c)var(N)tt(,RPAR()) specifies that there is no maximum limit -on the number of matches. +that the tt(#) or tt(##) operators can be used except in the expressions +`tt((*/)#)' and `tt((*/)##)' in filename generation, where `tt(/)' +has special meaning; it cannot be combined with other globbing flags and +a bad pattern error occurs if it is misplaced. It is equivalent to the +form tt({)var(N)tt(,)var(M)tt(}) in regular expressions. The previous +character or group is required to match between var(N) and var(M) times, +inclusive. The form tt(LPAR()#c)var(N)tt(RPAR()) requires exactly tt(N) +matches; tt(LPAR()#c,)var(M)tt(RPAR()) is equivalent to specifying var(N) +as 0; tt(LPAR()#c)var(N)tt(,RPAR()) specifies that there is no maximum +limit on the number of matches. ) item(tt(m))( Set references to the match data for the entire string matched; this is @@ -2360,8 +2380,8 @@ latter is inserted into the command line word by word. For example, suppose a directory contains a single file `tt(lonely)'. Then the expression `tt(*(e:'reply=(${REPLY}{1,2})':))' will cause the words -`tt(lonely1 lonely2)' to be inserted into the command line. Note the -quotation marks. +`tt(lonely1)' and `tt(lonely2)' to be inserted into the command line. Note +the quoting of var(string). The form tt(PLUS())var(cmd) has the same effect, but no delimiters appear around var(cmd). Instead, var(cmd) is taken as the longest sequence of diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 28bc6329a..7c391f80d 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -158,9 +158,20 @@ If no name is given for a function, it is `anonymous' and is handled specially. Either form of function definition may be used: a `tt(())' with no preceding name, or a `tt(function)' with an immediately following open brace. The function is executed immediately at the point of definition and -is not stored for future use. The function name is set to `tt((anon))' and -the parameter list passed to the function is empty. Note that this means -the argument list of any enclosing script or function is hidden. +is not stored for future use. The function name is set to `tt((anon))'. + +Arguments to the function may be specified as words following the +closing brace defining the function, hence if there are none no +arguments (other than tt($0)) are set. This is a difference from the +way other functions are parsed: normal function definitions may be +followed by certain keywords such as `tt(else)' or `tt(fi)', which will +be treated as arguments to anonymous functions, so that a newline or +semicolon is needed to force keyword interpretation. + +Note also that the argument list of any enclosing script or function is +hidden (as would be the case for any other function called at this +point). + Redirections may be applied to the anonymous function in the same manner as to a current-shell structure enclosed in braces. The main use of anonymous functions is to provide a scope for local variables. This is particularly @@ -172,13 +183,13 @@ For example, example(variable=outside function { local variable=inside - print "I am $variable" -} + print "I am $variable with arguments $*" +} this and that print "I am $variable") outputs the following: -example(I am inside +example(I am inside with arguments this and that I am outside) Note that function definitions with arguments that expand to nothing, diff --git a/Doc/Zsh/mod_datetime.yo b/Doc/Zsh/mod_datetime.yo index 145d4a181..619067698 100644 --- a/Doc/Zsh/mod_datetime.yo +++ b/Doc/Zsh/mod_datetime.yo @@ -30,12 +30,35 @@ in seconds if tt(-r) is given) to var(scalar) instead of printing it. ) enditem() -The tt(zsh/datetime) module makes available one parameter: +The tt(zsh/datetime) module makes available several parameters; +all are readonly: startitem() +vindex(EPOCHREALTIME) +item(tt(EPOCHREALTIME))( +A floating point value representing the number of seconds since +the epoch. The notional accuracy is to nanoseconds if the +tt(clock_gettime) call is available and to microseconds otherwise, +but in practice the range of double precision floating point and +shell scheduling latencies may be significant effects. +) vindex(EPOCHSECONDS) item(tt(EPOCHSECONDS))( An integer value representing the number of seconds since the epoch. ) +vindex(epochtime) +item(tt(epochtime))( +An array value containing the number of seconds since the epoch +in the first element and the remainder of the time since the epoch +in nanoseconds in the second element. To ensure the two elements +are consistent the array should be copied or otherwise referenced +as a single substitution before the values are used. The following +idiom may be used: + +example(for secs nsecs in $epochtime; do + ... +done) + +) enditem() diff --git a/Doc/Zsh/mod_zutil.yo b/Doc/Zsh/mod_zutil.yo index 1838eab5e..726b0f055 100644 --- a/Doc/Zsh/mod_zutil.yo +++ b/Doc/Zsh/mod_zutil.yo @@ -101,7 +101,8 @@ style is defined for at least one matching pattern, has only one string in its value, and that is equal to one of `tt(true)', `tt(yes)', `tt(on)' or `tt(1)'. If any var(strings) are given the status is zero if and only if at least one of the var(strings) is equal to at least one of the strings -in the value. If the style is not defined, the status is tt(2). +in the value. If the style is defined but doesn't match, the return status +is tt(1). If the style is not defined, the status is tt(2). The tt(-T) option tests the values of the style like tt(-t), but it returns status zero (rather than tt(2)) if the style is not defined for any diff --git a/Doc/Zsh/modules.yo b/Doc/Zsh/modules.yo index 3f9986096..c8b846b95 100644 --- a/Doc/Zsh/modules.yo +++ b/Doc/Zsh/modules.yo @@ -6,7 +6,11 @@ Some optional parts of zsh are in modules, separate from the core of the shell. Each of these modules may be linked in to the shell at build time, or can be dynamically linked while the shell is running -if the installation supports this feature. The modules that -are bundled with the zsh distribution are: +if the installation supports this feature. +Modules are linked at runtime with the tt(zmodload) command, +see ifzman(zmanref(zshbuiltins))\ +ifnzman(noderef(Shell Builtin Commands)). + +The modules that are bundled with the zsh distribution are: includefile(Zsh/modlist.yo) diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index 22a00f5c2..e9a3c722d 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -907,7 +907,7 @@ directory would still be completed). ) vindex(DIRSTACKSIZE) item(tt(DIRSTACKSIZE))( -The maximum size of the directory stack. If the +The maximum size of the directory stack, by default there is no limit. If the stack gets larger than this, it will be truncated automatically. This is useful with the tt(AUTO_PUSHD) option. pindex(AUTO_PUSHD, use of) @@ -1226,7 +1226,7 @@ vindex(RPS1) item(tt(RPS1) <S>)( This prompt is displayed on the right-hand side of the screen when the primary prompt is being displayed on the left. -This does not work if the tt(SINGLELINEZLE) option is set. +This does not work if the tt(SINGLE_LINE_ZLE) option is set. It is expanded in the same way as tt(PS1). ) vindex(RPROMPT2) @@ -1235,7 +1235,7 @@ vindex(RPS2) item(tt(RPS2) <S>)( This prompt is displayed on the right-hand side of the screen when the secondary prompt is being displayed on the left. -This does not work if the tt(SINGLELINEZLE) option is set. +This does not work if the tt(SINGLE_LINE_ZLE) option is set. It is expanded in the same way as tt(PS2). ) vindex(SAVEHIST) diff --git a/Doc/Zsh/redirect.yo b/Doc/Zsh/redirect.yo index 3877b2313..8d231f40f 100644 --- a/Doc/Zsh/redirect.yo +++ b/Doc/Zsh/redirect.yo @@ -149,13 +149,32 @@ file descriptor 2 would be associated with the terminal (assuming file descriptor 1 had been) and then file descriptor 1 would be associated with file var(fname). -If instead of a digit one of the operators above is preceded by -a valid identifier enclosed in braces, the shell will open a new -file descriptor that is guaranteed to be at least 10 and set the -parameter named by the identifier to the file descriptor opened. -No whitespace is allowed between the closing brace and the redirection -character. The option tt(IGNORE_BRACES) must not be set. -For example: +The `tt(|&)' command separator described in +ifzman(em(Simple Commands & Pipelines) in zmanref(zshmisc))\ +ifnzman(noderef(Simple Commands & Pipelines)) +is a shorthand for `tt(2>&1 |)'. + +The various forms of process substitution, `tt(<LPAR())var(list)tt(RPAR())', +and `tt(=LPAR())var(list)(RPAR())' for input and +`tt(>LPAR())var(list)tt(RPAR())' for output, are often used together with +redirection. For example, if var(word) in an output redirection is of the +form `tt(>LPAR())var(list)tt(RPAR())' then the output is piped to the +command represented by var(list). See +ifzman(\ +em(Process Substitution) in zmanref(zshexpn))\ +ifnzman(\ +noderef(Process Substitution)). +sect(Opening file descriptors using parameters) +cindex(file descriptors, use with parameters) +cindex(parameters, for using file descriptors) + +When the shell is parsing arguments to a command, and the shell option +tt(IGNORE_BRACES) is not set, a different form of redirection is allowed: +instead of a digit before the operator there is a valid shell identifier +enclosed in braces. The shell will open a new file descriptor that +is guaranteed to be at least 10 and set the parameter named by the +identifier to the file descriptor opened. No whitespace is allowed +between the closing brace and the redirection character. For example: indent(... {myfd}>&1) @@ -181,8 +200,12 @@ using it for allocating a file descriptor avoids the error. Note that this mechanism merely allocates or closes a file descriptor; it does not perform any redirections from or to it. It is usually convenient -to allocate a file descriptor prior to use as an argument to tt(exec). The -following shows a typical sequence of allocation, use, and closing of a +to allocate a file descriptor prior to use as an argument to tt(exec). +The syntax does not in any case work when used around complex commands +such as parenthesised subshells or loops, where the opening brace is +interpreted as part of a command list to be executed in the current shell. + +The following shows a typical sequence of allocation, use, and closing of a file descriptor: example(integer myfd @@ -194,22 +217,6 @@ Note that the expansion of the variable in the expression tt(>&$myfd) occurs at the point the redirection is opened. This is after the expansion of command arguments and after any redirections to the left on the command line have been processed. - -The `tt(|&)' command separator described in -ifzman(em(Simple Commands & Pipelines) in zmanref(zshmisc))\ -ifnzman(noderef(Simple Commands & Pipelines)) -is a shorthand for `tt(2>&1 |)'. - -The various forms of process substitution, `tt(<LPAR())var(list)tt(RPAR())', -and `tt(=LPAR())var(list)(RPAR())' for input and -`tt(>LPAR())var(list)tt(RPAR())' for output, are often used together with -redirection. For example, if var(word) in an output redirection is of the -form `tt(>LPAR())var(list)tt(RPAR())' then the output is piped to the -command represented by var(list). See -ifzman(\ -em(Process Substitution) in zmanref(zshexpn))\ -ifnzman(\ -noderef(Process Substitution)). sect(Multios) cindex(multios) pindex(MULTIOS, use of) diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 5f4d639d3..752247461 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -392,11 +392,16 @@ commands to create the widgets. When combined with the tt(-a) option, all widget names are listed, including the builtin ones. In this case the tt(-L) option is ignored. -If at least one var(string) is given, nothing will be printed but the -return status will be zero if all var(string)s are names of existing -widgets (or of user-defined widgets if the tt(-a) flag is not given) -and non-zero if at least one var(string) is not a name of an defined -widget. +If at least one var(string) is given, and tt(-a) is present or tt(-L) is +not used, nothing will be printed. The return status will be zero if +all var(string)s are names of existing widgets and non-zero if at least one +var(string) is not a name of a defined widget. If tt(-a) is also +present, all widget names are used for the comparison including builtin +widgets, else only user-defined widgets are used. + +If at least one var(string) is present and the tt(-L) option is used, +user-defined widgets matching any var(string) are listed in the form of +tt(zle) commands to create the widgets. ) item(tt(-D) var(widget) ...)( Delete the named var(widget)s. |