From 974d332d8989e85ad2edf95e5e467c6d8b111b38 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 15 Oct 1999 14:14:30 +0000 Subject: zsh-workers/8283 --- Doc/Zsh/compctl.yo | 4 +++- Doc/Zsh/compsys.yo | 3 +++ Doc/Zsh/compwid.yo | 4 ++++ Src/Zle/zle_tricky.c | 10 ++++++---- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Doc/Zsh/compctl.yo b/Doc/Zsh/compctl.yo index 6b017cedc..85993e917 100644 --- a/Doc/Zsh/compctl.yo +++ b/Doc/Zsh/compctl.yo @@ -666,7 +666,9 @@ sect(Matching Control) It is possible by use of the tt(-M) var(spec) flag to specify how the characters in the string to be completed (referred to here as the command line) map onto the characters in the list of matches produced by -the completion code (referred to here as the trial completions). +the completion code (referred to here as the trial completions). Note +that this is not used if the command line contains a glob pattern and +the tt(GLOB_COMPLETE) option is set. The var(spec) consists of one or more matching descriptions separated by whitespace. Each description consists of a letter followed by a colon, diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index d66df069d..fc8d70ff8 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -495,6 +495,9 @@ tt(match_insert) configuration key is set to a string starting with `tt(unambig)'. In this case menucompletion will only be started if no unambiguous string could be generated that is at least as long as the original string. + +Note that the matcher specifications defined globally or used by the +completion functions will not be used. ) item(tt(_expand))( This completer function does not really do completion, but instead diff --git a/Doc/Zsh/compwid.yo b/Doc/Zsh/compwid.yo index e0ab37fb5..605a6d35a 100644 --- a/Doc/Zsh/compwid.yo +++ b/Doc/Zsh/compwid.yo @@ -329,6 +329,10 @@ other non-empty string. If it is non-empty, unquoted metacharacters on the command line will be treated as patterns; if it is `tt(*)', then additionally a wildcard `tt(*)' is assumed at the cursor position; if it is empty or unset, metacharacters will be treated literally. + +Note that the matcher specifications given globally or to one of the +builtin commands adding matches are not used if this is set to a +non-empty string. ) item(tt(pattern_insert))( Normally this is set to tt(menu), which specifies that menu-completion will diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 684e8e926..70371b41c 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -157,7 +157,7 @@ int newmatches; /* Number of permanently allocated matches and groups. */ -static int permmnum, permgnum; +static int permmnum, permgnum, lastpermmnum, lastpermgnum; /* The total number of matches and the number of matches to be listed. */ @@ -5123,7 +5123,7 @@ callcompfunc(char *s, char *fn) comptoend = ztrdup("match"); zsfree(compoldlist); zsfree(compoldins); - if (hasoldlist && permmnum) { + if (hasoldlist && lastpermmnum) { if (listshown) compoldlist = "shown"; else @@ -5359,6 +5359,8 @@ makecomplist(char *s, int incmd, int lst) } permmatches(1); amatches = pmatches; + lastpermmnum = permmnum; + lastpermgnum = permgnum; } LASTALLOC; lastmatches = pmatches; @@ -8592,7 +8594,7 @@ do_ambig_menu(void) minfo.cur = NULL; } if (insgroup) { - insgnum = comp_mod(insgnum, permgnum); + insgnum = comp_mod(insgnum, lastpermgnum); for (minfo.group = amatches; minfo.group && (minfo.group)->num != insgnum + 1; minfo.group = (minfo.group)->next); @@ -8603,7 +8605,7 @@ do_ambig_menu(void) } insmnum = comp_mod(insmnum, (minfo.group)->mcount); } else { - insmnum = comp_mod(insmnum, permmnum); + insmnum = comp_mod(insmnum, lastpermmnum); for (minfo.group = amatches; minfo.group && (minfo.group)->mcount <= insmnum; minfo.group = (minfo.group)->next) -- cgit 1.4.1