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

Re: Proposed _history completer



Felix Rosencrantz wrote:

> I'm not currently doing any work on the _history completer.  So if you
> want to commit the changes that would be fine with me.  Though I think
> my testing is pretty limited (e.g. I don't use NUMERIC arguments, and I didn't
> try various zstyle configurations.)  I was thinking that in case there were
> any obvious problems with the completer (e.g. _wanted shouldn't be used in
> a completer) someone would post that feedback.

No, that's ok.

> Also, I don't have a lot of time to work on it, this completer has been on my
> list for a while.  So if other people want work on it I would be happy.
> 
> Sven Wischnowsky wrote:
> >_first contains a bit of code for something like this...
> 
> It's not quite N number of lines back that the compctl uses, but it seems
> like a reasonable approximation.

See below...

> >> I think there is a lot of potential to be found in limiting history words to
> >> similar contexts;  only history lines where the current command is used,
> >> or previous values for the current option. 
> >
> >Sounds good.
> >
> >> To do this might require
> >> some changes to the zsh/parameter module to make this efficient.
> >
> >Hm, I can't see how this could be done, yet. Have you tried how
> >slow/fast it is?
> 
> I wasn't sure how to break up the values of $history to find the start
> of commands, and to break up along word boundaries.  I was thinking
> that we might need C code support for that.  The $historywords array
> gives us the words, but it doesn't give much context (e.g. like if the word
> is in a command position, what history line the command is from).

Hmhm.

Maybe we could make $historywords an assoc with the words as keys and
the values giving information about that word. Something like the
history number where it comes from plus information about the context
(command-context, of some kind).

And no, I haven't looked how difficult to implement this would be (the 
history number itself would be easy if I remember correctly).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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