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

Re: Two missing completion functions that bug me



Bart Schaefer wrote:

> On Mar 29, 11:09am, Oliver Kiddle wrote:
> }
> } >     '-c+[create parameter or change type]' \
> } 
> } I'm not sure you need the + after -c, or at least that is the only
> } difference to my function (other than wording for the help info).
> 
> You're right; upon another attempt, none of -c, -e, nor -h need the `+'.
> I was thinking it was needed to get other options to be completed in the
> same word, because of:
> 
> % vared -a<TAB>
> % vared -a 
>          ^cursor silently moves here
> 
> but in fact that's because -a takes an argument, not (only) because it
> does not have the `+'.  (Is there a way *other than* adding a ->state
> machine to get other options to complete in the same word but arguments
> in the next for an option like -a?  I was thinking not, and in fact I
> was thinking that I was one who asserted that ->state was a sufficient
> solution for this, a position I'm not inclined to change.)

You could try the patch below, which does that (automatically) for
me.  I'll commit it if we don't find any nasty side effect (or should
I apply it and take it back if we find problems?  feel free to commit
it if you like it...)

> ... [ comp* funcs ]
> 
> I suppose one could provide completions for them anyway, in case one is
> editing a new completion function on the fly, but it seems a lot of work
> for not a lot of benefit.

Yes, I thought the same.

> These don't need completions because they're keywords:
> 
>   break     continue
> 
> Which leaves:
> 
>   :            echo         pushln       suspend      umask
>   [            exit         pwd          test         zformat
>   bye          getln        r            ttyctl       zparseopts
>   dirs         logout       return       ulimit       zprof

zparseopts and zformat aren't of much use interactively either.

And completion for bye, exit and return seems weird, too.  Although
that would probably just be `_message "${${words[1]#bye}:-exit} value"'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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