zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: new fake style, completion grouping etc
Date: Mon, 4 Feb 2002 09:57:27 +0100	[thread overview]
Message-ID: <15454.19703.823266.240649@wischnow.berkom.de> (raw)
In-Reply-To: <3C5ACA44.BC014084@yahoo.co.uk>


Oliver Kiddle wrote:

> ...
> 
> > Yes.  Problem is the way _guard is called -- we can't easily get at
> > the tag there (inside _guard) which would be needed to make sure the
> > description is attached to the same group of matches as the faked
> > matches (when the group-name style is used) -- otherwise the
> > description would be shown more than once.  I'll think about this some
> > more.
> 
> Argh. I can't think of anything better than _guard also needing to be
> passed -e <tag>. Perhaps we should have _guard special cased as a form
> of action in _arguments etc (despite my wish that _arguments were
> simpler, utilising more separate functions). I'd have suggested
> factoring out the action code from _arguments/_alternative etc if it
> didn't mess up due to the internal tags use of the function stack.

But in the case of _arguments, the tag is created created
automatically, so the user couldn't know it (well, he could know it
beacuse we know how they are constructed, but...).

Maybe we should make _guard derive the name from the -[JV] argument,
that would be saver than it sounds (the group name is set from the
group-name style, which is tag for most people using it at all, and it
would ensure that the matches are really in the same group).

> ...
> 
> This is a hard one. It's a pity that the faked matches get added before
> the real ones.

Yes, I've wished for a way to add them at the same time, too. But
writing a `compadd' function to allow this is a bad idea, I think.

> Searching through the completion system, I can't find any place where
> we actually use both a sorted and unsorted group of matches together
> with the same group-name. I realise it would be a big change but what I
> would suggest would be to do away with the separate namespaces for
> sorted and unsorted groups and just have a variable for each group to
> identify the sorting style. This might then make it easy to have a
> style which could change the sorting style for a particular group of
> matches.

I've thought about this, too, several times, but didn't dare it yet.
Maybe we should just do it and make 4.1 the phase of completion code
cleanup.

This wouldn't really help in this case, though. Because _describe adds
the matches with -V to be able to get the right layout. If one of the
real matches gets added earlier, the list display will get messed up.

> ...
> 
> Sven Wischnowsky wrote:
> > 
> > > ./Y03arguments.ztst: test failed.
> > 
> > Grrrr... that's a result of the fake style patch. Previously, with a
> > function containing:
> > 
> >   _argument '-x' ':arg:'
> > 
> > doing
> > 
> >   foo -<TAB>
> > 
> > didn't insert anything and displayed be message `arg'.
> 
> And it offered -x as a match (but not completing it) too right?

Yes.

> > This was done by some code in _main_complete which I had to change
> > because otherwise adding completing a faked matched for the `arg'
> > above wouldn't work. Quite naturally, actually.
> 
> The old behaviour seemed right to me but I don't entirely understand
> why the fake style required the change.

If you added some fake matches and completed them everything worked
fine until there was only one string matches the stuff on the line
left. That one you couldn't complete.


Bye
  Sven

-- 
Sven Wischnowsky                           wischnow@berkom.de


  reply	other threads:[~2002-02-04  8:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-18 18:24 Re PATCH _file_systems & Re zstyle for _arguments feature request Oliver Kiddle
2002-01-22 10:19 ` Sven Wischnowsky
2002-02-01 17:03   ` new fake style, completion grouping etc Oliver Kiddle
2002-02-04  8:57     ` Sven Wischnowsky [this message]
2002-02-05 16:13       ` Oliver Kiddle
2002-02-05 16:24         ` Sven Wischnowsky
2002-02-06  9:33           ` Oliver Kiddle
2002-02-06 10:49             ` Sven Wischnowsky
2002-02-06 15:57               ` Oliver Kiddle
2002-02-25  9:07             ` Sven Wischnowsky
2002-02-25  9:10               ` Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15454.19703.823266.240649@wischnow.berkom.de \
    --to=wischnow@berkom.de \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).