zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: Open bugs and questions?
Date: Tue, 1 Aug 2000 12:58:42 +0200 (MET DST)	[thread overview]
Message-ID: <200008011058.MAA06701@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 1 Aug 2000 13:46:04 +0400


Andrej Borsenkow wrote:

> Currently tags are used for two completely different tasks:
> 
> - as names for group of generated matches

I guess you mean `type' (at least that's what we called it in the docs ;-)

They are not used as `names for' what we call `groups'. Group names
are set with the group-name style. It's just that we offer a very
convenient way to name groups after the tags, so that all possible
groups have different names.

> - as special configuration parameters, used by some completion functions

Used to disambiguate between different meanings/uses of a style or to
simplify forming sensible context strings when defining styles.

I agree that this isn't very clean, but I don't have much problems
with it, actually. And it's documented (above the tag list).

> I never liked this; I believe, it originates in times when we did not have
> strict context names. Currently it is
> 
> - confusing.
> - limits configuration possibilities
> 
> What I mean under "limitations" - consider e.g. "hosts" tag. That is used for
> list of hostnames. But because it is tag, I can use it just once for a given
> context (a.k.a. command parameter). But I could quite sensibly wish two host
> sets - "trusted-hosts" and "untrusted-hosts" and complete them differently
> using two different lists. This is not (easy)possible now, unless I miss
> something.

If you can distinguish the elements of the two sets (and with a
complete list this is always possible), use tag labels.

Otherwise you want a way to influence how *often* the completion
functions generate matches and *which* matches on each try. Even that
is possible (either with tag labels or with completer-labels). But
styles weren't really thought to offer the possibilty to re-programme
completion functions. So, if you feel that you have to (or more)
completely different *types* of hosts (or whatever) -- copy and modify 
the functions completing hosts (or whatever). That's what they are for.

> Such tags simply do not fit into context idea because they represent static
> configuration parameter (valid gor completion function) rather then dynamic
> (valid for a given context).
> 
> Another example is:
> 
> bor@itsrm2% gdiff
> tags in context :completion::complete:gdiff::
>     argument-1 options  (_arguments _diff_options _diff)
> ags in context :completion::complete:gdiff:argument-1:
>     all-files  (_files _arguments _diff_options _diff)
> 
> Do we ever complete using tag argument-1? What I mean, is - it may be used
> internally by _arguments - but can user use it? Can it be used to set styles?
> As I understand, user sees context xxx:argument-1. I.e. in the above case we
> either complete tag "options" in context ":completion::complete:gdiff::" or
> tag "all-files" in context ":completion::complete:gdiff:argument-1:".

I agree that his isn't that nice and I wasn't too happy with it. But,
yes, they *are* used. And you can set styles for it and they will be
used, for example when the completion function uses an action of the
form `(a b c)'. In that case we don't have another way to get at a tag 
than by using the automatically created one.

> What I'd like to see is
> 
> - remove all "dummy" tags that are used only to look up styles

Eh? If they are used to look up styles, they are obviously used.

> - replace them with real per-context styles

I don't understand that, I think. Or do you mean that we should get
rid of the tags and rename the styles so that the style name itself is 
enough to disambiguate? And if you mean that: we already renamed
styles (twice, I think) to make this possible. So, if you know of any
styles we missed, tell us about them.

> - conssitently use "default" tag to setup default values for any context (I'd
> actually call it "-default-" to stress it's specialness).

Again: could you give us examples where you would want to set default
values for styles where you can't use `:completion:*' as the context
pattern?

> - do not list tags that may be used by completion system internally

Agreed, and I actually thought about this, too. By the fact that I
didn't send a patch you can see that I don't really know how to do
this (I haven't thought that much about it, though, having been busy
with a lot of other things at the time).

Bye
 Sven


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


             reply	other threads:[~2000-08-01 10:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-01 10:58 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-08-02 12:08 Sven Wischnowsky
2000-08-02 16:24 ` Bart Schaefer
2000-08-01  9:00 Sven Wischnowsky
2000-08-01  9:19 ` Peter Stephenson
2000-08-01  9:46 ` Andrej Borsenkow
2000-08-01 15:09 ` 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=200008011058.MAA06701@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).