1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 05:00:59 +01:00

Merge of users/10748: improve example, make one feature clearer.

This commit is contained in:
Paul Ackersviller 2007-10-29 19:35:46 +00:00
parent 85ef41cdc8
commit c7668524ca

View file

@ -589,19 +589,15 @@ appear as the argument to a style; this requires some understanding of
the internals of completion functions (see the internals of completion functions (see
ifzman(see zmanref(zshcompwid))\ ifzman(see zmanref(zshcompwid))\
ifnzman(noderef(Completion Widgets)))\ ifnzman(noderef(Completion Widgets)))\
). For example: ). For example,
example(zstyle -e ':completion:*' completer ' example(tt(ztyle -e ':completion:*' hosts 'reply=($myhosts)'))
if [[ $words[1] = cvs ]]; then
reply=(_complete)
else
reply=(_complete _approximate)
fi')
uses the value `tt(_complete)' for the tt(completer) style in most This forces the value of the tt(hosts) style to be read from the
contexts, but the value `tt(_complete _approximate)' when the first word variable tt(myhosts) each time a host name is needed; this is useful
on the command line is `tt(cvs)'. This is probably more conveniently done if the value of tt(myhosts) can change dynamically.
by specifying the style for two different contexts. This form can be For another useful example, see the example in the description of the
tt(file-list) style below. This form can be
slow and should be avoided for commonly examined styles such slow and should be avoided for commonly examined styles such
as tt(menu) and tt(list-rows-first). as tt(menu) and tt(list-rows-first).
@ -3313,8 +3309,8 @@ This describes multiple arguments. Only the last var(optarg) for
an option taking multiple arguments may be an option taking multiple arguments may be
given in this form. If the var(pattern) is empty (i.e., tt(:*:)), all given in this form. If the var(pattern) is empty (i.e., tt(:*:)), all
the remaining words on the line are to be completed as described by the the remaining words on the line are to be completed as described by the
var(action); otherwise, all the words up to a word matching the var(action); otherwise, all the words up to and including a word matching
var(pattern) are to be completed using the var(action). the var(pattern) are to be completed using the var(action).
Multiple colons are treated as for the `tt(*:)var(...)' forms for Multiple colons are treated as for the `tt(*:)var(...)' forms for
ordinary arguments: when the var(message) is preceded by two colons, ordinary arguments: when the var(message) is preceded by two colons,