From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20119 invoked from network); 11 Mar 1997 17:34:36 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 11 Mar 1997 17:34:36 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id MAA20176; Tue, 11 Mar 1997 12:17:23 -0500 (EST) Resent-Date: Tue, 11 Mar 1997 12:17:23 -0500 (EST) Message-Id: <199703111719.SAA27160@hydra.ifh.de> To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: zsh-equivalent for tcsh option "set complete=enhance"? In-reply-to: "Zoltan Hidvegi"'s message of "Wed, 05 Mar 1997 22:22:41 MET." <199703052122.WAA31454@bolyai.cs.elte.hu> Date: Tue, 11 Mar 1997 18:19:55 +0100 From: Peter Stephenson Resent-Message-ID: <"a8fWj.0.Bx4.ZEP9p"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2979 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Zoltan Hidvegi wrote: > >From wischnow@informatik.hu-berlin.de Thu Oct 31 13:06:39 1996 > Because of that I won't be able to port the patch below to a newer > version, so I'm sending it for 2.6beta19 (sorry). > > It contains some thing I was playing with for some years now, in > short: > > - Completion character equivalence classes: some characters can stand > for others when completing (e.g. `-' can stand for `-' and `_'), > this is under complete user control. > - An option to make completion case-insensitive. I thought about this and (although I don't myself writing it without several years more experience in the relevant code) I don't see why it shouldn't be a little more general and in some sense zsh-like. What I had in mind was that instead of using global arrays there is an extra option to compctl (say -M for modify match) that says what can be done to the command argument to make it match the candidate. For example, -M 'c,E[[-_],],e[no,],E[\?,[A-Za-z]]' says: - this completion is to be performed with case-fold search (you'll see this is the same as E[[A-Za-z],[A-Za-z]], but this is probably common enough for a shorthand) - any _ or - in the argument matches the empty string in the candidate (and hence should be discarded) --- E specifies pattern matching - likewise, the string 'no' is to be replaced with an empty one; (e for a string; the e/E distinction is like extended completion) [this replaces all no's, not just at the beginning, haven't thought what to do about that] - a real ? (because quoted) in the argument is equivalent to a single alphabetic character in the candidate. So, with the above setopt no_SH_WO?D_SP -> no_SH_WO?D_SPlit ^ not actually any use, just an example Maybe a general pattern behaviour like this is too difficult and it needs instead to involve character classes and strings instead. I've really no idea whether this double pattern matching is feasible in an efficient fashion. In fact, this is obviously going to be a lot slower than Sven's proposal, although one only gets the overhead when one needs it. -- Peter Stephenson Tel: +49 33762 77366 WWW: http://www.ifh.de/~pws/ Fax: +49 33762 77413 Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen DESY-IfH, 15735 Zeuthen, Germany.