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

Re: Es and autocompleting



On Wed, Dec 27, 2000 at 04:01:07PM -0800, Noah Friedman wrote:
> If you have to teach the window system how to do context-sensitive
> completion and history for csh, sh, rc, scsh, etc. you've now moved a lot
> of application-specific knowledge into the window system where it will
> never be kept up to date because a different vendor is responsible for
> maintaining it.

On the other hand, a good context-sensitive completion system also has to 
know about the commands you're running.  For example, if you install a recent 
version of zsh, it comes with completion files for everything from CVS to RPM.
If you type "cvs remove <Tab>", it will complete only files which are in the 
CVS repository for the current directory but are not in the current directory 
(yes, it knows how to parse CVS/Entries).  If you type "rpm --verify <Tab>", it
will complete the names of RPM packages installed on your system (yes, it runs 
"rpm -qa" to generate the list).  If you type "tar xvfz mytarball.tgz <Tab>", 
it will complete the names of files inside the tarball (yes, it runs "tar" 
behind the scenes to get the list).

Talk about application-specific knowledge!  You're probably recoiling in horror
(and we all know the zsh developers are insane lunatics), but this sort of 
thing is amazingly valuable (much more so than something which merely 
autocompletes strings you happen to have typed in the past).  It's more than a 
shortcut mechanism, it's actually a fingertip-level exploration tool.  You may 
pish and tush, but it's still pretty nifty.

I would argue that, if anything, completion logic needs to move "down", closer 
to the applications that provide the necessary context, but command line 
editing and history recall need to move "up", closer to the terminal's user 
interface.

I have no idea how to actually accomplish this motion, however.

Ignore me, I'll go back to lurking...

Dan