zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@math.gatech.edu
Subject: Re: compctl -Tx 'w[0,...] ...' ...
Date: Tue, 30 Sep 1997 08:44:42 +0200	[thread overview]
Message-ID: <9709300644.AA08755@gamma.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 29 Sep 1997 21:57:19 -0700


"Bart Schaefer" wrote:

> ...
> 
> What I want is a completion that applies to *all* commands, as do -D and
> -T, but that is triggered *after* any other completion provided for any
> specific command.  I guess I could get the effect by altering every other
> completion I ever define to end with the "continue using default" switch;
> but that means keeping my own edited copies of all the examples from the
> zsh dist, etc.
> 

(That's what I meant.)

After implementing the `+' style completion and using it for some time
I was thinking about adding a option for automatically using `-D'
completion if everything failed. But then Bas described how he got
used to using `+' at the end of almost all his compctls and noone
really complained about missing such a feature. It was quite easy to
implement (and I even had it in one of my private version), but it was
the time when many people were saying things like `let's keep zsh
small, no more options, ...', so I hesitated to suggest it.

>
> ... (using pattern matching to select a compctl) ...
> 
> I'm pretty sure I requested it myself ... an example would be to set up a
> compctl so that every command matching `x*' would accept the standard X
> toolkit completions (-display, -xrm, etc.).  The reason it might be hard
> is because you could end up with multiple different compctl lines that
> match the same command:
> 
> compctl -k '(-display -geometry -xrm)' x*
> compctl -k hosts xhosts
> 
> How would the ambiguity be resolved?
> 

(Maybe your request just failed to wake me up...)

Still I think it wouldn't be too hard to implement. The code already
has some `if no matches found, try again with...' in it. So the above
would turn into: try to find the command name in the compctl
hashtable, if it can't be found, just look at all hashtable entries
(optimised to use only entries with patterns, determined at definition
time), see if they match the current command name and if they do, try
them to produce matches. This could also be used to try multiple
pattern-compctls until one produces matches, whereas the `-Tx W[..]'
thing would only use the flags of the first matching `W[...]'.
One problem may be that the compctls are (of course) in no particular
order...


Bye
 Sven


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


             reply	other threads:[~1997-09-30  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-30  6:44 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-09-29  6:29 Sven Wischnowsky
1997-09-30  4:57 ` 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=9709300644.AA08755@gamma.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).