zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: wish for a colored completion system
Date: Tue, 13 Jun 2000 11:25:23 +0200 (MET DST)	[thread overview]
Message-ID: <200006130925.LAA29687@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Sat, 10 Jun 2000 03:34:09 +0000


Bart Schaefer wrote:

> On Jun 9,  9:24am, Sven Wischnowsky wrote:
> } Subject: Re: wish for a colored completion system
> }
> } Bart Schaefer wrote:
> } 
> } > I'm not sure why ':completion:*:ssh:*' doesn't work for the combined
> } > listing; perhaps it's a bug.  Sven?
> } 
> } Hm, yes, the description in the docs make it sound as if it should
> } work. The problem is that without separate groups there is no way for
> } the completion code to find out that with
> } 
> }   zstyle ':completion:*:ssh:*:hosts' list-colors '=a*=31'
> }   zstyle ':completion:*:ssh:*:users' list-colors '=b*=32'
> } 
> } hosts starting with `b' should be coloured with `32'. We would need a
> } per-match colouring for that and that's too expensive.
> 
> I think you misunderstood my question.  I didn't ask why
> 
>     zstyle ':completion:*:ssh:*:hosts' list-colors '=a*=31'
> 
> doesn't work.  I asked why
> 
>     zstyle ':completion:*:ssh:*' list-colors '=a*=31'
> 
> doesn't work.  There isn't any group involved there at all; I don't ask
> for the hosts to be colored separately from the users; I just ask for
> anything that happens to be there (and that begins with `a') to work.
> But it doesn't, unless I set group-name ''.

;-) I understood that -- and noticed that the part you quoted doesn't
answer the question. That's why the next paragraph started the way it
did:

> And to come back to the question, the completion code only looks up
> the style with the tag in the context and it can't find out that the
> pattern used in the definition doesn't contain the tag. If we wanted
> to solve that, we would have to make _setup get the name of the group
> (which may be -default-) as an argument (when called from
> _description) and use that name in ZLS_COLORS. But then we would be
> back to what I said above.
> 
> So, we could (quite easily) change it, but that set-for-one-tag-and-
> used-for-others-too made me do it in the way we have it now, I would
> be willing to write the change if people say that they prefer it,
> though (I have group-name == '', so I don't care much about this).

I.e. _setup just uses the tag in ZLS_COLORS, as you've seen. To get
this right, we would shouldn't just make the colors be (almost) always 
used (11847) because that works only for functions using the
argument-* tags. Probably even more confusing.

The problem is really that the code in _setup can't find out what
pattern was used when defining the style. It should use the value for
`...:*:ssh:*' everywhere but it should use the one defined for
`:...:*:ssh:*:hosts' only for names of hosts. But since complist only
distinguishes between groups (and it can only do that), a setting for
the latter pattern would be used for usernames, too, if they are in
the same group and we change the calls to _setup as I suggested (and
then make it use that group name when adding things to ZSL_COLORS, of
course).

Hrm, maybe we should admit this and use the group name instead of the
tag when looking up list-colors.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-06-13 10:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-13  9:25 Sven Wischnowsky [this message]
2000-06-18  4:42 ` Tags vs. groups, and ZLS_COLORS (Re: wish for a colored completion system) Bart Schaefer
2000-06-18  5:04   ` Bart Schaefer
     [not found] <200006090724.JAA13449@beta.informatik.hu-berlin.de>
2000-06-10  3:34 ` wish for a colored completion system Bart Schaefer
2000-06-10  4:38   ` Bart Schaefer
     [not found] <200006081449.QAA21570@beta.informatik.hu-berlin.de>
2000-06-08 16:02 ` Peter Stephenson
2000-06-08 17:40   ` Bart Schaefer

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=200006130925.LAA29687@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).