From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21624 invoked from network); 1 Jul 1998 12:45:46 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 1 Jul 1998 12:45:46 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id IAA00826; Wed, 1 Jul 1998 08:20:38 -0400 (EDT) Resent-Date: Wed, 1 Jul 1998 08:20:38 -0400 (EDT) Date: Wed, 1 Jul 1998 08:13:11 +0200 (MET DST) Message-Id: <199807010613.IAA21953@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-reply-to: "Bart Schaefer"'s message of Tue, 30 Jun 1998 12:02:24 -0700 Subject: Re: Compctl completion tweaking Resent-Message-ID: <"TC9Ik1.0.rC.LcYcr"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4190 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: > ... > > This brings up a general question, then. Suppose for the moment that we > do choose ++ to mean inclusive-or. Suppose I have: > > compctl -x 'c[-1,-m]' -P '%' -u ++ -P '+' -f -W ~/Mail -- zmail > > I.e., "user names prefixed with % or files in ~/Mail prefixed with +". > What does the list of completions look like before any + or % is present > on the command line? If there's both a file and a user named "schaefer", > which prefix gets inserted? > This is one of the things I am worrying about (and which kept me from trying to implement it...). First, I would try to change the behaviour of -P (and -S) so that they are not inserted straight away, but instead saved together with the corresponding matches (one of the reasons to store prefixes and suffixes with the matches). Then, if we find out that only one prefix is used for all matches, it becomes easy. Otherwise (the case you described above), if menucompletion or automenu is used, the prefixes are walked through, too (note also, that storing prefixes and suffixes that have to be inserted into the command line with the matches inhibits removing matches that merely have the same matching word, so in your example we would have `schaefer' with `+' and `schaefer' with `%' in the list of matches). If menucompletion is not used, we could at least try to insert the unambiguous part (`schaefer'), leaving the cursor at the place where the ambiguous part began, the user would have to insert something to make it unambiguous, of course. In your example where we only had one-character-prefixes, this is pretty simple (typing either `+' or `%'). More problematic is the case where we have prefixes like, say `barrr' and `bazzz'. The completion code would insert the `ba', leaving the cursor after it to let the user make it unambiuous. With completeinword set, the user could type either `r' or `z' and then start completion to let zsh insert the rest, but without completeinword (and without automenu), the user would have to type `rrr' or `zzz' which is a bit ugly. So, does this seem to make sense? Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de