From bd06982b2354083db139b3ca65f999717a0c0b9c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 15 Mar 2016 00:06:48 +0000 Subject: 38155: docs: compsys: Clarify documentation of the 'filter' style. --- Doc/Zsh/compsys.yo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 2aa0740b8..d478e818e 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1554,7 +1554,8 @@ of the links themselves. ) kindex(filter, completion style) item(tt(filter))( -This is used by the LDAP plugin for e-mail address completion to specify +The tt(ldap) plugin of email address completion (see tt(_email_addresses)) uses +this style to specify the attributes to match against when filtering entries. So for example, if the style is set to `tt(sn)', matching is done against surnames. Standard LDAP filtering is used so normal completion matching is bypassed. If this -- cgit v1.2.3 From 21d4b4cc0ec21e204210328b63c1303c7dcfd702 Mon Sep 17 00:00:00 2001 From: Marko Myllynen Date: Tue, 10 May 2016 19:19:01 +0900 Subject: 38458: mention the option -i of _multi_parts --- ChangeLog | 5 +++++ Doc/Zsh/compsys.yo | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index cb0aa41bb..b5039a5bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-03-10 Jun-ichi Takimoto + + * Marko Myllynen: 38458: Doc/Zsh/compsys.yo: mention the option + -i of _multi_parts + 2016-05-09 Barton E. Schaefer * Jun T.: 38445 (+tweak): Test/C02cond.ztst: subsequent tests rely diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index d478e818e..203c436a5 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4416,7 +4416,7 @@ the time this function is called, tt(compstate[insert]) is cleared, so additional matches generated later are not inserted on the command line. ) findex(_multi_parts) -item(tt(_multi_parts) var(sep) var(array))( +item(tt(_multi_parts) [ tt(-i) ] var(sep) var(array))( The argument var(sep) is a separator character. The var(array) may be either the name of an array parameter or a literal array in the form -- cgit v1.2.3 From ac3173be90442033183877e65419393fd1d4e56b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 3 Jun 2016 20:50:20 +0000 Subject: 38593: _describe: Make documentation more greppable. Make the running text refer to the parameters using their names given in the signature. This enables the reader to search for the name given in the signature. --- ChangeLog | 5 +++++ Doc/Zsh/compsys.yo | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 767af7991..af433876c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-06-04 Daniel Shahaf + + * 38593: Doc/Zsh/compsys.yo: _describe: Make documentation + more greppable. + 2016-06-04 Barton E. Schaefer * 38599: Src/subst.c: skip the "no such named directory" warning diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 203c436a5..c97f80f27 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4227,13 +4227,13 @@ different completion options var(opt)s. The var(descr) is taken as a string to display above the matches if the tt(format) style for the tt(descriptions) tag is set. This is followed by one or two names of arrays followed by options to pass to tt(compadd). The -first array contains the possible completions with their descriptions in +array var(name1) contains the possible completions with their descriptions in the form `var(completion)tt(:)var(description)'. Any literal colons in -var(completion) must be quoted with a backslash. If a second array is -given, it should have the same number of elements as the first; in this +var(completion) must be quoted with a backslash. If a var(name2) is +given, it should have the same number of elements as var(name1); in this case the corresponding elements are added as possible completions instead -of the var(completion) strings from the first array. The completion list -will retain the descriptions from the first array. Finally, a set of +of the var(completion) strings from var(name1). The completion list +will retain the descriptions from var(name1). Finally, a set of completion options can appear. If the option `tt(-o)' appears before the first argument, the matches added -- cgit v1.2.3 From e83489fc4ba168abeb5ea7e23e64383fed181ed3 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 22 Jun 2016 01:37:07 +0200 Subject: 38714: add x: syntax to match specs to make it possible to disable match specs hardcoded in completion functions --- ChangeLog | 4 ++++ Doc/Zsh/compsys.yo | 5 +++-- Doc/Zsh/compwid.yo | 7 +++++++ Src/Zle/complete.c | 10 ++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 3c722b79d..d352067e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-06-22 Oliver Kiddle + * 38714: Src/Zle/complete.c, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo: add x: syntax to match specs to make it + possible to disable match specs hardcoded in completion functions + * 38735: Completion/Unix/Command/_find, Completion/Zsh/Type/_globquals: support verbose style to allow clearer but less compact descriptions for time specifiers diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index c97f80f27..fb0abcef3 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -2023,8 +2023,9 @@ only be performed with the `tt(*)' inserted. kindex(matcher, completion style) item(tt(matcher))( This style is tested separately for each tag valid in the current -context. Its value is tried before any match specifications given by the -tt(matcher-list) style. It should be in the form described in +context. Its value is placed before any match specifications given by the +tt(matcher-list) style so can override them via the use of an tt(x:) +specification. The value should be in the form described in ifzman(the section `Completion Matching Control' in zmanref(zshcompwid))\ ifnzman(noderef(Completion Matching Control))\ . For examples of this, see the description of the tt(tag-order) style. diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index c01763316..1cc94bf95 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -913,6 +913,13 @@ line and trial completion patterns are anchored on the right side. Here an empty var(ranchor) and the tt(e) and tt(E) forms force the match to the end of the command line or trial completion string. ) +item(tt(x:))( +This form is used to mark the end of matching specifications: +subsequent specifications are ignored. In a single standalone list +of specifications this has no use but where matching specifications +are accumulated, such as from nested function calls, it can allow one +function to override another. +) enditem() Each var(lpat), var(tpat) or var(anchor) is either an empty string or diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index 30fab541a..0c14d86d5 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -241,6 +241,7 @@ parse_cmatcher(char *name, char *s) case 'E': fl2 = CMF_INTER; case 'R': fl = CMF_RIGHT | CMF_LINE; break; case 'M': fl = CMF_LINE; break; + case 'x': break; default: if (name) zwarnnam(name, "unknown match specification character `%c'", @@ -252,6 +253,15 @@ parse_cmatcher(char *name, char *s) zwarnnam(name, "missing `:'"); return pcm_err; } + if (*s == 'x') { + if (s[2] && !inblank(s[2])) { + if (name) + zwarnnam(name, + "unexpected pattern following x: specification"); + return pcm_err; + } + return ret; + } s += 2; if (!*s) { if (name) -- cgit v1.2.3 From fc286168edac8c0b5fb9e8ec6226d4c77bcde79f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 8 Jul 2016 22:21:42 +0200 Subject: unposted: fix duplicated words --- ChangeLog | 5 +++++ Doc/Zsh/builtins.yo | 4 ++-- Doc/Zsh/compsys.yo | 2 +- Doc/Zsh/options.yo | 2 +- Doc/Zsh/zle.yo | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 27ce01dd4..e1b5bd524 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-07-08 Oliver Kiddle + + * unposted: Doc/Zsh/builtins.yo, Doc/Zsh/compsys.yo, + Doc/Zsh/options.yo, Doc/Zsh/zle.yo: fix duplicated words + 2016-07-08 Peter Stephenson * 38796: Functions/Zle/match-words-by-style: fix subword diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 5c33cd1cf..ac4441c64 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -656,7 +656,7 @@ An EOF condition will also cause the shell to exit, unless the tt(IGNORE_EOF) option is set. See notes at the end of -ifzman(the section JOBS in in zmanref(zshmisc))\ +ifzman(the section JOBS in zmanref(zshmisc))\ ifnzman(noderef(Jobs & Signals)) for some possibly unexpected interactions of the tt(exit) command with jobs. ) @@ -697,7 +697,7 @@ specifies the most recent event beginning with the given string. All substitutions var(old)tt(=)var(new), if any, are then performed on the text of the events. -In addition to the the number range, +In addition to the number range, startsitem() sitem(tt(-I))(restricts to only internal events (not from tt($HISTFILE))) sitem(tt(-L))(restricts to only local events (not from other shells, see diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index fb0abcef3..8792324e5 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3817,7 +3817,7 @@ form below, the var(action) will be executed by calling the tt(_all_labels) function to process all tag labels. No special handling of tags is needed unless a function call introduces a new one. -The functions called to execute var(action)s will be called with the the +The functions called to execute var(action)s will be called with the elements of the array named by the `tt(-O) var(name)' option as arguments. This can be used, for example, to pass the same set of options for the tt(compadd) builtin to all var(action)s. diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 0eaaecae3..f68a945ec 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1598,7 +1598,7 @@ skipped. The option is restored after the trap exits. Exiting due to tt(ERR_EXIT) has certain interactions with asynchronous jobs noted in -ifzman(the section JOBS in in zmanref(zshmisc))\ +ifzman(the section JOBS in zmanref(zshmisc))\ ifnzman(noderef(Jobs & Signals)). ) pindex(ERR_RETURN) diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 1bae0ccf7..f51eadac5 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -896,7 +896,7 @@ vindex(MARK) item(tt(MARK) (integer))( Like tt(CURSOR), but for the mark. With vi-mode operators that wait for a movement command to select a region of text, setting tt(MARK) allows -the selection to extend in both directions from the the initial cursor +the selection to extend in both directions from the initial cursor position. ) vindex(NUMERIC) -- cgit v1.2.3 From 73ff356d7b4cb49861a420b2465ac731f29f9f1b Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 22 Jul 2016 06:30:08 +0000 Subject: 38911: _arguments: Clarify documentation of '-s -w' switch --- ChangeLog | 5 +++++ Doc/Zsh/compsys.yo | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 83788121d..1d67af1a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-07-23 Daniel Shahaf + + * 38911: Doc/Zsh/compsys.yo: _arguments: Clarify documentation of + '-s -w' switch + 2016-07-23 Barton E. Schaefer * 38923 (plus expanded comment): Src/jobs.c: zwaitjob() continues diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 8792324e5..a50df999d 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3591,8 +3591,9 @@ even if one or more of the options take arguments. For example, if tt(-x) takes an argument, with no tt(-s), `tt(-xy)' is considered as a single (unhandled) option; with tt(-s), tt(-xy) is an option with the argument `tt(y)'; with both tt(-s) -and tt(-w), tt(-xy) may be the option tt(-x) and the option tt(-y) with -arguments still to come. +and tt(-w), tt(-xy) is the option tt(-x) and the option tt(-y) with +arguments to tt(-x) (and to tt(-y), if it takes arguments) still to come +in subsequent words. ) item(tt(-W))( This option takes tt(-w) a stage further: it is possible to -- cgit v1.2.3 From 8d71a610af2a054e555cb2b97666e18f1964fdd6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 28 Jul 2016 05:25:31 +0000 Subject: 38959: Document 38956 (_widgets). --- ChangeLog | 4 ++++ Doc/Zsh/compsys.yo | 10 ++++++++++ 2 files changed, 14 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index ed7de5c4f..970d3e423 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-07-31 Daniel Shahaf + + * 38959: Doc/Zsh/compsys.yo: Document 38956 (_widgets). + 2016-07-29 Daniel Shahaf * unposted: Completion/Unix/Command/_subversion: _svnadmin: diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index a50df999d..41864f813 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -5046,6 +5046,16 @@ Like tt(_tags) this function supports the tt(-C) option to give a different name for the argument context field. The tt(-x) option has the same meaning as for tt(_description). ) +findex(_widgets) +item(tt(_widgets) [ tt(-g) var(pattern) ])( +This function completes names of zle widgets (see +ifzman(the section `Widgets' in zmanref(zshzle))\ +ifnzman(noderef(Zle Widgets))\ +). The var(pattern), if present, is matched against values of the tt($widgets) +special parameter, documented in +ifzman(the section `The zsh/zleparameter Module' in zmanref(zshmodules))\ +ifnzman(noderef(The zsh/zleparameter Module)). +) enditem() texinode(Completion Directories)()(Completion Functions)(Completion System) -- cgit v1.2.3 From 0aa6bfd831706bc01a95af97963b702f4e6ff66c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 16 Aug 2016 22:48:41 +0000 Subject: 39044 (in part, see thread): Document _canonical_paths in the manual, too. This mostly copy-pastes the source code comments and adds markup, however, the positional arguments are now annotated optional, and a ')' was added. --- ChangeLog | 5 +++++ Doc/Zsh/compsys.yo | 15 +++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index fbf93064a..e899bdaaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-08-18 Daniel Shahaf + + * 39044 (in part, see thread): Doc/Zsh/compsys.yo: Document + _canonical_paths in the manual, too. + 2016-08-15 Peter Stephenson * 39039: Doc/Zsh/zle.yo: fix documentation for transpose-words. diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 41864f813..8c7ef0f5a 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -2978,6 +2978,21 @@ widgets to find out if the command line hasn't changed since the last time completion was tried. Only then are the tt(_ignored), tt(_correct) and tt(_approximate) completers called. ) +findex(_canonical_paths) +item(tt(_canonical_paths) [ tt(-A) var(var) ] [ tt(-N) ] [ tt(-MJV12nfX) ] var(tag) var(descr) [ var(paths) ... ])( +This completion function completes all paths given to it, and also tries to +offer completions which point to the same file as one of the paths given +(relative path when an absolute path is given, and vice versa; when tt(..)'s +are present in the word to be completed; and some paths got from symlinks). + +tt(-A), if specified, takes the paths from the array variable specified. Paths can +also be specified on the command line as shown above. tt(-N), if specified, +prevents canonicalizing the paths given before using them for completion, in +case they are already so. The options tt(-M), tt(-J), tt(-V), tt(-1), tt(-2), +tt(-n), tt(-F), tt(-X) are passed to tt(compadd). + +See tt(_description) for a description of var(tag) and var(descr). +) findex(_complete) item(tt(_complete))( This completer generates all possible completions in a context-sensitive -- cgit v1.2.3 From 73c0e8d4e679ed681acc4883234324c7676cc676 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 4 Sep 2016 18:26:32 +0000 Subject: 39173: _arguments: Escape colons and backslashes in $opt_args unambiguously. --- ChangeLog | 4 ++++ Doc/Zsh/compsys.yo | 6 ++++-- README | 9 +++++++++ Src/Zle/computil.c | 12 +++++++++--- 4 files changed, 26 insertions(+), 5 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index be821de99..4643eda77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-09-06 Daniel Shahaf + * 39173: Doc/Zsh/compsys.yo, README, Src/Zle/computil.c: + _arguments: Escape colons and backslashes in $opt_args + unambiguously. + * 39171: Completion/Unix/Command/_libvirt: Apply $opt_args-unescaping. diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 8c7ef0f5a..b2cc39268 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3948,8 +3948,10 @@ command line after the command name excluding all options and their arguments. Options are stored in the associative array `tt(opt_args)' with option names as keys and their arguments as the values. For options that have more than one argument these are -given as one string, separated by colons. All colons in the original -arguments are preceded with backslashes. +given as one string, separated by colons. All colons and backslashes +in the original arguments are preceded with backslashes. (Note: +Zsh 5.2 and older did not escape backslashes in the original string; +see the tt(NEWS) file for details.) The parameter `tt(context)' is set when returning to the calling function to perform an action of the form `tt(->)var(string)'. It is set to an diff --git a/README b/README index 9de5eb4a9..019294e4b 100644 --- a/README +++ b/README @@ -87,6 +87,15 @@ The "f" qualifier has for many years been the documented way of testing file modes; it allows the "and" test ("*(f+1)" is the documented equivalent of "*(1)") as well as many other forms. +5) The completion helper function _arguments now escapes both backslashes +and colons in the values of option arguments when populating the $opt_args +associative array. Previously, colons were escaped with a backslash but +backslashes were not themselves escaped with a backslash, which lead to +ambiguity: if the -x option took two arguments (as in + _arguments : -x:foo:${action}:bar:$action +), it would be impossible to tell from $opt_args whether the command-line +was '-x foo\:bar' or '-x foo\\ bar'. + Incompatibilities between 5.0.8 and 5.2 --------------------------------------- diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index ecfa2bc34..1c90a543a 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2310,7 +2310,10 @@ ca_parse_line(Cadef d, int multi, int first) return 0; } -/* Build a colon-list from a list. */ +/* Build a colon-list from a list. + * + * This is only used to populate values of $opt_args. + */ static char * ca_colonlist(LinkList l) @@ -2320,16 +2323,19 @@ ca_colonlist(LinkList l) int len = 0; char *p, *ret, *q; + /* Compute the length to be allocated. */ for (n = firstnode(l); n; incnode(n)) { len++; for (p = (char *) getdata(n); *p; p++) - len += (*p == ':' ? 2 : 1); + len += (*p == ':' || *p == '\\') ? 2 : 1; } ret = q = (char *) zalloc(len); + /* Join L into RET, joining with colons and escaping colons and + * backslashes. */ for (n = firstnode(l); n;) { for (p = (char *) getdata(n); *p; p++) { - if (*p == ':') + if (*p == ':' || *p == '\\') *q++ = '\\'; *q++ = *p; } -- cgit v1.2.3 From 73622ae2880a599ad7ed84d43538c34cf55a48ca Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 8 Sep 2016 11:01:15 +0000 Subject: 39236 (plus typo fix): docs: Tweak _arguments $opt_args documentation added in 39173. --- ChangeLog | 5 +++++ Doc/Zsh/compsys.yo | 4 +--- README | 11 ++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index a45011ed3..2651b7343 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-09-08 Daniel Shahaf + + * 39236 (plus typo fix): Doc/Zsh/compsys.yo, README: docs: Tweak + _arguments $opt_args documentation added in 39173. + 2016-09-08 Peter Stephenson * 39222: Test/V01zmodload.ztst: test use of module loaded math diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index b2cc39268..ecf17e728 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3949,9 +3949,7 @@ arguments. Options are stored in the associative array `tt(opt_args)' with option names as keys and their arguments as the values. For options that have more than one argument these are given as one string, separated by colons. All colons and backslashes -in the original arguments are preceded with backslashes. (Note: -Zsh 5.2 and older did not escape backslashes in the original string; -see the tt(NEWS) file for details.) +in the original arguments are preceded with backslashes. The parameter `tt(context)' is set when returning to the calling function to perform an action of the form `tt(->)var(string)'. It is set to an diff --git a/README b/README index 019294e4b..d146d4b16 100644 --- a/README +++ b/README @@ -91,10 +91,15 @@ equivalent of "*(1)") as well as many other forms. and colons in the values of option arguments when populating the $opt_args associative array. Previously, colons were escaped with a backslash but backslashes were not themselves escaped with a backslash, which lead to -ambiguity: if the -x option took two arguments (as in +ambiguity: '-x foo\:bar' (one argument with a backslashed colon) and +'-x foo\\ bar' (two arguments, and the first one ends in a backslash) would +both set $opt_args[-x] to the same value. This example assumes the -x +option's spec declared two arguments, as in: _arguments : -x:foo:${action}:bar:$action -), it would be impossible to tell from $opt_args whether the command-line -was '-x foo\:bar' or '-x foo\\ bar'. + +For the more common case of non-repeatable options that take a single +argument, completion functions now have to unescape not only colons but +also backslashes when obtaining the option's argument from $opt_args. Incompatibilities between 5.0.8 and 5.2 --------------------------------------- -- cgit v1.2.3 From 8011fe8a582bd3c018a98e0e2c08f65233bcf0fc Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 11 Sep 2016 13:22:35 +0200 Subject: 39261 (tweaked cf. Daniel: 39275): don't unconditionally elevate privileges with sudo in completion functions A new gain-privileges style enables it and a _comp_priv_prefix array added for tracking how to match privileges for the current command --- ChangeLog | 15 +++++++++ Completion/BSD/Command/_jexec | 1 + Completion/Base/Core/_main_complete | 1 + Completion/Base/Utility/_call_program | 11 +++++-- Completion/Debian/Command/_dchroot | 1 + Completion/Debian/Command/_dchroot-dsa | 1 + Completion/Debian/Command/_schroot | 1 + Completion/Mandriva/Command/_rebootin | 2 +- Completion/Solaris/Command/_pfexec | 2 +- Completion/Solaris/Command/_zlogin | 2 ++ Completion/Unix/Command/_dsh | 1 + Completion/Unix/Command/_fsh | 1 + Completion/Unix/Command/_libvirt | 10 +++--- Completion/Unix/Command/_mosh | 1 + Completion/Unix/Command/_rlogin | 1 + Completion/Unix/Command/_ssh | 1 + Completion/Unix/Command/_sudo | 2 +- Doc/Zsh/compsys.yo | 59 +++++++++++++++++++++++++++++----- 18 files changed, 95 insertions(+), 18 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 7fba3550c..78931adbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2016-09-11 Oliver Kiddle + + * 39261 (tweaked cf. Daniel: 39275): Doc/Zsh/compsys.yo: + Completion/Base/Core/_main_complete, + Completion/Base/Utility/_call_program, + Completion/Debian/Command/_dchroot, + Completion/Debian/Command/_dchroot-dsa, + Completion/Debian/Command/_schroot, + Completion/Solaris/Command/_pfexec, + Completion/Solaris/Command/_zlogin, Completion/Unix/Command/_dsh, + Completion/Unix/Command/_fsh, Completion/Unix/Command/_libvirt, + Completion/Unix/Command/_mosh, Completion/Unix/Command/_rlogin, + Completion/Unix/Command/_ssh, Completion/Unix/Command/_sudo: + don't unconditionally gain privileges with sudo for completion + 2016-09-11 Daniel Shahaf * 39252: Src/Zle/compcore.c, Src/Zle/compctl.c, diff --git a/Completion/BSD/Command/_jexec b/Completion/BSD/Command/_jexec index 279812bbc..85829d10e 100644 --- a/Completion/BSD/Command/_jexec +++ b/Completion/BSD/Command/_jexec @@ -2,6 +2,7 @@ _jexec_normal() { local PATH=$PATH + local -a _comp_priv_prefix # relative paths are relative to the jail's root path=( "$(command jls -j $words[1] path)"/$^path ) shift 1 words; (( CURRENT-- )) diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete index 9c4cfac85..c292ce7d7 100644 --- a/Completion/Base/Core/_main_complete +++ b/Completion/Base/Core/_main_complete @@ -38,6 +38,7 @@ local func funcs ret=1 tmp _compskip format nm call match min max i num\ _saved_colors="$ZLS_COLORS" \ _saved_colors_set=${+ZLS_COLORS} \ _ambiguous_color='' +local -a _comp_priv_prefix # _precommand sets this to indicate we are following a precommand modifier local -a precommands diff --git a/Completion/Base/Utility/_call_program b/Completion/Base/Utility/_call_program index 010e09476..95c761e65 100644 --- a/Completion/Base/Utility/_call_program +++ b/Completion/Base/Utility/_call_program @@ -1,6 +1,13 @@ #autoload +X local tmp err_fd=-1 +local -a prefix + +if [[ "$1" = -p ]]; then + shift + zstyle -t ":completion:${curcontext}:${1}" gain-privileges && + prefix=( $_comp_priv_prefix ) +fi if (( ${debug_fd:--1} > 2 )) || [[ ! -t 2 ]] then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is trace or redirect @@ -13,10 +20,10 @@ if zstyle -s ":completion:${curcontext}:${1}" command tmp; then if [[ "$tmp" = -* ]]; then eval "$tmp[2,-1]" "$argv[2,-1]" else - eval "$tmp" + eval $prefix "$tmp" fi else - eval "$argv[2,-1]" + eval $prefix "$argv[2,-1]" fi 2>&$err_fd } always { diff --git a/Completion/Debian/Command/_dchroot b/Completion/Debian/Command/_dchroot index c26e5691a..2a6f5d808 100644 --- a/Completion/Debian/Command/_dchroot +++ b/Completion/Debian/Command/_dchroot @@ -2,6 +2,7 @@ local expl context state line typeset -A opt_args +local -a _comp_priv_prefix _arguments -S \ '(-h --help)'{-h,--help}'[help]' \ diff --git a/Completion/Debian/Command/_dchroot-dsa b/Completion/Debian/Command/_dchroot-dsa index d4668b553..e8e981b84 100644 --- a/Completion/Debian/Command/_dchroot-dsa +++ b/Completion/Debian/Command/_dchroot-dsa @@ -2,6 +2,7 @@ local expl context state line typeset -A opt_args +local -a _comp_priv_prefix _arguments -S \ '(-h --help)'{-h,--help}'[help]' \ diff --git a/Completion/Debian/Command/_schroot b/Completion/Debian/Command/_schroot index 06117be88..117df45ef 100644 --- a/Completion/Debian/Command/_schroot +++ b/Completion/Debian/Command/_schroot @@ -2,6 +2,7 @@ local expl context state line typeset -A opt_args +local -a _comp_priv_prefix _arguments -S \ '(-h --help)'{-h,--help}'[help]' \ diff --git a/Completion/Mandriva/Command/_rebootin b/Completion/Mandriva/Command/_rebootin index 3f30b2591..284ff08f1 100644 --- a/Completion/Mandriva/Command/_rebootin +++ b/Completion/Mandriva/Command/_rebootin @@ -2,7 +2,7 @@ local context state line expl typeset -A opt_args -local loader=$(sudo detectloader -q) +local loader=${$(_call_program -p entries detectloader -q):-GRUB} _arguments -s \ '-n[no immediate reboot just set the flags for next reboot]' \ diff --git a/Completion/Solaris/Command/_pfexec b/Completion/Solaris/Command/_pfexec index 227336223..3f1f3e733 100644 --- a/Completion/Solaris/Command/_pfexec +++ b/Completion/Solaris/Command/_pfexec @@ -25,7 +25,7 @@ _pfexec() { _arguments \ '-P[privileges to acquire]:privspec:_privset' \ '(-):command name: _command_names -e' \ - '*::arguments: _normal' + '*::arguments:{ _comp_priv_prefix=( $words[1] ${(kv)opt_args[-P]} ) ; _normal }' } _pfexec "$@" diff --git a/Completion/Solaris/Command/_zlogin b/Completion/Solaris/Command/_zlogin index 04018eb87..065f55b03 100644 --- a/Completion/Solaris/Command/_zlogin +++ b/Completion/Solaris/Command/_zlogin @@ -1,6 +1,8 @@ #compdef zlogin # Synced with the Nevada build 162 man page +local -a _comp_priv_prefix + _zlogin() { _arguments -s \ '-E[Disable escape character]' \ diff --git a/Completion/Unix/Command/_dsh b/Completion/Unix/Command/_dsh index 688e024ce..8c5c23208 100644 --- a/Completion/Unix/Command/_dsh +++ b/Completion/Unix/Command/_dsh @@ -2,6 +2,7 @@ local curcontext="$curcontext" state line expl typeset -A opt_args +local -a _comp_priv_prefix _arguments -s -C -S \ '(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \ diff --git a/Completion/Unix/Command/_fsh b/Completion/Unix/Command/_fsh index d9ced5feb..c39373117 100644 --- a/Completion/Unix/Command/_fsh +++ b/Completion/Unix/Command/_fsh @@ -1,6 +1,7 @@ #compdef fsh local curcontext="$curcontext" state line ret=1 +local -a _comp_priv_prefix _arguments -C \ '(- : *)'{-h,--help}'[display help information]' \ diff --git a/Completion/Unix/Command/_libvirt b/Completion/Unix/Command/_libvirt index 658e197dc..17b02be81 100644 --- a/Completion/Unix/Command/_libvirt +++ b/Completion/Unix/Command/_libvirt @@ -155,7 +155,7 @@ case $state in return 1 ;; --device) - values; values=( $(_call_program nodedevs "virsh $conn_opt nodedev-list") ) + values; values=( $(_call_program devices "virsh $conn_opt nodedev-list") ) [[ -n $values ]] && _wanted devices expl device compadd ${=values} && return 0 return 1 ;; @@ -204,7 +204,7 @@ case $state in fi fi [[ -z $_cache_virsh_cmd_opts[$cmd] ]] && \ - _cache_virsh_cmd_opts[$cmd]=${(M)${${${${=${(f)"$(_call_program virsh virsh help $cmd 2>&1)"}}/\[}/\]}/\;}:#-[-0-9A-Za-z]*} + _cache_virsh_cmd_opts[$cmd]=${(M)${${${${=${(f)"$(_call_program options virsh help $cmd 2>&1)"}}/\[}/\]}/\;}:#-[-0-9A-Za-z]*} [[ -n ${=_cache_virsh_cmd_opts[$cmd]} ]] && \ _values -w option ${(u)=_cache_virsh_cmd_opts[$cmd]} && ret=0 ;; @@ -218,16 +218,16 @@ case $state in done [[ -z $cmd ]] && return 1 if [[ $words[CURRENT-1] == --server ]]; then - _wanted servers expl server compadd ${=${(S)${${(f)$(sudo virt-admin ${(Q)conn_opt} srv-list)}##*--- }//[0-9]* }} && return 0 + _wanted servers expl server compadd ${=${(S)${${(f)$(_call_program -p servers virt-admin ${(Q)conn_opt} srv-list)}##*--- }//[0-9]* }} && return 0 fi if [[ $words[CURRENT-1] == --client ]]; then local srv ; (( ${(k)words[(I)--server]} > 0 )) && srv=${words[1+${(k)words[(I)--server]}]} [[ -z $srv ]] && return 1 [[ -n ${srv//[[:alnum:]]} ]] && return 1 - _wanted clients expl client compadd ${=${${(f):-"$(sudo virt-admin ${(Q)conn_opt} srv-clients-list --server $srv 2>/dev/null)"}/ [a-z]*}//[^0-9]} && return 0 + _wanted clients expl client compadd ${=${${(f):-"$(_call_program -p clients virt-admin ${(Q)conn_opt} srv-clients-list --server $srv 2>/dev/null)"}/ [a-z]*}//[^0-9]} && return 0 fi [[ -z $_cache_virt_admin_cmd_opts[$cmd] ]] && \ - _cache_virt_admin_cmd_opts[$cmd]=${(M)${${${${=${(f)"$(_call_program virt-admin virt-admin help $cmd 2>&1)"}}/\[}/\]}/\;}:#-[-0-9A-Za-z]*} + _cache_virt_admin_cmd_opts[$cmd]=${(M)${${${${=${(f)"$(_call_program options virt-admin help $cmd 2>&1)"}}/\[}/\]}/\;}:#-[-0-9A-Za-z]*} [[ -n $_cache_virt_admin_cmd_opts[$cmd] ]] && \ _values -w option ${(u)=_cache_virt_admin_cmd_opts[$cmd]} && ret=0 ;; diff --git a/Completion/Unix/Command/_mosh b/Completion/Unix/Command/_mosh index c19f6ebde..431fdbf9e 100644 --- a/Completion/Unix/Command/_mosh +++ b/Completion/Unix/Command/_mosh @@ -1,6 +1,7 @@ #compdef mosh local curcontext="$curcontext" state line +local -a _comp_priv_prefix _arguments -C \ '(-)--help[display help information]' \ diff --git a/Completion/Unix/Command/_rlogin b/Completion/Unix/Command/_rlogin index a04c6d068..8f74939fd 100644 --- a/Completion/Unix/Command/_rlogin +++ b/Completion/Unix/Command/_rlogin @@ -12,6 +12,7 @@ _rlogin () { rsh|remsh) local context state line ret=1 typeset -A opt_args + local -a _comp_priv_prefix _arguments -s \ '-n[ignore stdin]' \ diff --git a/Completion/Unix/Command/_ssh b/Completion/Unix/Command/_ssh index 7b2cdd8e1..5ee4fd2ad 100644 --- a/Completion/Unix/Command/_ssh +++ b/Completion/Unix/Command/_ssh @@ -605,6 +605,7 @@ _ssh () { hmac-sha2-256-96 hmac-sha2-512 hmac-sha2-512-96 && ret=0 ;; command) + local -a _comp_priv_prefix shift 1 words (( CURRENT-- )) _normal diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index 63ac37f62..21b1ef4c6 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -48,7 +48,7 @@ else '(-H --set-home -i --login -s --shell -e --edit)'{-H,--set-home}"[set HOME variable to target user's home dir]" \ '(-P --preserve-groups -i -login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ '(-)1:command: _command_names -e' - '*::arguments: _normal' + '*::arguments:{ _comp_priv_prefix=( $words[1] -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }' ) fi diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index ecf17e728..bc036ada5 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1842,6 +1842,15 @@ In the case of the tt(_match) completer, the style may also be set to the string `tt(pattern)'. Then the pattern on the line is left unchanged if it does not match unambiguously. ) +kindex(gain-privileges, completion style) +item(tt(gain-privileges))( +If set to tt(true), this style enables the use of commands like tt(sudo) +or tt(doas) to gain extra privileges when retrieving information for +completion. This is only done when a command such as tt(sudo) appears on +the command-line. To force the use of, e.g. tt(sudo) or to override any +prefix that might be added due to tt(gain-privileges), the tt(command) +style can be used with a value that begins with a hyphen. +) kindex(keep-prefix, completion style) item(tt(keep-prefix))( This style is used by the tt(_expand) completer. If it is `true', the @@ -3471,12 +3480,6 @@ generating matches all follow the convention of returning status zero if they generated completions and non-zero if no matching completions could be added. -Two more features are offered by the tt(_main_complete) function. The -arrays tt(compprefuncs) and tt(comppostfuncs) may contain -names of functions that are to be called immediately before or after -completion has been tried. A function will only be called once unless -it explicitly reinserts itself into the array. - startitem() findex(_absolute_command_paths) item(tt(_absolute_command_paths))( @@ -4173,7 +4176,7 @@ The return status of tt(_call_function) itself is zero if the function var(name) exists and was called and non-zero otherwise. ) findex(_call_program) -item(tt(_call_program) var(tag) var(string) ...)( +item(tt(_call_program) [ tt(-p) ] var(tag) var(string) ...)( This function provides a mechanism for the user to override the use of an external command. It looks up the tt(command) style with the supplied var(tag). If the style is set, its value is used as the command to @@ -4181,6 +4184,13 @@ execute. The var(string)s from the call to tt(_call_program), or from the style if set, are concatenated with spaces between them and the resulting string is evaluated. The return status is the return status of the command called. + +If the option `tt(-p)' is supplied it indicates that the command +output is influenced by the permissions it is run with. If the +tt(gain-privileges) style is set to true, tt(_call_program) will make +use of commands such as tt(sudo), if present on the command-line, to +match the permissions to whatever the final command is likely to run +under. ) findex(_combination) item(tt(_combination) [ tt(-s) var(pattern) ] var(tag) var(style) var(spec) ... var(field) var(opts) ...)( @@ -5073,7 +5083,40 @@ ifnzman(noderef(The zsh/zleparameter Module)). ) enditem() -texinode(Completion Directories)()(Completion Functions)(Completion System) +texinode(Completion System Variables)(Completion Directories)(Completion Functions)(Completion System) +sect(Completion System Variables) +cindex(completion system, variables) + +There are some standard variables, initialised by the tt(_main_complete) +function and then used from other functions. + +The standard variables are: + +startitem() +item(tt(_comp_caller_options))( +The completion system uses tt(setopt) to set a number of options. This +allows functions to be written without concern for compatibility with +every possible combination of user options. However, sometimes completion +needs to know what the user's option preferences are. These are saved +in the tt(_comp_caller_options) associative array. Option names, spelled +in lowercase without underscores, are mapped to one or other of the +strings `tt(on)' and `tt(off)'. +) + +item(tt(_comp_priv_prefix))( +Completion functions such as tt(_sudo) can set the tt(_comp_priv_prefix) +array to a command prefix that may then be used by tt(_call_program) to +match the privileges when calling programs to generate matches. +) +enditem() + +Two more features are offered by the tt(_main_complete) function. The +arrays tt(compprefuncs) and tt(comppostfuncs) may contain +names of functions that are to be called immediately before or after +completion has been tried. A function will only be called once unless +it explicitly reinserts itself into the array. + +texinode(Completion Directories)()(Completion System Variables)(Completion System) sect(Completion Directories) cindex(completion system, directory structure) -- cgit v1.2.3 From ef019506aeab44d830efccef27a7c9727156300c Mon Sep 17 00:00:00 2001 From: Vin Shelton Date: Sun, 11 Sep 2016 16:48:06 -0400 Subject: 39284: Added Completion System Variables as a menu item --- ChangeLog | 6 ++++++ Doc/Zsh/compsys.yo | 1 + 2 files changed, 7 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 78931adbb..c806955f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-09-11 Vin Shelton + + * 39284: Doc/Zsh/compsys.yo: + Added Completion System Variables as a menu item + 2016-09-11 Oliver Kiddle * 39261 (tweaked cf. Daniel: 39275): Doc/Zsh/compsys.yo: @@ -17,6 +22,7 @@ * 39252: Src/Zle/compcore.c, Src/Zle/compctl.c, Src/Zle/computil.c, Src/Zle/zle_misc.c, Src/Zle/zle_tricky.c, + Src/builtin.c, Src/subst.c, Src/text.c, Src/utils.c: internal: quotestring: Drop the 'e' parameter, which no caller uses. diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index bc036ada5..87be0fc59 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -91,6 +91,7 @@ menu(Control Functions) menu(Bindable Commands) menu(Completion Functions) menu(Completion Directories) +menu(Completion System Variables) endmenu() texinode(Initialization)(Completion System Configuration)()(Completion System) -- cgit v1.2.3 From 5456cab86f3720109e3f47915267ed43dc511271 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Mon, 12 Sep 2016 09:50:25 -0700 Subject: 39297: more of 39284, it's painful to add texi nodes in yodl Also fix some inconsequential ChangeLog typos. --- ChangeLog | 11 ++++++++--- Doc/Zsh/compsys.yo | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 2febfef09..17e0dd00f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-09-12 Barton E. Schaefer + + * 39297: Doc/Zsh/compsys.yo: more of 39284, it's painful to add + texi nodes in yodl + 2016-09-12 Peter Stephenson * 39255: Doc/Zsh/cond.yo: = in conditions is not actually going @@ -10,8 +15,8 @@ 2016-09-11 Vin Shelton - * 39284: Doc/Zsh/compsys.yo: - Added Completion System Variables as a menu item + * 39284: Doc/Zsh/compsys.yo: Added Completion System Variables as + a menu item 2016-09-11 Oliver Kiddle @@ -734,7 +739,7 @@ * 38692: Doc/Zsh/restricted.yo, Src/params.c: IFS can't be changed in restricted mode. -2016-06-19 Barton E. Schaefer +2016-06-19 Barton E. Schaefer * 38715: Doc/Zsh/contrib.yo, Functions/Zle/add-zle-hook-widget: assorted ksharrays fixes; assign an index to any hook that is diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 87be0fc59..cab665b1c 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3468,7 +3468,7 @@ emacs and vi respectively. ) enditem() -texinode(Completion Functions)(Completion Directories)(Bindable Commands)(Completion System) +texinode(Completion Functions)(Completion System Variables)(Bindable Commands)(Completion System) sect(Utility Functions) cindex(completion system, utility functions) -- cgit v1.2.3 From b870ff85a0bcda9d38a734aa86bb6aee3d76983e Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 16 Sep 2016 00:05:10 +0200 Subject: 39333: include name of command used to gain priviliges in context for command and gain-priviliges styles --- ChangeLog | 5 +++++ Completion/Base/Utility/_call_program | 9 ++++++--- Completion/Solaris/Command/_pfexec | 2 +- Completion/Unix/Command/_sudo | 5 +++-- Doc/Zsh/compsys.yo | 4 +++- 5 files changed, 18 insertions(+), 7 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index f54d78ca3..0faf7b9ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2016-09-15 Oliver Kiddle + * 39333: Completion/Base/Utility/_call_program, + Doc/Zsh/compsys.yo, Completion/Solaris/Command/_pfexec, + Completion/Unix/Command/_sudo: include name of command used to + gain priviliges in context for command and gain-priviliges styles + * 39332: Doc/Zsh/cond.yo, Src/cond.c, Src/params.c, Src/parse.c, Completion/Zsh/Context/_condition, Test/C02cond.ztst: support ksh's [[ -v varname ]] condition for checking if variables are set diff --git a/Completion/Base/Utility/_call_program b/Completion/Base/Utility/_call_program index 95c761e65..9a44f2d8e 100644 --- a/Completion/Base/Utility/_call_program +++ b/Completion/Base/Utility/_call_program @@ -1,12 +1,15 @@ #autoload +X -local tmp err_fd=-1 +local curcontext="${curcontext}" tmp err_fd=-1 local -a prefix if [[ "$1" = -p ]]; then shift - zstyle -t ":completion:${curcontext}:${1}" gain-privileges && - prefix=( $_comp_priv_prefix ) + if (( $#_comp_priv_prefix )); then + curcontext="${curcontext%:*}/${${(@M)_comp_priv_prefix:#^*[^\\]=*}[1]}:" + zstyle -t ":completion:${curcontext}:${1}" gain-privileges && + prefix=( $_comp_priv_prefix ) + fi fi if (( ${debug_fd:--1} > 2 )) || [[ ! -t 2 ]] diff --git a/Completion/Solaris/Command/_pfexec b/Completion/Solaris/Command/_pfexec index 3f1f3e733..2afaf317b 100644 --- a/Completion/Solaris/Command/_pfexec +++ b/Completion/Solaris/Command/_pfexec @@ -25,7 +25,7 @@ _pfexec() { _arguments \ '-P[privileges to acquire]:privspec:_privset' \ '(-):command name: _command_names -e' \ - '*::arguments:{ _comp_priv_prefix=( $words[1] ${(kv)opt_args[-P]} ) ; _normal }' + '*::arguments:{ _comp_priv_prefix=( pfexec ${(kv)opt_args[-P]} ) ; _normal }' } _pfexec "$@" diff --git a/Completion/Unix/Command/_sudo b/Completion/Unix/Command/_sudo index 21b1ef4c6..0a212b723 100644 --- a/Completion/Unix/Command/_sudo +++ b/Completion/Unix/Command/_sudo @@ -2,7 +2,7 @@ setopt localoptions extended_glob -local environ e +local environ e cmd local -a args zstyle -a ":completion:${curcontext}:" environ environ @@ -39,6 +39,7 @@ args=( if [[ $service = sudoedit ]] || (( $words[(i)-e] < $words[(i)^(*sudo|-[^-]*)] )) ; then args=( -A "-*" $args '!(-V --version -h --help)-e' '*:file:_files' ) else + cmd="$words[1]" args+=( '(-e --edit 1 *)'{-e,--edit}'[edit files instead of running a command]' \ '(-s --shell)'{-s,--shell}'[run shell as the target user; a command may also be specified]' \ @@ -48,7 +49,7 @@ else '(-H --set-home -i --login -s --shell -e --edit)'{-H,--set-home}"[set HOME variable to target user's home dir]" \ '(-P --preserve-groups -i -login -s --shell -e --edit)'{-P,--preserve-groups}"[preserve group vector instead of setting to target's]" \ '(-)1:command: _command_names -e' - '*::arguments:{ _comp_priv_prefix=( $words[1] -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }' + '*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[(I)(-[ugHEP]|--(user|group|set-home|preserve-env|preserve-groups))]} ) ; _normal }' ) fi diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index cab665b1c..260ace4ac 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4191,7 +4191,9 @@ output is influenced by the permissions it is run with. If the tt(gain-privileges) style is set to true, tt(_call_program) will make use of commands such as tt(sudo), if present on the command-line, to match the permissions to whatever the final command is likely to run -under. +under. When looking up the tt(gain-privileges) and tt(command) styles, +the command component of the zstyle context will end with a slash +(`tt(/)') followed by the command that would be used to gain privileges. ) findex(_combination) item(tt(_combination) [ tt(-s) var(pattern) ] var(tag) var(style) var(spec) ... var(field) var(opts) ...)( -- cgit v1.2.3 From 13cfa036c8f9dd02688d3cb860abc75bcc64827d Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sun, 16 Oct 2016 17:14:48 +0000 Subject: 39657: Make a helper function global. --- ChangeLog | 6 ++++++ Completion/Zsh/Command/_zstyle | 16 ---------------- Completion/Zsh/Type/_completers | 14 ++++++++++++++ Doc/Zsh/compsys.yo | 10 ++++++++++ 4 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 Completion/Zsh/Type/_completers (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 2d638dfdb..9e1beba1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-10-18 Daniel Shahaf + + * 39657: Completion/Zsh/Command/_zstyle, + Completion/Zsh/Type/_completers, Doc/Zsh/compsys.yo: Make a + helper function global. + 2016-10-16 Daniel Shahaf * 39500: Src/Zle/computil.c: compdescribe: perform diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index 20ff47f87..dcebc6faf 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -4,22 +4,6 @@ local state context ostate line expl ctop suf local nm=$compstate[nmatches] taglist patterns pstyles contexts typeset -A opt_args styles -(( $+functions[_completers] )) || -_completers() { - # option: -p - needs a `_' prefix - local us - local -a disp list expl - - list=( complete approximate correct match expand list menu oldlist - ignored prefix history ) - zparseopts -D -K -E 'p=us' - [[ -n "$us" ]] && us='_' - zstyle -t ":completion:${curcontext}:completers" prefix-hidden && - disp=(-d list) - _wanted completers expl 'completer' \ - compadd "$@" "$disp[@]" - "$us${^list[@]}" -} - _vcs_info_hooks() { compadd - ${functions[(I)+vi-*]#+vi-} } diff --git a/Completion/Zsh/Type/_completers b/Completion/Zsh/Type/_completers new file mode 100644 index 000000000..87c986a17 --- /dev/null +++ b/Completion/Zsh/Type/_completers @@ -0,0 +1,14 @@ +#autoload + +# option: -p - needs a `_' prefix +local us +local -a disp list expl + +list=( complete approximate correct match expand list menu oldlist + ignored prefix history ) +zparseopts -D -K -E 'p=us' +[[ -n "$us" ]] && us='_' +zstyle -t ":completion:${curcontext}:completers" prefix-hidden && + disp=(-d list) +_wanted completers expl 'completer' \ + compadd "$@" "$disp[@]" - "$us${^list[@]}" diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 260ace4ac..a56ca6721 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4246,6 +4246,16 @@ This function completes words that are valid at command position: names of aliases, builtins, hashed commands, functions, and so on. With the tt(-e) flag, only hashed commands are completed. The tt(-) flag is ignored. ) +findex(_completers) +item(tt(_completers) [ tt(-p) ])( +This function completes names of completers. + +startitem() +item(tt(-p))( +Include the leading underscore (`tt(_)') in the matches. +) +enditem() +) findex(_describe) redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi( ))) xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ]) -- cgit v1.2.3 From f1c0480afc49ce2accc70c69cf0aa3a975c1563c Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 22 Oct 2016 21:54:05 +0000 Subject: 39707: Document _dir_list. --- ChangeLog | 4 ++++ Doc/Zsh/compsys.yo | 15 +++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index f63ffa6fa..0fac01a90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-10-24 Daniel Shahaf + + * 39707: Doc/Zsh/compsys.yo: Document _dir_list. + 2016-10-23 Peter Stephenson * 39715: Src/Zle/complist.c: handle multibyte characters when diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index a56ca6721..f56daa459 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4357,6 +4357,21 @@ matches. Almost all calls to tt(compadd) within the completion system use a similar format; this ensures that user-specified styles are correctly passed down to the builtins which implement the internals of completion. ) +findex(_dir_list) +item(tt(_dir_list) [ tt(-s) var(sep) ] [ tt(-S) ])( +Complete a list of directory names separated by colons +(the same format as tt($PATH)). + +startitem() +item(tt(-s) var(sep))( +Use var(sep) as separator between items. +var(sep) defaults to a colon (`tt(:)'). +) +item(tt(-S))( +Add var(sep) instead of slash (`tt(/)') as an autoremoveable suffix. +) +enditem() +) findex(_dispatch) item(tt(_dispatch) var(context string) ...)( This sets the current context to var(context) and looks for completion -- cgit v1.2.3 From 4eef3e6f0e2f7e258c961b30cef7f4d463fb8b2f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 22 Oct 2016 21:54:06 +0000 Subject: 39708: Document _email_addresses. --- ChangeLog | 3 +++ Completion/Unix/Type/_email_addresses | 2 ++ Doc/Zsh/compsys.yo | 42 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 0fac01a90..7debe2d83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-10-24 Daniel Shahaf + * 39708: Completion/Unix/Type/_email_addresses, + Doc/Zsh/compsys.yo: Document _email_addresses. + * 39707: Doc/Zsh/compsys.yo: Document _dir_list. 2016-10-23 Peter Stephenson diff --git a/Completion/Unix/Type/_email_addresses b/Completion/Unix/Type/_email_addresses index 7d5c942de..8a5877a9c 100644 --- a/Completion/Unix/Type/_email_addresses +++ b/Completion/Unix/Type/_email_addresses @@ -5,6 +5,8 @@ # -s sep - complete a list of addresses separated by specified character # -c - e-mail address must be of form user@host (no comments or aliases) # +# TODO: with -n, have the named plugin complete not only aliases but also addresses? +# # Plugins are written as separate functions with names starting `_email-'. # They should either do their own completion or return the addresses in the # reply array in the form 'alias:address' and return 300. The -c option is diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index f56daa459..33ba92c16 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -826,6 +826,10 @@ kindex(domains, completion tag) item(tt(domains))( for network domains ) +kindex(email-*, completion tag) +item(tt(email-)var(plugin))( +for email addresses from the `tt(_email-)var(plugin)' backend of tt(_email_addresses) +) kindex(expansions, completion tag) item(tt(expansions))( used by the tt(_expand) completer for individual words (as opposed to @@ -4387,6 +4391,44 @@ tt($service) to the var(string) being tried, and sets the var(context/command) field (the fourth) of the tt($curcontext) parameter to the var(context) given as the first argument. ) +findex(_email_addresses) +item(tt(_email_addresses) [ tt(-c) ] [ tt(-n) var(plugin) ])( +Complete email addresses. Addresses are provided by plugins. + +startitem() +item(tt(-c))( +Complete bare tt(localhost@domain.tld) addresses, without a name part or +a comment. +Without this option, RFC822 `var(Firstname Lastname) tt(<)var(address)tt(>)' +strings are completed. +) +item(tt(-n) var(plugin))( +Complete aliases from var(plugin). +) +COMMENT(Intentionally leaving tt(-s) undocumented: new code should use +tt(_sequence) instead.)\ +enditem() + +The following plugins are available by default: +tt(_email-ldap) (see the tt(filter) style), +tt(_email-local) (completes var(user)tt(@)var(hostname) Unix addresses), +tt(_email-mail) (completes aliases from tt(~/.mailrc)), +tt(_email-mush), +tt(_email-mutt), +and +tt(_email-pine). + +Addresses from the tt(_email-)var(foo) plugin are added under the +tag `tt(email-)var(foo)'. + +em(Writing plugins) + +Plugins are written as separate functions with names starting with `tt(_email-)'. +They are invoked with the tt(-c) option and tt(compadd) options. +They should either do their own completion or +set the tt($reply) array to a list of `var(alias)tt(:)var(address)' elements and return tt(300). +New plugins will be picked up and run automatically. +) findex(_files) item(tt(_files))( The function tt(_files) calls tt(_path_files) with all the arguments it -- cgit v1.2.3 From 71dd0ab62ecf67e3a4a60749e9f5b1cfc9ac0ec4 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 22 Oct 2016 21:54:07 +0000 Subject: 39706: _tilde_files: Offer named directories. Document. --- ChangeLog | 3 +++ Completion/Unix/Type/_tilde_files | 3 ++- Doc/Zsh/compsys.yo | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 7debe2d83..717f25e76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-10-24 Daniel Shahaf + * 39706: Completion/Unix/Type/_tilde_files, Doc/Zsh/compsys.yo: + _tilde_files: Offer named directories. Document. + * 39708: Completion/Unix/Type/_email_addresses, Doc/Zsh/compsys.yo: Document _email_addresses. diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files index ee6b18088..b1b3b37f0 100644 --- a/Completion/Unix/Type/_tilde_files +++ b/Completion/Unix/Type/_tilde_files @@ -30,7 +30,8 @@ case "$PREFIX" in ;; \~*) compset -P '?' - _users "$@" + local -a expl=( "$@" ) + _alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs' ;; *) _files "$@" diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 33ba92c16..42482760b 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -5019,6 +5019,12 @@ allows tt(_tags) to use a more specific context without having to change and reset the tt(curcontext) parameter (which has the same effect). ) +findex(_tilde_files) +item(tt(_tilde_files))( +Like tt(_files), but resolve leading tildes according to the rules of +filename expansion, so the suggested completions don't start with +a `tt(~)' even if the filename on the command-line does. +) findex(_values) item(tt(_values) [ tt(-O) var(name) ] [ tt(-s) var(sep) ] [ tt(-S) var(sep) ] [ tt(-wC) ] var(desc) var(spec) ...)( This is used to complete arbitrary keywords (values) and their arguments, -- cgit v1.2.3 From 5dbfbd8bd016832c46c63b095cb60d043b37d379 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 21 Sep 2016 03:54:41 +0000 Subject: unposted: Minor documentation fixes (markup, grammar, etc). --- ChangeLog | 3 +++ Doc/Zsh/compsys.yo | 7 ++++--- Doc/Zsh/contrib.yo | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index 0592589fc..5caf8735f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-10-27 Daniel Shahaf + * unposted: Doc/Zsh/compsys.yo, Doc/Zsh/contrib.yo: Minor + documentation fixes (markup, grammar, etc). + * 39739: Completion/Unix/Command/_head, Completion/Unix/Command/_tail: Complete negative integers for -n/-c in the GNU variant. (after 39479) diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 42482760b..ceb98c7bc 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -1115,14 +1115,14 @@ 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) 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: +a style using the tt(default) tag will normally be defined along the lines of: example(zstyle ':completion:*:default' menu ...) startitem() kindex(accept-exact, completion style) item(tt(accept-exact))( -This is tested for the default tag in addition to the tags valid for +This is tested for the tt(default) tag in addition to the tags valid for the current context. If it is set to `true' and any of the trial matches is the same as the string on the command line, this match will immediately be accepted (even if it would otherwise be considered @@ -3252,6 +3252,7 @@ for the current context; remember that the context for completers is less specific than that for contextual completion as the full context has not yet been determined. Elements of the array may have one of the following forms: + startsitem() sitem(tt($)var(hash))( var(hash) is the name of an associative array. Note this is not a full @@ -5013,7 +5014,7 @@ particular tag is to be tried, the tt(_requested) function should be called (see above). If `tt(-C) var(name)' is given, var(name) is temporarily stored in the -argument field (the fifth) of the context in the tt(curcontext) parameter +var(argument) field (the fifth) of the context in the tt(curcontext) parameter during the call to tt(_tags); the field is restored on exit. This allows tt(_tags) to use a more specific context without having to change and reset the diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 653d1bc98..623507283 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1051,7 +1051,7 @@ tt(:vcs_info:-init-:*:-all-) context. Say, tt(~/.zsh) is a directory under version control, in which you do not want tt(vcs_info) to be active, do: -example(zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+LPAR()|/*+RPAR()") +example(zstyle ':vcs_info:*' disable-patterns "${+LPAR()b+RPAR()HOME}/.zsh+LPAR()|/*+RPAR()") ) kindex(use-quilt) item(tt(use-quilt))( @@ -1070,7 +1070,7 @@ tt(Quilt Support) for details. ) kindex(quiltcommand) item(tt(quiltcommand))( -When tt(quilt) itself is called in quilt support the value of this style +When tt(quilt) itself is called in quilt support, the value of this style is used as the command name. ) kindex(check-for-changes) -- cgit v1.2.3 From 110ffae9fefa1367af4fdcc90a456de23b92436c Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Mon, 28 Nov 2016 22:53:24 -0800 Subject: 40035: Cosmetic fixes for comments and documentation. Mostly fixes to doubled words. --- ChangeLog | 7 +++++-- Completion/Base/Utility/_arguments | 2 +- Completion/Unix/Command/_git | 2 +- Completion/Unix/Type/_zfs_dataset | 2 +- Completion/Zsh/Command/_zstyle | 2 +- Completion/Zsh/Function/_zargs | 2 +- Doc/Zsh/builtins.yo | 2 +- Doc/Zsh/compsys.yo | 4 ++-- Doc/Zsh/contrib.yo | 2 +- Etc/ChangeLog-4.3 | 2 +- Src/Zle/zle_refresh.c | 2 +- Src/glob.c | 2 +- Src/hist.c | 2 +- Src/input.c | 2 +- Src/subst.c | 2 +- Src/zsh.h | 2 +- Util/helpfiles | 2 +- 17 files changed, 22 insertions(+), 19 deletions(-) (limited to 'Doc/Zsh/compsys.yo') diff --git a/ChangeLog b/ChangeLog index a016ce0e6..0d5f61198 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-11-29 Peter Stephenson + * 40035: Eitan Adler: Cosmetic fixes mostly for duplication in + comments and documentation. + * 40026: Src/Zle/zle_tricky.c: More care with redirection completion. Fixes for completion after > in "!> ." that should add to sanity. @@ -3523,7 +3526,7 @@ 2015-09-28 Barton E. Schaefer - * 36669: Src/lex.c: fix ${(z)...} of an an incomplete math + * 36669: Src/lex.c: fix ${(z)...} of an incomplete math expression by restoring "((" at the front of the token 2015-09-28 Daniel Shahaf @@ -9517,7 +9520,7 @@ 2013-07-20 Peter Stephenson * 31545: Src/exec.c, Src/parse.c: if FD_CLOEXEC is available, - so mark dump file file descriptors, avoiding possible + so mark dump file descriptors, avoiding possible multiple use of file descriptors. 2013-07-19 Peter Stephenson diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 82c969629..d2c0d33de 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -105,7 +105,7 @@ if (( long )); then continue else # Still no comment, add the previous options anyway. - # Add a ':' after the option anyways, to make the the matching of + # Add a ':' after the option anyways, to make the matching of # the options lateron work as intended. # It will be removed again later. lopts+=("${^tmp[@]}":) diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 283c50cc0..da049bd23 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -6114,7 +6114,7 @@ __git_recent_branches() { local -aU valid_ref_names_munged=( ${"${(f)"$(_call_program valid-ref-names 'git for-each-ref --format="%(refname)" refs/heads/')"}"#refs/heads/} ) # 1. Obtain names of recently-checked-out branches from the reflog. - # 2. Remove ref names that that no longer exist from the list. + # 2. Remove ref names that no longer exist from the list. # (We must do this because #3 would otherwise croak on them.) __git_recent_branches__names; branches=( ${(@)reply:*valid_ref_names_munged} ) diff --git a/Completion/Unix/Type/_zfs_dataset b/Completion/Unix/Type/_zfs_dataset index 6c625e9ec..6bef04e45 100644 --- a/Completion/Unix/Type/_zfs_dataset +++ b/Completion/Unix/Type/_zfs_dataset @@ -4,7 +4,7 @@ local -a type expl_type_arr rsrc rdst paths_allowed local -a typearg datasetlist expl mlist local expl_type -# -e takes an argument which is passed as as the "descr" argument to _wanted +# -e takes an argument which is passed as the "descr" argument to _wanted # -p indicates that filesystem paths, not just dataset names, are allowed # -r1 indicates that we're completing the source of a rename # -r2 indicates that we're completing the destination of a rename diff --git a/Completion/Zsh/Command/_zstyle b/Completion/Zsh/Command/_zstyle index d6f285271..0e828225e 100644 --- a/Completion/Zsh/Command/_zstyle +++ b/Completion/Zsh/Command/_zstyle @@ -266,7 +266,7 @@ while (( $#state )); do _wanted contexts expl "$state_descr" compadd -a patterns ;; - # 'metapatterns': patterns that are are matched not against contexts, but + # 'metapatterns': patterns that are matched not against contexts, but # against patterns. (metapatterns) zstyle -g patterns diff --git a/Completion/Zsh/Function/_zargs b/Completion/Zsh/Function/_zargs index c24b276f2..f974ab646 100644 --- a/Completion/Zsh/Function/_zargs +++ b/Completion/Zsh/Function/_zargs @@ -4,7 +4,7 @@ local arguments eofstr pos=$((CURRENT)) numeofs=0 ret=1 cmdpos=1 #this doesn't handle '--' on the command line, only -- #it also by extension doesn't handle eofstr being the empty string -#it also also doesn't handle eofstr being -e or --eof, and everything will +#it also doesn't handle eofstr being -e or --eof, and everything will # probably also be confused if the command at the end takes a -e, --eof= or -- eofstr=${${${${words[(r)(--eof=*|-e*)]}#--eof=}#-e}:---} while { diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 169a31ea3..7b04d0648 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -570,7 +570,7 @@ with emulations to be set to their values in tt(sh). tt(fno) then calls tt(fni); because tt(fni) is also marked for sticky tt(sh) emulation, no option changes take place on entry to or exit from it. Hence the option tt(cshnullglob), turned off by tt(sh) emulation, will -be turned on within tt(fni) and remain on on return to tt(fno). On exit +be turned on within tt(fni) and remain on return to tt(fno). On exit from tt(fno), the emulation mode and all options will be restored to the state they were in before entry to the temporary emulation. diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index ceb98c7bc..60ef9ee2c 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -144,8 +144,8 @@ directory mentioned in the tt(fpath) parameter, and should be autoloaded few utility functions, arrange for all the necessary shell functions to be autoloaded, and will then re-define all widgets that do completion to use the new system. If you use the tt(menu-select) widget, which is part of the -tt(zsh/complist) module, you should make sure that that module is loaded -before the call to tt(compinit) so that that widget is also +tt(zsh/complist) module, you should make sure that the module is loaded +before the call to tt(compinit) so that the widget is also re-defined. If completion styles (see below) are set up to perform expansion as well as completion by default, and the TAB key is bound to tt(expand-or-complete), tt(compinit) will rebind it to tt(complete-word); diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 623507283..f764eb7c6 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -3854,7 +3854,7 @@ The expression tt(<) followed (with no space) by a shell identifier causes the value of the variable with that name to be pushed onto the stack. var(ident) may be an integer, in which case the previous result with that number (as shown before -the tt(>) in th standard standard tt(zcalc) prompt) is put on the stack. +the tt(>) in the standard tt(zcalc) prompt) is put on the stack. ) item(Exchange: tt(xy))( The pseudo-function tt(xy) causes the most recent two elements of diff --git a/Etc/ChangeLog-4.3 b/Etc/ChangeLog-4.3 index 1be618b48..6d85e40af 100644 --- a/Etc/ChangeLog-4.3 +++ b/Etc/ChangeLog-4.3 @@ -1182,7 +1182,7 @@ 2011-08-16 Wayne Davison - * 29650: Src/jobs.c: don't lose the the time info after a + * 29650: Src/jobs.c: don't lose the time info after a suspend+restore. 2011-08-15 Peter Stephenson diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index e78f1e562..8d173cda1 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -946,7 +946,7 @@ addmultiword(REFRESH_ELEMENT *base, ZLE_STRING_T tptr, int ichars) /* * Swap the old and new video buffers, plus any associated multiword - * buffers. The new buffer becomes the old one; the new new buffer + * buffers. The new buffer becomes the old one; the new buffer * will be filled with the command line next time. */ static void diff --git a/Src/glob.c b/Src/glob.c index 33bf2ae18..623e6f1d6 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -1174,7 +1174,7 @@ checkglobqual(char *str, int sl, int nobareglob, char **sp) } /* Main entry point to the globbing code for filename globbing. * - * np points to a node in the list list which will be expanded * + * np points to a node in the list which will be expanded * * into a series of nodes. */ /**/ diff --git a/Src/hist.c b/Src/hist.c index 5be7d2524..97fd34039 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -1038,7 +1038,7 @@ hbegin(int dohist) /* * pws: We used to test for "|| (inbufflags & INP_ALIAS)" * in this test, but at this point we don't have input - * set up up so this can trigger unnecessarily. + * set up so this can trigger unnecessarily. * I don't see how the test at this point could ever be * useful, since we only get here when we're initialising * the history mechanism, before we've done any input. diff --git a/Src/input.c b/Src/input.c index eb968ea72..fe94b8ef7 100644 --- a/Src/input.c +++ b/Src/input.c @@ -51,7 +51,7 @@ * Note that the input string is itself used as the input buffer: it is not * copied, nor is it every written back to, so using a constant string * should work. Consequently, when passing areas of memory from the heap - * it is necessary that that heap last as long as the operation of reading + * it is necessary that the heap last as long as the operation of reading * the string. After the string is read, the stack should be popped with * inpop(), which effectively flushes any unread input as well as restoring * the previous input state. diff --git a/Src/subst.c b/Src/subst.c index c7c552257..a26ebb1d6 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -2368,7 +2368,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, * This is the inner handling for the case referred to above * where we have something like ${${(P)name}...}. * - * Treat this as as a normal value here; all transformations on + * Treat this as a normal value here; all transformations on * result are in outer instance. */ aspar = 0; diff --git a/Src/zsh.h b/Src/zsh.h index a5d4455e3..63cada827 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -1589,7 +1589,7 @@ struct zpc_disables_save { /* * Bit vector of ZPC_COUNT disabled characters. * We'll live dangerously and assumed ZPC_COUNT is no greater - * than the number of bits an an unsigned int. + * than the number of bits an unsigned int. */ unsigned int disables; }; diff --git a/Util/helpfiles b/Util/helpfiles index 699ca8321..9e837fe2d 100755 --- a/Util/helpfiles +++ b/Util/helpfiles @@ -19,7 +19,7 @@ # This script is called automatically during `make install' # unless specified otherwise. -# For usage and and more information see zshcontrib(1). +# For usage and more information see zshcontrib(1). sub Usage { print(STDERR "Usage: helpfiles zshbuiltins.1 dest-dir [link-file]\n"); -- cgit v1.2.3