zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@berkom.de>
To: zsh-workers@sunsite.dk
Subject: Re: ssh completion problem
Date: Tue, 12 Feb 2002 14:16:45 +0100	[thread overview]
Message-ID: <15465.5565.960990.977033@wischnow.berkom.de> (raw)
In-Reply-To: <20020212091854.12456.qmail@web9306.mail.yahoo.com>


Oliver Kiddle wrote:

> ...
> 
> Did you try the first patch? The second patch was there because it
> demonstrates why I think this problem is more fundamental than just
> _combination. If you just want to get this working, Sven's patch is
> now perhaps a better bet as I see you've now done. Needing two tabs
> is a separate issue which has come up before.

Right, I forgot to answer that.

> A possible solution
> to that might be some value in compstate which if set causes
> completion to have another go if a first match was unambiguously
> added.

I'd try to do that all in shell code, i.e. in _main_complete, but, as
with the fake style, ...

> It'll be more complicated if l@b is to complete to lll@bbb.com
> though.

...I think we should also do that in those utility functions, where it
is useful, i.e. _user_at_host. At least that was the idea we had at
the bginning, leading to functions like _sep_parts.

> ...
> 
> > Your analysis is basically right, the problem is that _combination
> > doesn't know whether there might be other matches be added for the
> > tag
> > by an outer loop. So I think what is wrong here is _combination
> > adding
> > default matches. I'd think that's simlpy the wrong place to do that.
> 
> Where is the right place to add default matches then?

In the function where the outer loops are, because only there can we
know what other things are to be completed (after all, it's not only
different labels, there might be completely other types of matches --
different tags -- the outermost function will offer).

Of course, as can be seen by the _combination example we are talking
about, functions in the inner circle might have good ideas about *how*
to produce those matches. I've been realtively silent not only because
I have a lot of work here, but also because I'm trying to find a
generic approach to all this.

> Having a way to
> specify a default tag-order would seem the most logical to me.

I'd like to hear more about this (so that I understand what exactly
you mean) and how it could solve -- as an example -- the case we are
discussing here. Maybe you are thinking about something similar and
have a solution in mind?

> > One way to circumvent most problems with tag and label loops is to
> > make _combination loop:
> 
> With this there is then two loops for the hosts tag. The inner loop
> allows it to loop over the three labels again so it knows if matches
> are added for each label or not. Note that there are then nine calls to
> compadd. It only works because the final (innermost) label loop is for
> the same tag that is separated into labels. I still am convinced that
> there is a wider problem which this doesn't solve. The second patch
> in my last post is a useful one for seeing the problems.

Yes, I know how this works ;-) And I also see that this is a wider
problem (see above). If I had thought this were the solution, I'd have
committed the patch.

> > > This is unrelated but out of interest, why is the _next_labels
> stage
> > > skipped in some completion functions?
> > 
> > Could you give me an example, so that I don't need to search?
> 
> _netscape. There's also a few cases which look like `_requested users
> && _users && ret=0' but I suppose they're okay because of _users
> calling _wanted? 

I don't see such a case there. Are you aware that _wanted and
_requested use _all_labels which implements the labels-loop?


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


  reply	other threads:[~2002-02-12 13:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1020205170847.ZM29675@candle.brasslantern.com>
2002-02-06  9:00 ` Oliver Kiddle
2002-02-07  1:54   ` Bart Schaefer
2002-02-08  9:40     ` Oliver Kiddle
2002-02-08 18:26       ` Bart Schaefer
2002-02-11  9:12       ` Sven Wischnowsky
2002-02-11 18:04         ` Bart Schaefer
2002-02-12  9:18         ` Oliver Kiddle
2002-02-12 13:16           ` Sven Wischnowsky [this message]
2002-02-12 15:08             ` Oliver Kiddle
2002-02-12 15:20               ` Sven Wischnowsky
2002-02-15 17:15                 ` Oliver Kiddle
2002-02-18 14:28                 ` 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=15465.5565.960990.977033@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).