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

Re: PATCH: _x_arguments too broad



Oliver Kiddle wrote:

> Clint Adams wrote:
> > 
> > zsh 433 % /usr/bin/X11/imake <TAB>-display
> > -display    -geometry
> > 
> > Not very useful.  OTOH, /usr/openwin/bin/imake will
> > complete files, which is perhaps more desirable in
> 
> It may not be useful but it does offer files aswell so isn't doing any
> great harm, especially for people like me who have their styles
> configured to only complete options after an initial prefix.

Note also that this (prefix-needed=yes) is the default value for the
style, so it will hurt only people who explictily turn it off.

> > this instance.  Since not every binary in */X11/*
> > is going to take -display and -geometry, and most
> > are likely to take other arguments, a better solution
> > is needed.
> 
> Maybe a better solution is needed but your patch doesn't offer such a
> solution. I would prefer that it is not included because the vast
> majority of programs in */X11/* do take -display and it is useful to be
> able to complete it. If there is a particular program where it is
> annoying you such as imake, you can always write a custom completion for
> it. The */X11/* is in my opinion better than having a huge list of
> programs after #compdef in _x_arguments.

I second that.

I think Clint's patch was in response to the article/mail on one of
the Debian lists which I found and which made me add file-completion
to _x_arguments. Hm, we could make it call _default instead...

The patch is relative to the CVS so it also turns the #autoload back
into a #compdef (with a slightly different pattern then before; are
there still systems with X11R[45]?).

Bye
 Sven

diff -ru ../z.old/Completion/X/_x_arguments Completion/X/_x_arguments
--- ../z.old/Completion/X/_x_arguments	Tue Feb 22 09:11:00 2000
+++ Completion/X/_x_arguments	Tue Feb 22 09:59:27 2000
@@ -1,4 +1,4 @@
-#autoload
+#compdef -P */X11(|R[456])/*
 
 local ret long xargs
 
@@ -7,7 +7,7 @@
   '-geometry:geometry:_x_geometry'
 )
 
-(( $# )) || xargs=( "$xargs[@]" '*:files: _files' )
+(( $# )) || xargs=( "$xargs[@]" '*:default: _default' )
 
 long=$argv[(I)--]
 if (( long )); then

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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