zsh-workers
 help / color / mirror / code / Atom feed
* Re: zstyle for _arguments feature request
@ 2001-12-11 12:35 Wischnowsky, Sven
  0 siblings, 0 replies; 4+ messages in thread
From: Wischnowsky, Sven @ 2001-12-11 12:35 UTC (permalink / raw)
  To: zsh-workers


Felix wrote:

> Oliver Kiddle wrote:
> 
> >Yes, this could be useful. The form in which I'd like to see 
> it in is a
> >more general version of the fake-files and fake-parameters styles and
> >available in all contexts as opposed to just in _arguments.
> 
> I think that would be ok.  Though it would also be nice to remove
> some|all entries from the list being provided to the user.  Also, it
> would be nice to provide help text for items.  I don't think that can be
> currently done with the fake-* styles.

Erm, the ignored-matches style? About the general fake style: I'm not
sure where the compadd for it could be put. Probably in _setup or
_description (where we have all the information about groups and so on),
but there might be cases where the matches are then added more than once
or into a group which isn't really used for matches (if the user doesn't
give  near enogh context). Doing it with help texts further complicates
this, of course. Especially if we want to have nice consistent listings
because only the completion function decides if the normal matches get
descriptions. We would just have to try it, I think.

> ...
> 
> Yes, something like that could be done for this specific case.  Playing
> with the completion generation stuff, I find that I want to use code
> from the "state" actions of existing completion functions a lot.  It's
> not possible.  It seems that unless a state is very specific to a
> particular command, we should recommend people create new action
> functions over action states.

I've recommended that several times, although mostly because it makes
writing functions easier (the main functions, using _arguments).

> ...
> >
> >We should be careful how we document this. It should be a way of
> >tweaking available completions to fake extra matches and should not be
> >a substitute for writing functions.
> 
> This is the sort of feedback I was interested in.  Though, it's not
> clear to me why a completion function is better. 

My personal reason would be that I'd want to not fall into the compctl-
trap again.

> I've sort of thought
> that making a completer that got much of it's information via styles
> might be easy to create.

