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

Re: completion for printf-style format strings

If _regex_arguments doesn't provide a means or even a good example.   
 Do you think that it would make sense to modify _regex_arguments to
add code that would cause it to use the  compset -P/-S flags?

The _regex_arguments function relies on zregexparse, which is not
really documented, though it does have a dedicated test suite.  Would
it make sense to try to decipher that and make it try to search for
just substrings of the current word? Is that possible.  Or do you
think this is more a task for compadd/compset?  Is there an existing
utility function that could be used/modified?

I was thinking maybe _values might be good to look at, instead of
using a hard-coded separator, maybe a regex could be used.  Though it
uses compvalues which is not documented or tested(!).

It would be very useful to be able to complete alot of different
format strings.  I think you mentioned strftime since it can have
multi-letter formats. I think there are a lot of useful places it
could be used, like zsh prompts or the builtin print command.  Also
things like the date command or the find -printf flag.

Again, I'm not sure that this would directly help with a reduction in
typing, but I think it would help reduce the need to visit the
documentation, which would be useful.


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