On Sunday 12 December 2004 20:51, Bart Schaefer wrote: > On Sun, 12 Dec 2004, Andrey Borzenkov wrote: > > I attach prototype patch - it adds compstate element that tells > > accept_last to skip suffix removal. It can be used in more general case > > than just _values - what I am not sure how and when this is to be set. > > I wonder if perhaps another state name would be better. "Stay in word" is > a directive, whereas everything else in compstate is, well, state data. > > What if it were compstate[compound_word] and the value is the separator > character to insert? (Or perhaps two characters, corresponding to > "compvalues -s" and "compvalues -S" in that order.) > > Normally compstate[compound_word] would be unset, but "compvalues -i" > would set it based on the parse. I still believe this is more general and should not be limited to _values only. Also -S does not seem to be needed here. Here is updated patch (which also fixes initialization problem). It makes parameter compound_word as scalar but currently tests only for empty value (is it correct way to test for it BTW?) Setting compstate[compound_word] to any string in completion function will stop accept_last from removing suffix (actually, altering string in any way). This also changes _values to set it as appropriate. This still has problems in completing nested calls to _values (should it work?) Try this example: function _foo_val () { _values -s : "subvalues" baz bad bam } function _foo () { _values -s , -S = "test values" \ foo \ "bar:bar values:_foo_val" } compdef _foo foo regards -andrey