🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #3981

Re: emacs style completion in ksh93

#3981
From: bsh
Date: Fri, 23 Feb 2007 01:50
39 lines
2761 bytes
Cyrille Lefevre wrote:
> this should be rewritten using a state machine...

Oh no you shouldn't! Or perhaps I should instead say that,
having had much experience in writing state machines, they
are always problematic to debug and maintain. Their use is
almost always a case of having not used the appropriate
software tool, or justified by the primacy of execution speed.

> function comp_emacs {

Thank you! I wish that I could show you my own keybind
example implementing generalized autocompletion, but it's
stuck on another machine's harddrive. It's almost as
complex, and (if I understand your code sufficiently) shows
a design variation that allows binding of (multiple) keystrokes
to the output of a user-specified function. I've attempted a
different algorithm to map character sequences utilizing
hashes with a base 64 numerical radix, instead of the usual
associative array technique, which has limitations, but is
very fast.

I wonder, was this code written in regard to the issue
described in:
https://mailman.research.att.com/pipermail/ast-users/2004q1/000457.html

Obviously, you have seen DGK's keybind example, but
for those in C.U.S. who wish a demonstration example,
see:
http://www.kornshell.com/examples/keybind

A question: have you done GUI coding on dtksh?

Once again, thanks for submitting your code to C.U.S.
I thought _someone_ should respond to this contribution,
but I wanted to resolve the problem of the above keybind
URL being temporarily unavailable, before I posted.

=Brian
Technical Details
Message-ID: <1172195455.143058.52240@l53g2000cwa.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!l53g2000cwa.googlegroups.com!not-for-mail
References: <45dcde5b$1@news.stben.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1012a6,ad528e2892f5c01c
X-Google-Thread: 110f2c,ad528e2892f5c01c
X-Google-Attributes: gid1012a6,gid110f2c,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!l53g2000cwa.googlegroups.com!not-for-mail
From: "bsh" <brian_hiles@rocketmail.com>
Newsgroups: comp.unix.shell,fr.comp.os.unix
Subject: Re: emacs style completion in ksh93
Date: 22 Feb 2007 17:50:55 -0800
Organization: http://groups.google.com
Lines: 40
Message-ID: <1172195455.143058.52240@l53g2000cwa.googlegroups.com>
References: <45dcde5b$1@news.stben.net>
NNTP-Posting-Host: 153.18.21.246
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1172195473 12924 127.0.0.1 (23 Feb 2007 01:51:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 23 Feb 2007 01:51:13 +0000 (UTC)
In-Reply-To: <45dcde5b$1@news.stben.net>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: l53g2000cwa.googlegroups.com; posting-host=153.18.21.246;
   posting-account=4efyCQwAAAC3BVPjk6pORTBAZbqIFuNi