zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: _file_systems & Re: zstyle for _arguments feature request
@ 2002-01-08  6:26 Felix Rosencrantz
  2002-01-08  8:26 ` Sven Wischnowsky
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Rosencrantz @ 2002-01-08  6:26 UTC (permalink / raw)
  To: zsh-workers

I tried it.  And there seems to be a bug, something seems to be called twice. I
added a fake style to enscript --font.  It seems like _description got called
twice.  Since the description was listed twice.  Also, to actually set the fake
style, I had two double the argument field twice.

Is there a way to remove an existing item?   So if completion would generate a
word, is way to have it not be listed/provided as an option.

Otherwise, it looks good to me, and I would say worthwhile.

-FR.

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: PATCH: _file_systems & Re: zstyle for _arguments feature request
@ 2002-01-22  2:35 Felix Rosencrantz
  2002-01-28 16:37 ` Sven Wischnowsky
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Rosencrantz @ 2002-01-22  2:35 UTC (permalink / raw)
  To: zsh-workers

I really like the new fake parameter.

Though there is a possible strange behavior.  I'm not sure how multiple
matches are handled in other situations, so this might just be how
completion works.

Given these commands:

host@ zstyle :completion::complete:cvs-admin:option-k-1:option-k-1 fake
b:binary
host@ cvs admin -k<TAB>
---- keyword substitution
b  -- binary
b    k    kv   kvl  o    v

I wanted to add help text to options to the -k flag.  I was able to do that,
however, "b" is now listed twice. (As well as any other options to which I
add help.)


I'm happy with the new functionality.  Thanks Sven!  Since I'm already using
it,  I'd like to see that change committed.  :)

-FR.


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: PATCH: _file_systems & Re: zstyle for _arguments feature request
@ 2002-01-09  7:19 Felix Rosencrantz
  2002-01-10 13:46 ` Sven Wischnowsky
  0 siblings, 1 reply; 14+ messages in thread
From: Felix Rosencrantz @ 2002-01-09  7:19 UTC (permalink / raw)
  To: zsh-workers

Sven Wischnowsky wrote:
>Err... pardon? ;-) Could you give us a code snippet to easily
>reproduce this? I currently don't have that much time, sorry.

Sorry about that.  I'm writing from another system.
Here's something a little more specific.

I tried using the default completion for "enscript --font"

@ enscript --font []<TAB>
---- fontname
@ zstyle :completion::complete:enscript:option--font-1:option--font-1 fake
'font3:This is font3' font4:Four font5
@ enscript --font []<TAB>
---- fontname
---- fontname
<Then the correct font*'s are listed...>

Notice the "---fontname" description listed twice, and the need to specify the
"option--font-1" twice in the zstyle.  Something looks like it is being called
twice incorrectly.

-FR

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/


^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: PATCH: _file_systems & Re: zstyle for _arguments feature request
@ 2001-12-11 15:38 Wischnowsky, Sven
  0 siblings, 0 replies; 14+ messages in thread
From: Wischnowsky, Sven @ 2001-12-11 15:38 UTC (permalink / raw)
  To: zsh-workers


Oliver wrote:

> ...
> 
> You mean ignored-patterns right?

Ahem, right :-}

> ...
> 
> I suggest we just try something and see how it goes. Locating it in
> _description might work, assuming that the tag is in the 
context when
> the style is looked up. It might be a bit strange where 
more than one
> compadd is used to add matches.

Yes.

> ...
> 
> I'm not sure I like that much. We'd just end up with a 
style syntax for
> _generic growing into a compctl like thing. And, we'd find ourself
> having to graft much of this syntax onto every function.

Yes, that's what I want to avoid.

> Another method that might make things a little easier for 
> user's unsure
> about writing whole functions would be to allow simple one line
> completions to be defined thusly:
> 
> compdef '_files -g "*.c"' lcc
> compdef 'compadd one two three' count
> 
> It might be generally useful to allow arguments in the values of
> _comps anyway.

I quite like that idea, doesn't look too hard to implement (that's
me, trying to go through the completion system code in my brain,
sitting in front of this Windows box; but the linux install on my
new machine will be done in a few minutes and then I only need the
network patched and a cable to not feel castrated anymore ;-).

Bye
  Sven


^ permalink raw reply	[flat|nested] 14+ messages in thread
* PATCH: _file_systems & Re: zstyle for _arguments feature request
@ 2001-12-11 15:24 Oliver Kiddle
  2002-01-07 14:45 ` Sven Wischnowsky
  2002-01-07 14:47 ` Sven Wischnowsky
  0 siblings, 2 replies; 14+ messages in thread
From: Oliver Kiddle @ 2001-12-11 15:24 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 3377 bytes --]

Sven wrote:

> Felix wrote:
> > 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?

You mean ignored-patterns right?

> 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.

I suggest we just try something and see how it goes. Locating it in
_description might work, assuming that the tag is in the context when
the style is looked up. It might be a bit strange where more than one
compadd is used to add matches.

> > I find that I want to use code
> > from the "state" actions of existing completion functions a lot.
> > It's not possible.
> 
> I've recommended that several times, although mostly because it makes
> writing functions easier (the main functions, using _arguments).

Yes, it is a good recommendation.

Patch to factor out a new _file_systems is below. The old _mount wasn't
even completing after umount -t so I'll apply this to 4.0 too.

> > >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'd agree with that reason.

> 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...

I'm not sure I like that much. We'd just end up with a style syntax for
_generic growing into a compctl like thing. And, we'd find ourself
having to graft much of this syntax onto every function.

Another method that might make things a little easier for user's unsure
about writing whole functions would be to allow simple one line
completions to be defined thusly:

compdef '_files -g "*.c"' lcc
compdef 'compadd one two three' count

It might be generally useful to allow arguments in the values of
_comps anyway.

Oliver

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

[-- Attachment #2: fs.dif --]
[-- Type: application/x-unknown, Size: 9457 bytes --]

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

end of thread, other threads:[~2002-01-28 16:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-08  6:26 PATCH: _file_systems & Re: zstyle for _arguments feature request Felix Rosencrantz
2002-01-08  8:26 ` Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2002-01-22  2:35 Felix Rosencrantz
2002-01-28 16:37 ` Sven Wischnowsky
2002-01-09  7:19 Felix Rosencrantz
2002-01-10 13:46 ` Sven Wischnowsky
2002-01-14 12:34   ` Oliver Kiddle
2002-01-18  8:47     ` Sven Wischnowsky
2001-12-11 15:38 Wischnowsky, Sven
2001-12-11 15:24 Oliver Kiddle
2002-01-07 14:45 ` Sven Wischnowsky
2002-01-07 14:47 ` Sven Wischnowsky
2002-01-07 16:06   ` Oliver Kiddle
2002-01-21 16:09     ` Sven Wischnowsky

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).