Yes, leaving the work for the users that have to set the styles (and if
we are talking about those things I thik we are talking about, then there
wouldn't be any defaults we could use for the styles). It might make sense
to write some generic completer using lots of styles so that people have
a way to `easily' create completions of their own, but I doubt it would be
much easier than writing a little function, especially if the completion
has to do anything useful. And how would that completer differ from
_generic? Maybe we could just improve that one...

> >>  * A completer for printf format strings using the "%" string.  I
> >>  think the real benefit would be the ability to see documentation for
> >>  the different format characters.
> >
> >Yes it would be useful but perhaps a little messy to implement. I
> >thought about doing printf completion for printf as opposed to find
> >which is less useful. I suspect that this might be a good place to use
> >_regex_arguments but I've yet to look in any detail.
> 
> I believe _regex_arguments is more for complex groups of flags/arguments
> not for dealing with completion within a string, but could be wrong.

Like most people I've never really taken the time look into _regex_arguments,
but I guess it's capable of doing this. Dunno if it would be easier (to write
and read) then writing some hand-crafted shell code for it. The C-code
contains the parsing code for this...

Bye
  Sven


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zstyle for _arguments feature request
  2001-12-07 12:26 ` Oliver Kiddle
@ 2001-12-10 23:24   ` Felix Rosencrantz
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Rosencrantz @ 2001-12-10 23:24 UTC (permalink / raw)
  To: Oliver Kiddle, zsh-workers

Oliver Kiddle wrote:

>Yes, this could be useful. The form in which I'd like to see it in is a
>more general version of the fake-files and fake-parameters styles and
>available in all contexts as opposed to just in _arguments.

I think that would be ok.  Though it would also be nice to remove
some|all entries from the list being provided to the user.  Also, it
would be nice to provide help text for items.  I don't think that can be
currently done with the fake-* styles.

Also, since I was limiting the scope to _arguments, it would be possible
to provide alternative action function or state.

>>    _find the -fstype flag spec is missing ext2 used by linux:
>>
>>     '*-fstype:filesystem type:(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' \
>
>In the case of this specific issue, should we maybe factor the
>filesystem completion out of _mount into a new _filesystems that can
>also be used here?

Yes, something like that could be done for this specific case.  Playing
with the completion generation stuff, I find that I want to use code
from the "state" actions of existing completion functions a lot.  It's
not possible.  It seems that unless a state is very specific to a
particular command, we should recommend people create new action
functions over action states.

>>    It seemed that this would be a new use for zstyle, and people
>>    might have some comments wrt using zstyle to define the completion
>>    rather than just modifying the behavior of completion.
>
>We should be careful how we document this. It should be a way of
>tweaking available completions to fake extra matches and should not be
>a substitute for writing functions.

This is the sort of feedback I was interested in.  Though, it's not
clear to me why a completion function is better.  I've sort of thought
that making a completer that got much of it's information via styles
might be easy to create.

>>  * A completer for printf format strings using the "%" string.  I
>>  think the real benefit would be the ability to see documentation for
>>  the different format characters.
>
>Yes it would be useful but perhaps a little messy to implement. I
>thought about doing printf completion for printf as opposed to find
>which is less useful. I suspect that this might be a good place to use
>_regex_arguments but I've yet to look in any detail.

I believe _regex_arguments is more for complex groups of flags/arguments
not for dealing with completion within a string, but could be wrong.

-FR.


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: zstyle for _arguments feature request
  2001-12-06 20:12 Felix Rosencrantz
@ 2001-12-07 12:26 ` Oliver Kiddle
  2001-12-10 23:24   ` Felix Rosencrantz
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2001-12-07 12:26 UTC (permalink / raw)
  To: Felix Rosencrantz; +Cc: zsh-workers

Felix Rosencrantz wrote:
> 
> I sent message workers/15664 back in August, but there was no response.
> 
> I was asking two things:
>  * a feature request that would make it possible to override/edit the
>    action field of an _arguments specification via zstyle.  For example in

Yes, this could be useful. The form in which I'd like to see it in is a
more general version of the fake-files and fake-parameters styles and
available in all contexts as opposed to just in _arguments.

>    _find the -fstype flag spec is missing ext2 used by linux:
> 
>     '*-fstype:filesystem type:(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' \

In the case of this specific issue, should we maybe factor the
filesystem completion out of _mount into a new _filesystems that can
also be used here? 

>    It seemed that this would be a new use for zstyle, and people might
>    have some comments wrt using zstyle to define the completion rather
>    than just modifying the behavior of completion.

We should be careful how we document this. It should be a way of
tweaking available completions to fake extra matches and should not be
a substitute for writing functions.

>  * A completer for printf format strings using the "%" string.  I think
>    the real benefit would be the ability to see documentation for
>    the different format characters.

Yes it would be useful but perhaps a little messy to implement. I
thought about doing printf completion for printf as opposed to find
which is less useful. I suspect that this might be a good place to use
_regex_arguments but I've yet to look in any detail.

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp


^ permalink raw reply	[flat|nested] 4+ messages in thread

* zstyle for _arguments feature request
@ 2001-12-06 20:12 Felix Rosencrantz
  2001-12-07 12:26 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Rosencrantz @ 2001-12-06 20:12 UTC (permalink / raw)
  To: zsh-workers

I sent message workers/15664 back in August, but there was no response.

I was asking two things:
 * a feature request that would make it possible to override/edit the
   action field of an _arguments specification via zstyle.  For example in
   _find the -fstype flag spec is missing ext2 used by linux:

    '*-fstype:filesystem type:(ufs 4.2 4.3 nfs tmp mfs S51K S52K)' \

   It would be useful if via zstyle, I could tweak this action to add
   ext2 (or whatever fstype I wanted to add/remove) without having to
   edit _find.

   It seemed that this would be a new use for zstyle, and people might
   have some comments wrt using zstyle to define the completion rather
   than just modifying the behavior of completion.

 * A completer for printf format strings using the "%" string.  I think
   the real benefit would be the ability to see documentation for
   the different format characters.

-FR.


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-12-11 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11 12:35 zstyle for _arguments feature request Wischnowsky, Sven
  -- strict thread matches above, loose matches on Subject: below --
2001-12-06 20:12 Felix Rosencrantz
2001-12-07 12:26 ` Oliver Kiddle
2001-12-10 23:24   ` Felix Rosencrantz

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).