From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1303 invoked from network); 3 Nov 1998 18:14:06 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 Nov 1998 18:14:06 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id NAA27272; Tue, 3 Nov 1998 13:12:22 -0500 (EST) Resent-Date: Tue, 3 Nov 1998 13:12:22 -0500 (EST) To: Bruce Stephens Cc: wischnow@informatik.hu-berlin.de, zsh-workers@math.gatech.edu Subject: Re: PATCH: 3.1.5 - (Sven) Case-insensitive globbing References: <199811030812.JAA23176@beta.informatik.hu-berlin.de> From: Jarkko Hietaniemi Date: 03 Nov 1998 20:09:49 +0200 In-Reply-To: Bruce Stephens's message of "3 Nov 1998 14:39:13 +0200" Message-ID: X-Mailer: Gnus v5.6.34/Emacs 19.34 Resent-Message-ID: <"UDd073.0.3g6.5UqFs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4520 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu : Approximate matching could either use the auto-correct code, or could : use something like whatever agrep uses. In the latter case, it would : have an optional integer parameter too, so "(#a1)readme" would match : "Readme" and "read.me", but to match "read", you'd need "(#a2)readme". Hey! This is getting interesting...I may be able to offer my help to the zsh community (after a long slumber). It so happens that I have been slowly implementing from scratch the approximate matching algorithm(s) used in agrep. My intention has been to encapsulate them into a nice library. I tried doing that from the agrep 2.04 (the version that comes with Glimpse, not the version at ftp.cs.arizona.edu), but that's a little bit hard: agrep as it now stands uses dozens of global variables, is not re-entrant, has certain hard-coded limitations, et cetera. There are several different algorithms used in agrep: Boyer-Moore, vanilla regexp, vanilla approximate, approximate + regexp, multistring search. I intend only to implement the fuzzy ones and for filename globbing the vanilla approximate algorithm should be enough. I am implementing the library under the Artistic License (available from the Perl distribution) so there should be no trouble including it into zsh, right? Of course, if you need the approximate matching code, like, today or tomorrow, sorry, no can do, I am rather busy with other projects. If I really work on it it will take couple of weeks to implement and test (benchmark and regress-test it against agrep). Interested? P.S. To further confuse the issue of filename globbing: ta-dah, yet another idea! :-) But first off: sorry if the following feature already exists in zsh --- I haven't been following the development (aka the feeping creaturism :-) of zsh that closely lately. The feature: "union directories" aka "multiple working directories" aka "virtual directories". Instead of having just a single directory to glob/expand filenames from, how about having several of them: "a path of cwds". Yes, this may be *really* confusing -- but I often find myself at least temporarily wishing for something like that. There are open issues like for example what to do when several identically named files match: just take the first one / take all of them / abort and tell that there are several possibilities / other? -- $jhi++; # http://www.iki.fi/~jhi/ # There is this special biologist word we use for 'stable'. # It is 'dead'. -- Jack Cohen