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: Mon, 11 Feb 2002 10:12:43 +0100	[thread overview]
Message-ID: <15463.35595.321048.104361@wischnow.berkom.de> (raw)
In-Reply-To: <20020208094052.89650.qmail@web9307.mail.yahoo.com>


Oliver Kiddle wrote:

> Bart wrote:
> > 
> > Right again, so far ... however, in looking at my own _complete_debug
> > output *before* applying your patch, the odd thing is that the first
> > compadd is failing for no apparent reason.  That is, for completion
> after
> > `lll@', it does `tmp=(bbb.com)' and `compadd -F _comp_ignore -a tmp',
> > but even though bbb.com is not ignored, still the compadd returns 1.
> 
> I can't reproduce that.

You need to set some ignored-patterns styles to split into host,
host-with-domain and ip-address.

> ...
> 
> Only dividing tags into labels before compadds might be a way to
> solve this. I need to investigate further because I don't fully
> understand how tags and labels work. I may have badly misunderstood
> things so far. Sven?

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.

One way to circumvent most problems with tag and label loops is to
make _combination loop:

--- Completion/Base/Utility/_combination	Mon Apr  2 13:10:08 2001
+++ _combination	Mon Feb 11 09:38:06 2002
@@ -88,7 +88,9 @@
   fi
   tmp=( ${tmp%%${~sep}*} )
 
-  compadd "$@" -a tmp || { (( $+functions[_$key] )) && "_$key" "$@" }
+  local expl
+  _wanted $key expl $key  compadd "$@" -a tmp ||
+      { (( $+functions[_$key] )) && "_$key" "$@" }
 else
   (( $+functions[_$key] )) && "_$key" "$@"
 fi


This patch can't be complete, though (only something to play with and
then decide if we want to go this way), because to make this right we
need to pass _combination a description.

> This is unrelated but out of interest, why is the _next_labels stage
> skipped in some completion functions?

Could you ive me an example, so that I don't need to search?


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


  parent reply	other threads:[~2002-02-11  9:14 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 [this message]
2002-02-11 18:04         ` Bart Schaefer
2002-02-12  9:18         ` Oliver Kiddle
2002-02-12 13:16           ` Sven Wischnowsky
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=15463.35595.321048.104361@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).