From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25183 invoked from network); 26 Jun 1998 05:51:12 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 26 Jun 1998 05:51:12 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id BAA16171; Fri, 26 Jun 1998 01:42:48 -0400 (EDT) Resent-Date: Fri, 26 Jun 1998 01:42:48 -0400 (EDT) Date: Fri, 26 Jun 1998 07:44:04 +0200 (MET DST) Message-Id: <199806260544.HAA16475@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-reply-to: "Bart Schaefer"'s message of Thu, 25 Jun 1998 12:08:36 -0700 Subject: Re: Compctl completion tweaking Resent-Message-ID: <"AuN_u.0.cy3.OJpar"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4171 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu "Bart Schaefer" wrote: > > ... > > Yes; the confusion occurs when two or more of the "bunches of flags" both > would apply if only both were tried. Even extended completion performs > an xor (it stops as soon as any pattern matches); how do you accomplish > an -inclusive- or? Suppose I want to express this: > > If there is a word anywhere on the command line that begins with "co", > then complete file names. In addition, if that word begins with "cons", > then complete directories as well. Finally, if the word before the > current word is the name of a directory, then also complete commands. > > That is, if I have > > zsh% foo cons /tmp z > > and I press C-d, I want to see a list of files, directories, and commands > whose names begin with z, all in the same list. > > (Yes, I admit this is a highly contrived example.) Currently the only way would be to use one `-x'-pattern for all three of them, one for two of them, and one for the `co' alone (in this order). So, if I understand you correctly, you really only want an an inclusive or and that only with menucompletion and listing? Do you want that to apply when automenu is used, too? That last one is important for me. My examples played with the difference between normal and menucompletion behaviour when automenu is set. More precisely: I don't want it to suddenly switch from one type of behaviour to the other. A simple inclusive or is (of course) achieved by putting the flags together without any `+', but that doesn't allow us to, e.g. define multiple `-K' options or multiple combinations of flags with some of the control-flags. If you wanted to point out this deficiency, I have to agree, this is quite ugly. And of course the problem to write down or'ed `-x'-patterns you mentioned sometimes makes compctls very big and clumsy (i.e. there should be a way to...). About the exclusively or'ed flags: my first example when I implemented this (which is also what made me think of it and the example mentioned in the intro file) is the compctl for things like `latex'. Normally I want `*.tex' files, but if there are none, I want something else (say `-f' or whatever). But *if* there are any `*.tex' files I don't want the completion code to use the xor'ed flags, I don't want to see them, I don't want to know about them (and thus, the completion code should not even bother to look at them). Maybe the experience for people using menucompletion is different here (I use only automenu), I would like to know about that. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de