where to do line editing?

Karl Kleinpaste karl at loquat.cis.ohio-state.edu
Wed Jul 13 12:30:06 AEST 1988


al at gtx.com writes:
   [line editing as in ksh is mighty neat, but might be better done
    in the kernel, notwithstanding arguments against user interfaces
    being implemented there.  Alternate suggestion is to create a
    library such as curses, but has the drawback of requiring explicit
    programming to put it to use.]

   Comments, flames? Anybody done it, meant to do it, thought about
   it, rejected it?

I did it once.  I created a thing called liblinedit.a, which consisted
of a few files which made up my own incarnation of a line editor.
This was the editor which I attached to csh lo these many years ago.
It was written very generally so as to be able to attach it to
anything that wanted to do line-at-a-time input.  Due to my inability
to distribute the thing, it never got much exposure outside local
systems where I supported my csh.  Paul Placeway (cf. tcsh) has
occasionally made noises about turning the tcsh editor into a linkable
library, but I don't think he's ever actually done it.

It's very doable, not particularly tough, really no big deal once
you've taken care of a few details.  Just make sure that it has a
single entry point that looks, feels, and smells like an ordinary
read() call except that it does whizbang things inside.  I started
from Ken Greer's tenex stuff originally distributed in October 1984.
It occurs to me that ksh's editing library may even include a way to
build a libedit.a suitable for such usage.

--Karl



More information about the Comp.unix.wizards mailing list