stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] tab completion


From: Ryszard Szopa
Subject: [STUMP] tab completion
Date: Sun, 10 Jun 2007 00:56:00 +0200

Hello!

First of all--I really like Stump. I was a fan of ratpoison, and a
great fan of Lisp. Now I can have these two in one piece of software.
The only thing I dislike is the name (I would prefer something like
cl-ratpoison), but, huh, nobody is perfect :-)

Anyway, I noticed that tab completion of shell commands is terribly
slow... which isn't so surprising, as PROGRAMS-IN-PATH, the function
that generates the completions, has to look through *all* the programs
in $PATH... What is worse, when you type a longer part of the
command's name, it doesn't get any faster (in fact, it gets slower,
because it has more matching to do).

So, here's my solution to this problem. During initialization (i.e. in
STUMPWM), I store all the programs in the path in a letter tree (this
takes ~2 s, but is done only once). This allows me to quickly check if
a string is a program name and or to generate all its completions.

completions.lisp is the file that should go to the same directory as
stumpwm. completions.patch is the effect of doing cvs diff -u.

I hope you find it useful.

Cheers,
   -- Richard

--
http://szopa.tasak.gda.pl/

Attachment: completions.lisp
Description: Binary data

Attachment: completions.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]