Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion parameter suggestion



On Feb 26,  1:20pm, Sven Wischnowsky wrote:
} Subject: Re: completion parameter suggestion
}
} Bart Schaefer wrote:
} > Incidentally, I've never been clear on where the "matcher number" is
} > coming from in the first place, nor what one would use it for.  Maybe I
} > just haven't looked through the examples closely enough.
} 
} [...]  global match specs (`compctl -M 'spec1' 'spec2'...),
} these are tried by the completion code in order [...]
} `MATCHER' is the number of the one which is currently tried.

Hrm.  I should think that the string rather than the number would be
of much more use here.  The `compctl -M` command may have been changed
without changing the function, in which case the function's idea of
what pattern goes with what number would be completely wrong.

} > How about another associative array called `menustate' that holds all
} > these things?
} 
} As for the menu stuff, ok. But the list stuff isn't connected to
} (only) menucompletion.

Well ... displaying a list and allowing the user to choose from it is
a "menu" even if it's not "menu completion" in the zsh sense.  "Menu
completion" is just a different way of displaying the list.  So I won't
have any problem with calling it `menustate' and putting list stuff in
there, or calling it `list_state' and putting menucomplete stuff in
there, or whatever, even if menucompletion isn't actually in use.

} > The other possibility would be to automatically insert a dummy element 0
} > into `words' when ksharrays is set, and automatically remove it when
} > ksharrays changes.  That could be done without hooking into the option
} > code if `words' was a special array with a special get-function.
} 
} Hadn't thought about that, yes maybe... (but it's the other way round, 
} isn't it?)

It is?  ksharrays means array indices start at 0, right?  So to get
words[1] to be the command in ksharrays state, you have to insert a
dummy element 0.  (In non-ksharrays state, there's already a dummy
element 0, which happens to be the same as element 1.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author