zsh-workers
 help / color / mirror / code / Atom feed
From: Jarkko Hietaniemi <jhi@cc.hut.fi>
To: Bruce Stephens <b.stephens@isode.com>
Cc: wischnow@informatik.hu-berlin.de, zsh-workers@math.gatech.edu
Subject: Re: PATCH: 3.1.5 - (Sven) Case-insensitive globbing
Date: 03 Nov 1998 20:09:49 +0200	[thread overview]
Message-ID: <oeesog0ejgy.fsf@alpha.hut.fi> (raw)
In-Reply-To: Bruce Stephens's message of "3 Nov 1998 14:39:13 +0200"


: 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".

<unlurk>

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


  parent reply	other threads:[~1998-11-03 18:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-31 10:14 Bart Schaefer
1998-11-02  9:21 ` Zefram
1998-11-02 17:07   ` Peter Stephenson
1998-11-02 17:45     ` Bruce Stephens
1998-11-02 18:06     ` Zefram
1998-11-03  8:12       ` Sven Wischnowsky
1998-11-03 12:22         ` Bruce Stephens
1998-11-03 12:47           ` Bruce Stephens
1998-11-03 15:01             ` Zefram
1998-11-03 15:27               ` Bruce Stephens
     [not found]         ` <MLIST_vbn269dkyw.fsf@snake.isode.com>
1998-11-03 18:09           ` Jarkko Hietaniemi [this message]
1998-11-03 18:54             ` Zefram
1998-11-03 19:14               ` Jarkko Hietaniemi
1998-11-03 19:27                 ` Zefram
1998-11-03 19:36                   ` Jarkko Hietaniemi
1998-11-04 18:48                     ` Bart Schaefer
1998-11-05  9:26                       ` PATCH: 3.1.5: Case-insensitive globbing (2) Peter Stephenson
1998-11-05 18:15                         ` Bart Schaefer
1998-11-06 11:01                           ` PATCH: 3.1.5: doc fix, was re: Case-insensitive globbing Peter Stephenson
1998-11-06 13:43                             ` Bruce Stephens
1998-11-06  9:24                     ` Approximate matching 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=oeesog0ejgy.fsf@alpha.hut.fi \
    --to=jhi@cc.hut.fi \
    --cc=b.stephens@isode.com \
    --cc=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).