diff options
Diffstat (limited to 'Doc/Zsh/compwid.yo')
-rw-r--r-- | Doc/Zsh/compwid.yo | 354 |
1 files changed, 177 insertions, 177 deletions
diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index bc72926ca..33d850f9e 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -70,23 +70,12 @@ within the completion widget) to the values they had when the function was entered. startitem() -vindex(words) -item(tt(words))( -This array contains the words present on the command line currently being -edited. -) vindex(CURRENT) item(tt(CURRENT))( This is the number of the current word, i.e. the word the cursor is currently on in the tt(words) array. Note that this value is only correct if the tt(ksharrays) options is not set. ) -vindex(PREFIX) -item(tt(PREFIX))( -Initially this will be set to the part of the current word from the -beginning of the word up to the position of the cursor; it may be altered -to give a common prefix for all matches. -) vindex(IPREFIX) item(tt(IPREFIX))( Initially this will be set to the empty string. This parameter functions @@ -102,6 +91,18 @@ causes the part of the prefix up to and including the first equal sign not to be treated as part of a matched string. This can be done automatically by the tt(compset) builtin, see below. ) +vindex(ISUFFIX) +item(tt(ISUFFIX))( +As tt(IPREFIX), but for a suffix that should not be considered part +of the matches; note that the tt(ISUFFIX) string follows the tt(SUFFIX) +string. +) +vindex(PREFIX) +item(tt(PREFIX))( +Initially this will be set to the part of the current word from the +beginning of the word up to the position of the cursor; it may be altered +to give a common prefix for all matches. +) vindex(QIPREFIX) item(tt(QIPREFIX))( This parameter is read-only and contains the quoted string up to the @@ -110,6 +111,10 @@ contains the double quote. If the tt(-q) option of tt(compset) is used (see below), and the original string was `tt("foo bar)' with the cursor on the `tt(bar)', this parameter contains `tt("foo )'. ) +vindex(QISUFFIX) +item(tt(QISUFFIX))( +Like tt(QIPREFIX), but containing the suffix. +) vindex(SUFFIX) item(tt(SUFFIX))( Initially this will be set to the part of the current word from the @@ -118,16 +123,6 @@ all matches. It is most useful when the option tt(COMPLETE_IN_WORD) is set, as otherwise the whole word on the command line is treated as a prefix. ) -vindex(ISUFFIX) -item(tt(ISUFFIX))( -As tt(IPREFIX), but for a suffix that should not be considered part -of the matches; note that the tt(ISUFFIX) string follows the tt(SUFFIX) -string. -) -vindex(QISUFFIX) -item(tt(QISUFFIX))( -Like tt(QIPREFIX), but containing the suffix. -) vindex(compstate) cindex(completion widgets, examining and setting state in) item(tt(compstate))( @@ -136,19 +131,37 @@ completion code uses to exchange information with the completion widget. The keys are: startitem() +vindex(all_quotes, compstate) +item(tt(all_quotes))( +The tt(-q) option of the tt(compset) builtin command (see below) +allows a quoted string to be broken into separate words; if the cursor is +on one of those words, that word will be completed, possibly invoking +`tt(compset -q)' recursively. With this key it is possible to test the +types of quoted strings which are currently broken into parts in this +fashion. Its value contains one character for each quoting level. The +characters are a single quote or a double quote for strings quoted with +these characters and a backslash for strings not starting with a quote +character. The first character in the value always corresponds to the +innermost quoting level. +) vindex(context, compstate) item(tt(context))( This will be set by the completion code to the overall context in which completion is attempted. Possible values are: startitem() +item(tt(array_value))( +when completing inside the value of an array parameter assignment; in +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(${). +) item(tt(command))( when completing for a normal command (either in command position or for an argument of the command). ) -item(tt(redirect))( -when completing after a redirection operator. -) item(tt(condition))( when completing inside a `tt([[)...tt(]])' conditional expression; in this case the tt(words) array contains only the words inside the @@ -158,73 +171,33 @@ item(tt(math))( when completing in a mathematical environment such as a `tt(LPAR()LPAR())...tt(RPAR()RPAR())' construct. ) -item(tt(value))( -when completing the value of a parameter assignment. -) -item(tt(array_value))( -when completing inside the value of an array parameter assignment; in -this case the tt(words) array contains the words inside the parentheses. -) -item(tt(subscript))( -when completing inside a parameter subscript. -) item(tt(parameter))( when completing the name of a parameter in a parameter expansion beginning with tt($) but not tt(${). ) -item(tt(brace_parameter))( -when completing the name of a parameter in a parameter expansion beginning -with tt(${). -) -enditem() -) -vindex(vared, compstate) -item(tt(vared))( -If completion is called while editing a line using the tt(vared) -builtin, the value of this key is set to the name of the parameter -given as argument to tt(vared). This key is only set while a tt(vared) -command is active. -) -vindex(parameter, compstate) -item(tt(parameter))( -The name of the parameter when completing in a subscript or in the -value of a parameter assignment. -) -vindex(redirect, compstate) item(tt(redirect))( -The redirection operator when completing in a redirection position, -i.e. one of tt(<), tt(>), etc. +when completing after a redirection operator. ) -vindex(quoting, compstate) -item(tt(quoting))( -When completing inside single quotes, this is set to the string -tt(single); inside double quotes, the string -tt(double); inside backticks, the string tt(backtick). -Otherwise it is unset. +item(tt(subscript))( +when completing inside a parameter subscript. ) -vindex(quote, compstate) -item(tt(quote))( -When completing inside quotes, this contains the quotation character -(i.e. either a single quote, a double quote, or a backtick). Otherwise it -is unset. +item(tt(value))( +when completing the value of a parameter assignment. ) -vindex(all_quotes, compstate) -item(tt(all_quotes))( -The tt(-q) option of the tt(compset) builtin command (see below) -allows a quoted string to be broken into separate words; if the cursor is -on one of those words, that word will be completed, possibly invoking -`tt(compset -q)' recursively. With this key it is possible to test the -types of quoted strings which are currently broken into parts in this -fashion. Its value contains one character for each quoting level. The -characters are a single quote or a double quote for strings quoted with -these characters and a backslash for strings not starting with a quote -character. The first character in the value always corresponds to the -innermost quoting level. +enditem() ) -vindex(nmatches, compstate) -item(tt(nmatches))( -The number of matches generated and accepted by the completion code so -far. +vindex(exact, compstate) +item(tt(exact))( +Controls the behaviour when the tt(REC_EXACT) option is set. It will be +set to tt(accept) if an exact match would be accepted, and will be unset +otherwise. + +If it was set when at least one match equal to the string on the line +was generated, the match is accepted. +) +vindex(exact_string, compstate) +item(tt(exact_string))( +The string of an exact match if one was found, otherwise unset. ) vindex(ignored, compstate) item(tt(ignored))( @@ -232,13 +205,47 @@ The number of words that were ignored because they matched one of the patterns given with the tt(-F) option to the tt(compadd) builtin command. ) -vindex(restore, compstate) -item(tt(restore))( -This is set to tt(auto) before a function is entered, which forces the -special parameters mentioned above (tt(words), tt(CURRENT), tt(PREFIX), -tt(IPREFIX), tt(SUFFIX), and tt(ISUFFIX)) to be restored to their -previous values when the function exits. If a function unsets it or -sets it to any other string, they will not be restored. +vindex(insert, compstate) +item(tt(insert))( +This controls the manner in which a match is inserted into the command +line. On entry to the widget function, if it is unset the command line is +not to be changed; if set to tt(unambiguous), any prefix common to all +matches is to be inserted; if set to tt(automenu-unambiguous), the +common prefix is to be inserted and the next invocation of the +completion code may start menucompletion (due to the tt(AUTO_MENU) +option being set); if set to tt(menu) or tt(automenu) menucompletion +will be started for the matches currently generated (in the +latter case this will happen because the tt(AUTO_MENU) is set). The +value may also contain the string `tt(tab)' when the completion code +would normally not really do completion, but only insert the TAB +character. + +On exit it may be set to any of the values above (where setting it to +the empty string is the same as unsetting it), or to a number, in which +case the match whose number is given will be inserted into the command line. +Negative numbers count backward from the last match (with `tt(-1)' +selecting the last match) and out-of-range values are wrapped +around, so that a value of zero selects the last match and a value +one more than the maximum selects the first. Unless the value of this +key ends in a space, the match is inserted as in a menucompletion, +i.e. without automatically appending a space. + +Both tt(menu) and tt(automenu) may also specify the the number of the +match to insert, given after a colon. For example, `tt(menu:2)' says +to start menucompletion, beginning with the second match. + +Note that a value containing the substring `tt(tab)' makes the +matches generated be ignored and only the TAB be inserted. + +Finally, it may also be set to tt(all), which makes all matches +generated be inserted into the line. +) +vindex(last_prompt, compstate) +item(tt(last_prompt))( +If this is set to an non-empty string for every match added, the +completion code will move the cursor back to the previous prompt after +the list of completions has been displayed. Initially this is set or +unset according to the tt(ALWAYS_LAST_PROMPT) option. ) vindex(list, compstate) item(tt(list))( @@ -266,12 +273,6 @@ tt(messages) both kinds of explanation strings will be listed. It will be set appropriately on entry to a completion widget and may be changed there. ) -vindex(list_max, compstate) -item(tt(list_max))( -Initially this is set to the value of the tt(LISTMAX) parameter. -It may be set to any other value; when the widget exits this value -will be used in the same way as the value of tt(LISTMAX). -) vindex(list_lines, compstate) item(tt(list_lines))( This gives the number of lines that are needed to display the full @@ -280,61 +281,28 @@ to display you need to add the number of lines needed for the command line to this value, this is available as the value of the tt(BUFFERLINES) special parameter. ) -vindex(last_prompt, compstate) -item(tt(last_prompt))( -If this is set to an non-empty string for every match added, the -completion code will move the cursor back to the previous prompt after -the list of completions has been displayed. Initially this is set or -unset according to the tt(ALWAYS_LAST_PROMPT) option. +vindex(list_max, compstate) +item(tt(list_max))( +Initially this is set to the value of the tt(LISTMAX) parameter. +It may be set to any other value; when the widget exits this value +will be used in the same way as the value of tt(LISTMAX). ) -vindex(insert, compstate) -item(tt(insert))( -This controls the manner in which a match is inserted into the command -line. On entry to the widget function, if it is unset the command line is -not to be changed; if set to tt(unambiguous), any prefix common to all -matches is to be inserted; if set to tt(automenu-unambiguous), the -common prefix is to be inserted and the next invocation of the -completion code may start menucompletion (due to the tt(AUTO_MENU) -option being set); if set to tt(menu) or tt(automenu) menucompletion -will be started for the matches currently generated (in the -latter case this will happen because the tt(AUTO_MENU) is set). The -value may also contain the string `tt(tab)' when the completion code -would normally not really do completion, but only insert the TAB -character. - -On exit it may be set to any of the values above (where setting it to -the empty string is the same as unsetting it), or to a number, in which -case the match whose number is given will be inserted into the command line. -Negative numbers count backward from the last match (with `tt(-1)' -selecting the last match) and out-of-range values are wrapped -around, so that a value of zero selects the last match and a value -one more than the maximum selects the first. Unless the value of this -key ends in a space, the match is inserted as in a menucompletion, -i.e. without automatically appending a space. - -Both tt(menu) and tt(automenu) may also specify the the number of the -match to insert, given after a colon. For example, `tt(menu:2)' says -to start menucompletion, beginning with the second match. - -Note that a value containing the substring `tt(tab)' makes the -matches generated be ignored and only the TAB be inserted. - -Finally, it may also be set to tt(all), which makes all matches -generated be inserted into the line. +vindex(nmatches, compstate) +item(tt(nmatches))( +The number of matches generated and accepted by the completion code so +far. ) -vindex(to_end, compstate) -item(tt(to_end))( -Specifies the occasions on which the cursor is moved to the end of a string -when a match is inserted. On entry to a widget function, it may be -tt(single) if this will happen when a single unambiguous match was inserted -or tt(match) if it will happen any time a match is inserted (for example, -by menucompletion; this is likely to be the effect of the tt(ALWAYS_TO_END) -option). +vindex(old_insert, compstate) +item(tt(old_insert))( +On entry to the widget this will be set to the number of the match of +an old list of completions that is currently inserted into the command +line. If no match has been inserted, this is unset. -On exit, it may be set to tt(single) as above. It may also be set to -tt(always), or to the empty string or unset; in those cases the cursor will -be moved to the end of the string always or never respectively. Any -other string is treated as tt(match). +As with tt(old_list), the value of this key will only be used if it is the +string tt(keep). If it was set to this value by the widget and there was an +old match inserted into the command line, this match will be kept and if +the value of the tt(insert) key specifies that another match should be +inserted, this will be inserted after the old one. ) vindex(old_list, compstate) item(tt(old_list))( @@ -350,30 +318,18 @@ was set to tt(keep). In this case the completion code will continue to use this old list. If the widget generated new matches, they will not be used. ) -vindex(old_insert, compstate) -item(tt(old_insert))( -On entry to the widget this will be set to the number of the match of -an old list of completions that is currently inserted into the command -line. If no match has been inserted, this is unset. - -As with tt(old_list), the value of this key will only be used if it is the -string tt(keep). If it was set to this value by the widget and there was an -old match inserted into the command line, this match will be kept and if -the value of the tt(insert) key specifies that another match should be -inserted, this will be inserted after the old one. -) -vindex(exact, compstate) -item(tt(exact))( -Controls the behaviour when the tt(REC_EXACT) option is set. It will be -set to tt(accept) if an exact match would be accepted, and will be unset -otherwise. - -If it was set when at least one match equal to the string on the line -was generated, the match is accepted. +vindex(parameter, compstate) +item(tt(parameter))( +The name of the parameter when completing in a subscript or in the +value of a parameter assignment. ) -vindex(exact_string, compstate) -item(tt(exact_string))( -The string of an exact match if one was found, otherwise unset. +vindex(pattern_insert, compstate) +item(tt(pattern_insert))( +Normally this is set to tt(menu), which specifies that menucompletion will +be used whenever a set of matches was generated using pattern matching. If +it is set to any other non-empty string by the user and menucompletion is +not selected by other option settings, the code will instead insert any +common prefix for the generated matches as with normal completion. ) vindex(pattern_match, compstate) item(tt(pattern_match))( @@ -389,13 +345,45 @@ it is empty or unset, metacharacters will be treated literally. Note that the matcher specifications given to the tt(compadd) builtin command are not used if this is set to a non-empty string. ) -vindex(pattern_insert, compstate) -item(tt(pattern_insert))( -Normally this is set to tt(menu), which specifies that menucompletion will -be used whenever a set of matches was generated using pattern matching. If -it is set to any other non-empty string by the user and menucompletion is -not selected by other option settings, the code will instead insert any -common prefix for the generated matches as with normal completion. +vindex(quote, compstate) +item(tt(quote))( +When completing inside quotes, this contains the quotation character +(i.e. either a single quote, a double quote, or a backtick). Otherwise it +is unset. +) +vindex(quoting, compstate) +item(tt(quoting))( +When completing inside single quotes, this is set to the string +tt(single); inside double quotes, the string +tt(double); inside backticks, the string tt(backtick). +Otherwise it is unset. +) +vindex(redirect, compstate) +item(tt(redirect))( +The redirection operator when completing in a redirection position, +i.e. one of tt(<), tt(>), etc. +) +vindex(restore, compstate) +item(tt(restore))( +This is set to tt(auto) before a function is entered, which forces the +special parameters mentioned above (tt(words), tt(CURRENT), tt(PREFIX), +tt(IPREFIX), tt(SUFFIX), and tt(ISUFFIX)) to be restored to their +previous values when the function exits. If a function unsets it or +sets it to any other string, they will not be restored. +) +vindex(to_end, compstate) +item(tt(to_end))( +Specifies the occasions on which the cursor is moved to the end of a string +when a match is inserted. On entry to a widget function, it may be +tt(single) if this will happen when a single unambiguous match was inserted +or tt(match) if it will happen any time a match is inserted (for example, +by menucompletion; this is likely to be the effect of the tt(ALWAYS_TO_END) +option). + +On exit, it may be set to tt(single) as above. It may also be set to +tt(always), or to the empty string or unset; in those cases the cursor will +be moved to the end of the string always or never respectively. Any +other string is treated as tt(match). ) vindex(unambiguous, compstate) item(tt(unambiguous))( @@ -409,8 +397,20 @@ common prefix in the tt(unambiguous) key were inserted, relative to the value of that key. The cursor would be placed before the character whose index is given by this key. ) +vindex(vared, compstate) +item(tt(vared))( +If completion is called while editing a line using the tt(vared) +builtin, the value of this key is set to the name of the parameter +given as argument to tt(vared). This key is only set while a tt(vared) +command is active. +) enditem() ) +vindex(words) +item(tt(words))( +This array contains the words present on the command line currently being +edited. +) enditem() texinode(Builtin Commands)(Condition Codes)(Special Parameters)(Completion Widgets) |