where to do line editing?
Marc Ries
ries at trwrb.UUCP
Thu Jul 14 03:27:19 AEST 1988
In article <143 at loquat.cis.ohio-state.edu> karl at loquat.cis.ohio-state.edu (Karl Kleinpaste) writes:
[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.]
[
[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
There is a libedit.a make directive in the KSH sources, and
the documentation alludes to this ability. However, in my
case, I needed the ability to preload the edit-line with a
prompt and/or default "to-be-edited" data. I had to modify
the actual sources to achieve a stand alone one-line-editor
interface (ie, set the defaults up and do a read() to the
libedit.a read() routine). The ability to offer vi or emacs
modes is icing on the cake.
I made the principals (David Korn and P.D. Sullivan) aware of
the changes, and was told they would be incorporated into an
upcoming release (thanks, guys).
--
Marc A. ries at trwrb.TRW.COM
sdcrdcf!---\
ihnp4!------\----- trwrb! --- ries
More information about the Comp.unix.wizards
mailing list