zsh-users
 help / color / mirror / code / Atom feed
* zsh implementation question
@ 2003-08-04 16:47 Eric.D.Friedman
  2003-08-04 18:31 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Eric.D.Friedman @ 2003-08-04 16:47 UTC (permalink / raw)
  To: zsh-users

Would one of the zsh developers kindly point me to the source code that zsh
uses for partial string matching on the command line?  Is it implemented as
a brute force search over an array of possible values, or does zsh use
something fancier like patricia tries to determine that "appl" matches
{"application", "apple", "applied"} from the set {"application",
"apothecary", "apple", "applied", "moose"} ?

I'm writing a GUI in which I'd like to offer similar completion capabilities
(also found in many web browsers).  The set of possible matches will always
be pretty small (smaller than what zsh deals with), so it seemed like this
was a good place to look for a reasonable implementation/inspiration.

Thanks,
Eric


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: zsh implementation question
  2003-08-04 16:47 zsh implementation question Eric.D.Friedman
@ 2003-08-04 18:31 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2003-08-04 18:31 UTC (permalink / raw)
  To: Eric.D.Friedman; +Cc: zsh-users

Eric.D.Friedman@wellsfargo.com wrote:
> Would one of the zsh developers kindly point me to the source code that zsh
> uses for partial string matching on the command line?

I suppose you mean turning c.s.u into comp.sources.unix and the like.
The function which tests for a match is match_str in
Src/Zle/compmatch.c, but it's fairly heavy going.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-04 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-04 16:47 zsh implementation question Eric.D.Friedman
2003-08-04 18:31 ` Peter Stephenson

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).