diff options
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/compctl.yo | 9 | ||||
-rw-r--r-- | Doc/Zsh/compsys.yo | 30 | ||||
-rw-r--r-- | Doc/Zsh/compwid.yo | 65 | ||||
-rw-r--r-- | Doc/Zsh/expn.yo | 6 | ||||
-rw-r--r-- | Doc/Zsh/manual.yo | 3 | ||||
-rw-r--r-- | Doc/Zsh/mod_clone.yo | 2 | ||||
-rw-r--r-- | Doc/Zsh/mod_compctl.yo | 10 | ||||
-rw-r--r-- | Doc/Zsh/mod_complete.yo | 7 | ||||
-rw-r--r-- | Doc/Zsh/mod_computil.yo | 2 | ||||
-rw-r--r-- | Doc/Zsh/mod_parameter.yo | 62 | ||||
-rw-r--r-- | Doc/Zsh/mod_zle.yo | 2 | ||||
-rw-r--r-- | Doc/Zsh/mod_zleparameter.yo | 28 | ||||
-rw-r--r-- | Doc/Zsh/modules.yo | 12 |
13 files changed, 149 insertions, 89 deletions
diff --git a/Doc/Zsh/compctl.yo b/Doc/Zsh/compctl.yo index 85993e917..b55aa91be 100644 --- a/Doc/Zsh/compctl.yo +++ b/Doc/Zsh/compctl.yo @@ -141,7 +141,7 @@ startlist() list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu/12) ]) list([ tt(-k) var(array) ] [ tt(-g) var(globstring) ] \ [ tt(-s) var(subststring) ]) -list([ tt(-K) var(function) ] [ tt(-i) var(function) ]) +list([ tt(-K) var(function) ]) list([ tt(-Q) ] [ tt(-P) var(prefix) ] [ tt(-S) var(suffix) ]) list([ tt(-W) var(file-prefix) ] [ tt(-H) var(num pattern) ]) list([ tt(-q) ] [ tt(-X) var(explanation) ] [ tt(-Y) var(explanation) ]) @@ -314,13 +314,6 @@ compctl -K whoson talk) completes only logged-on users after `tt(talk)'. Note that `tt(whoson)' must return an array, so `tt(reply=`users`)' would be incorrect. ) -item(tt(-i) var(function))( -Like tt(-K), but the function is invoked in a context like that for -completion widgets, see -ifzman(zmanref(zshzle))\ -ifnzman(noderef(The zle Module)) -for more information. -) item(tt(-H) var(num pattern))( The possible completions are taken from the last var(num) history lines. Only words matching var(pattern) are taken. If var(num) is diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 5e313e904..f2f551639 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -13,7 +13,7 @@ completion behaviour and which may be bound to keystrokes, are referred to as `widgets'. Note that with the function-based completions described here, it -is also possible to use the `tt(compctl -M ...)' mechanism and the +is also possible to use the tt(compmatchers) special array to specify global matching control, such as case-insensitivity (`tt(abc)' will complete to a string beginning `tt(ABC)'), or wildcard behaviour on @@ -21,10 +21,11 @@ certain anchors (`tt(a-d)' will complete to abc-def as if there were a `tt(*)' after the `a'). See ifzman(the section `Matching Control' in zmanref(zshcompctl))\ ifnzman(noderef(Matching Control)) -for further details. Note that it is recommended to use the the -tt(compmatchers) array instead of tt(compctl) to define global -matchers when using the function based completion system, although -using tt(compctl -M) still works. +for further details. + +Also note that this completion system requires the tt(parameter) and +tt(zleparameter) modules to be linked into the shell or to be +dynamically loadable. startmenu() menu(Initialization) @@ -595,7 +596,7 @@ item(tt(_description))( This function gets two arguments: the name of an array and a string. It tests if the configuration key tt(description_format) is set and if it is, it stores some options in the array that can then be -given to the tt(compadd) and tt(compgen) builtin commands to make the +given to the tt(compadd) builtin command to make the value of the tt(description_format) key (with the sequence `tt(%d)' replaced by the string given as the second argument) be displayed above the matches added. These options also will make sure that the @@ -704,7 +705,7 @@ completion functions is that it allows completion of partial paths. For example, the string `tt(/u/i/s/sig)' may be completed to `tt(/usr/include/sys/signal.h)'. The options `tt(-/)', `tt(-f)', `tt(-g)', and `tt(-W)' are available as for the tt(compctl) -and tt(compgen) builtins; tt(-f) is the default. Additionally, the `tt(-F)' +and builtin command; tt(-f) is the default. Additionally, the `tt(-F)' option from the tt(compadd) builtin is supported, giving direct control over which filenames should be ignored as done by the tt(fignore) parameter in normal completion. @@ -744,12 +745,11 @@ extra options of tt(compadd). All arguments are passed unchanged to the tt(compadd) builtin. ) item(tt(_options))( -This can be used to complete option names. The difference to the -`tt(-o)' option of tt(compgen) is that this function uses a matching +This can be used to complete option names. It uses a matching specification that ignores a leading `tt(no)', ignores underscores and allows the user to type upper-case letters, making them match their lower-case counterparts. All arguments passed to this function are -propagated unchanged to the tt(compgen) builtin. +propagated unchanged to the tt(compadd) builtin. ) item(tt(_set_options) and tt(_unset_options))( These functions complete only set or unset options, with the same @@ -897,8 +897,8 @@ var(action) does not begin with an opening parentheses or brace, it will be split into separate words and executed. If the var(action) starts with a space, this list of words will be invoked unchanged, otherwise it will be invoked with some extra string placed after the -first word which can be given as arguments to the tt(compadd) and -tt(compgen) builtins and which make sure that the var(message) given +first word which can be given as arguments to the tt(compadd) builtin +command and which make sure that the var(message) given in the description will be shown above the matches. These arguments are taken from the array parameter tt(expl) which will be set up before executing the var(action) and hence may be used in it (normally @@ -1273,9 +1273,9 @@ completions. Unambiguous parts of the function name will be completed automatically (normal completion is not available at this point) until a space is typed. -Otherwise, any other string, for example `tt(-b)', will be passed as -arguments to tt(compgen) and should hence be a set of flags specifying the -type of completion. +Otherwise, any other string, will be passed as +arguments to tt(compadd) and should hence be an expression specifying +what should be completed. A very restricted set of editing commands is available when reading the string: `tt(DEL)' and `tt(^H)' delete the last character; `tt(^U)' deletes diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index 605a6d35a..c22a7bb14 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -199,7 +199,7 @@ item(tt(matcher))( When completion is performed with a global match specification as defined by -indent(tt(compctl -M) var(spec1 ... specN ...)) +indent(tt(compmatchers=)tt(LPAR()) var(spec1 ... specN ...) tt(RPAR())) this gives the number of the specification string currently in use. In this case, matching is performed with each specification in turn. @@ -358,32 +358,6 @@ enditem() texinode(Builtin Commands)(Condition Codes)(Special Parameters)(Completion Widgets) sect(Builtin Commands) startitem() -cindex(completion widgets, generating matches with flags) -findex(compgen) -item(tt(compgen) var(flags ...))( - -Generate matches according to the given var(flags). These can be any of -the normal option flags (not those for extended completion) supported by -the tt(compctl) builtin command (see -ifzman(zmanref(zshcompctl))\ -ifnzman(noderef(Programmable Completion Using compctl))\ -) except for the tt(-t) and tt(-l) flags. However, when using the tt(-K) -flag, the function given as argument to it cannot access the command -line with the tt(read) builtin command. - -The matches will be generated in the same way as if the completion code -generated them directly from a tt(compctl)-definition with the same -flags. The completion code will consider only those matches as -possible completions that match the prefix and suffix from the special -parameters described above. These strings will be compared with the -generated matches using the normal matching rules and any matching -specifications given with the tt(-M) flag to tt(compgen) and the -global matching specifications given via the tt(compctl -M )var(spec1 ...) -builtin command. - -The return value is zero if at least one match was added and non-zero -otherwise. -) findex(compadd) cindex(completion widgets, adding specified matches) xitem(tt(compadd) [ tt(-qQfenUaml12) ] [ tt(-F) var(array) ]) @@ -425,8 +399,7 @@ The supported flags are: startitem() item(tt(-P) var(prefix))( -As for tt(compctl) and tt(compgen), it gives a string to -be inserted before the given var(words). The +This gives a string to be inserted before the given var(words). The string given is not considered as part of the match. ) item(tt(-S) var(suffix))( @@ -450,12 +423,6 @@ match. item(tt(-I) var(ignored-suffix))( Like tt(-i), but gives an ignored suffix. ) -item(tt(-y) var(array))( -This gives a number of strings to display instead of the matches. This -is like the tt(-y) option of the tt(compctl) builtin command but the -var(array) argument may only be the name of an array parameter or a -literal array in parentheses containing the strings to display. -) item(tt(-d) var(array))( This adds per-match display strings. The var(array) should contain one element per var(word) given. The completion code will then display the @@ -474,8 +441,7 @@ options. If it is given, the display strings are listed one per line, not arrayed in columns. ) item(tt(-J) var(name))( -As for tt(compctl) and tt(compgen), this gives the name of the group -of matches the words should be stored in. +Gives the name of the group of matches the words should be stored in. ) item(tt(-V) var(name))( Like tt(-J) but naming a unsorted group. @@ -491,12 +457,10 @@ duplicates be kept. Again, groups with and without this flag are in different name spaces. ) item(tt(-X) var(explanation))( -As for tt(compctl) and tt(compgen), the var(explanation) string will be -printed with the list of matches. +The var(explanation) string will be printed with the list of matches. ) item(tt(-q))( -As for tt(compctl) and tt(compgen), -the suffix given with tt(-S) will be automatically removed if +The suffix given with tt(-S) will be automatically removed if the next character typed is a blank or does not insert anything, or if the suffix consists of only one character and the next character typed is the same character. @@ -540,17 +504,15 @@ the tt(AUTO_PARAM_SLASH) and tt(AUTO_PARAM_KEYS) options be used for the matches. ) item(tt(-W) var(file-prefix))( -This option has the same meaning as for the tt(compctl) and -tt(compgen) builtin commands. Here, however, only one string may be -given, not an array. This string is a pathname that will be +This string is a pathname that will be prepended to each of the matches formed by the given var(words) together with any prefix specified by the tt(-p) option to form a complete filename for testing. Hence it is only useful if combined with the tt(-f) flag, as the tests will not otherwise be performed. ) item(tt(-a))( -In the tt(compctl) or tt(compgen) commands, the completion code normally -builds two sets of matches: the normal one where words with one of the +The completion code may +build two sets of matches: the normal one where words with one of the suffixes in the array parameter tt(fignore) are not considered possible matches, and the alternate set where the words excluded from the first set are stored. Normally only the matches in the first @@ -574,12 +536,12 @@ literal suffixes enclosed in parentheses and quoted, as in `tt(-F "(.o taken as the suffixes. ) item(tt(-Q))( -As for tt(compctl) and tt(compgen), this flag instructs the completion +This flag instructs the completion code not to quote any metacharacters in the words when inserting them into the command line. ) item(tt(-M) var(match-spec))( -As for tt(compctl) and tt(compgen), this gives local match specifications. +This gives local match specifications. Note that they will only be used if the tt(-U) option is not given. ) item(tt(-n))( @@ -593,7 +555,7 @@ functions that do the matching themselves. Note that with tt(compadd) this option does not automatically turn on menu completion if tt(AUTO_LIST) is set, unlike the corresponding option of -tt(compctl) and tt(compgen) commands. +tt(compctl). ) item(tt(-O) var(array))( If this option is given, the var(words) are em(not) added to the set of @@ -714,7 +676,6 @@ This forces anything up to and including the last equal sign to be ignored by the completion code. ) item(tt(compcall) [ tt(-TD) ])( - This allows the use of completions defined with the tt(compctl) builtin from within completion widgets. The list of matches will be generated as if one of the non-widget completion function (tt(complete-word), etc.) @@ -727,6 +688,8 @@ tt(-T) and/or tt(-D) flags can be passed to tt(compcall). The return value can be used to test if a matching tt(compctl) definition was found. It is non-zero if a tt(compctl) was found and zero otherwise. + +Note that this builtin is defined by the tt(compctl) module. ) enditem() @@ -773,7 +736,7 @@ After that the shell function tt(complete-history) will be invoked after typing control-X and TAB. The function should then generate the matches, e.g.: -example(complete-history LPAR()RPAR() { compgen -H 0 '' }) +example(complete-history LPAR()RPAR() { compadd - $historywords }) This function will complete words from the history matching the current word. diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 6b33c9a81..2220b8e45 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -706,6 +706,12 @@ for exported parameters item(tt(unique))( for arrays which keep only the first occurrence of duplicated values ) +item(tt(hide))( +for parameters with the `hide' flag +) +item(tt(special))( +for special parameters defined by the shell +) enditem() ) enditem() diff --git a/Doc/Zsh/manual.yo b/Doc/Zsh/manual.yo index c4691b89d..16a1bdec6 100644 --- a/Doc/Zsh/manual.yo +++ b/Doc/Zsh/manual.yo @@ -117,7 +117,7 @@ Zsh Modules menu(The cap Module) menu(The clone Module) -menu(The comp1 Module) +menu(The complete Module) menu(The compctl Module) menu(The complist Module) menu(The deltochar Module) @@ -130,6 +130,7 @@ menu(The sched Module) menu(The stat Module) menu(The zftp Module) menu(The zle Module) +menu(The zleparameter Module) endmenu() texinode(The Z Shell Manual)(Introduction)(Top)(Top) chapter(The Z Shell Manual) diff --git a/Doc/Zsh/mod_clone.yo b/Doc/Zsh/mod_clone.yo index 9bb7dc255..3914fffce 100644 --- a/Doc/Zsh/mod_clone.yo +++ b/Doc/Zsh/mod_clone.yo @@ -1,4 +1,4 @@ -texinode(The clone Module)(The comp1 Module)(The cap Module)(Zsh Modules) +texinode(The clone Module)(The complete Module)(The cap Module)(Zsh Modules) sect(The clone Module) The tt(clone) module makes available one builtin command: diff --git a/Doc/Zsh/mod_compctl.yo b/Doc/Zsh/mod_compctl.yo index 785767e45..b69ae1e7d 100644 --- a/Doc/Zsh/mod_compctl.yo +++ b/Doc/Zsh/mod_compctl.yo @@ -1,12 +1,12 @@ -texinode(The compctl Module)(The complist Module)(The comp1 Module)(Zsh Modules) +texinode(The compctl Module)(The complist Module)(The complete Module)(Zsh Modules) sect(The compctl Module) -The tt(compctl) module makes available several builtin commands. tt(compctl), -is the standard way to control completions for ZLE. See +The tt(compctl) module makes available two builtin commands. tt(compctl), +is the old, deprecated way to control completions for ZLE. See ifzman(zmanref(zshcompctl))\ ifnzman(noderef(Programmable Completion Using compctl))\ . -The other builtin commands can be used in user-defined completion widgets, -see +The other builtin command, tt(compcall) can be used in user-defined +completion widgets, see ifzman(zmanref(zshcompwid))\ ifnzman(noderef(Completion Widgets))\ . diff --git a/Doc/Zsh/mod_complete.yo b/Doc/Zsh/mod_complete.yo new file mode 100644 index 000000000..558bbc4ae --- /dev/null +++ b/Doc/Zsh/mod_complete.yo @@ -0,0 +1,7 @@ +texinode(The complete Module)(The compctl Module)(The clone Module)(Zsh Modules) +sect(The complete Module) +The tt(compctl) module makes available several builtin commands which +can be used in user-defined completion widgets, see +ifzman(zmanref(zshcompwid))\ +ifnzman(noderef(Completion Widgets))\ +. diff --git a/Doc/Zsh/mod_computil.yo b/Doc/Zsh/mod_computil.yo index fc1959bf1..cc0abc38e 100644 --- a/Doc/Zsh/mod_computil.yo +++ b/Doc/Zsh/mod_computil.yo @@ -12,7 +12,7 @@ completion functions. In short, these builtin commands are: startitem() item(tt(compdisplay) var(name) var(string) var(defs) ...)( -The var(defs) are strings should be of the form +The var(defs) are strings which should be of the form `var(str)tt(:)var(descr)' (the intended use is that the var(descr) describes the var(str)) and tt(compdisplay) will convert them to strings in which the colon is replaced by the var(string) given as the diff --git a/Doc/Zsh/mod_parameter.yo b/Doc/Zsh/mod_parameter.yo index 893bd03d9..0cf44d4b1 100644 --- a/Doc/Zsh/mod_parameter.yo +++ b/Doc/Zsh/mod_parameter.yo @@ -2,7 +2,7 @@ texinode(The parameter Module)(The sched Module)(The mathfunc Module)(Zsh Module sect(The parameter Module) cindex(parameters, special) The tt(parameter) module gives access to some of the internal hash -tables used by the shell, by defining four special associative arrays. +tables used by the shell by defining some special parameters. startitem() vindex(options) @@ -32,6 +32,31 @@ key in it is like defining a function with the name given by the key and the body given by the value. Unsetting a key removes the definition for the function named by the key. ) +vindex(builtins) +item(tt(builtins))( +This association gives information about the builtin commands +currently known. The keys are the names of the builtin commands and +the values are either `tt(undefined)' for builtin commands that will +automatically be loaded from a module if invoked or `tt(defined)' for +builtin commands that are already loaded. Also, the string +`tt(<disabled> )' will be prepended to the value if the builtin +command is currently disabled. +) +vindex(reswords) +item(tt(reswords))( +This association maps the reserved words to one of `tt(<enabled>)' or +`tt(<disabled>)' for enabled and disabled reserved words, respectively. +) +vindex(raliases) +item(tt(raliases))( +This maps the names of the regular aliases currently defined to their +expansions. For disabled aliases the string `tt(<disabled>)' is +prepended to their value. +) +vindex(galiases) +item(tt(galiases))( +Like tt(raliases), but for global aliases. +) vindex(parameters) item(tt(parameters))( The keys in this associative array are the names of the parameters @@ -61,4 +86,39 @@ A normal array holding the elements of the directory stack. Note that the output of the tt(dirs) builtin command includes one more directory, the current working directory. ) +vindex(history) +item(tt(history))( +This association maps history event numbers to the full history lines. +) +vindex(historywords) +item(tt(historywords))( +A special array containing the words stored in the history. +) +vindex(jobtexts) +item(tt(jobtexts))( +This association maps job numbers to the texts of the command lines +that were used to start the jobs. +) +vindex(jobstates) +item(tt(jobstates))( +This association gives information about the states of the jobs +currently known. The keys are the job numbers and the values are +strings of the form +`var(job-state):var(pid)tt(=)var(state)tt(...)'. The var(job-state) +gives the state the whole job is currently in, one of `tt(running)', +`tt(suspended)', or `tt(done)'. This is follwed by one +`var(pid)tt(=)var(state)' for every process in the job. The var(pid)s +are, of course, the process IDs and the var(state) describes the state +of that process. +) +vindex(nameddirs) +item(tt(nameddirs))( +This association maps the names of named directories to the pathnames +they stand for. +) +vindex(userdirs) +item(tt(userdirs))( +This association maps user names to the pathnames of their home +directories. +) enditem() diff --git a/Doc/Zsh/mod_zle.yo b/Doc/Zsh/mod_zle.yo index 95aa27535..a346ab279 100644 --- a/Doc/Zsh/mod_zle.yo +++ b/Doc/Zsh/mod_zle.yo @@ -1,4 +1,4 @@ -texinode(The zle Module)()(The zftp Module)(Zsh Modules) +texinode(The zle Module)(The zleparameter Module)(The zftp Module)(Zsh Modules) sect(The zle Module) The tt(zle) module contains the Zsh Line Editor. See ifzman(zmanref(zshzle))\ diff --git a/Doc/Zsh/mod_zleparameter.yo b/Doc/Zsh/mod_zleparameter.yo new file mode 100644 index 000000000..cf79668e4 --- /dev/null +++ b/Doc/Zsh/mod_zleparameter.yo @@ -0,0 +1,28 @@ +texinode(The zleparameter Module)()(The zle Module)(Zsh Modules) +sect(The zleparameter Module) +cindex(parameters, special) +The tt(zleparameter) module defines two special parameters that can be +used to access internal information of the Zsh Line Editor (see +ifzman(zmanref(zshzle))\ +ifnzman(noderef(Zsh Line Editor))\ +). + +startitem() +vindex(zlekeymaps) +item(tt(zlekeymaps))( +This array contains the names of the keymaps currently defined. +) +vindex(zlewidgets) +item(tt(zlewidgets))( +This associative array contains one entry per widget defined. The name +of the widget is the key and the value gives information about the +widget. It is either the string `tt(builtin)' for builtin widgets, a +string of the form `tt(user:)var(name)' for user-defined widgets, +where var(name) is the name of the shell function implementing the +widget, or it is a string of the form +`tt(completion:)var(type)tt(:)var(name)', for completion widgets. In +the last case var(type) is the name of the builtin widgets the +completion widget imitates in its behavior and var(name) is the name +of the shell function implementing the completion widget. +) +enditem() diff --git a/Doc/Zsh/modules.yo b/Doc/Zsh/modules.yo index b06edfda2..9ce81c264 100644 --- a/Doc/Zsh/modules.yo +++ b/Doc/Zsh/modules.yo @@ -15,9 +15,6 @@ Builtins for manipulating POSIX.1e (POSIX.6) capability (privilege) sets. item(tt(clone))( A builtin that can clone a running shell onto another terminal. ) -item(tt(comp1))( -Base of the completion system. Used by the tt(compctl) and tt(zle) modules. -) item(tt(compctl))( The tt(compctl) builtin for controlling completion and the builtins for completion widgets. @@ -59,11 +56,14 @@ A builtin FTP client. item(tt(zle))( The Zsh Line Editor, including the tt(bindkey) and tt(vared) builtins. ) +item(tt(zleparameter))( +Access to internals of the Zsh Line Editor via parameters. +) enditem() startmenu() menu(The cap Module) menu(The clone Module) -menu(The comp1 Module) +menu(The complete Module) menu(The compctl Module) menu(The complist Module) menu(The computil Module) @@ -77,10 +77,11 @@ menu(The sched Module) menu(The stat Module) menu(The zftp Module) menu(The zle Module) +menu(The zleparameter Module) endmenu() includefile(Zsh/mod_cap.yo) includefile(Zsh/mod_clone.yo) -includefile(Zsh/mod_comp1.yo) +includefile(Zsh/mod_complete.yo) includefile(Zsh/mod_compctl.yo) includefile(Zsh/mod_complist.yo) includefile(Zsh/mod_computil.yo) @@ -94,3 +95,4 @@ includefile(Zsh/mod_sched.yo) includefile(Zsh/mod_stat.yo) includefile(Zsh/mod_zftp.yo) includefile(Zsh/mod_zle.yo) +includefile(Zsh/mod_zleparameter.yo) |