Category : OS/2 Files
Archive   : KSH48.ZIP
Filename : README.SJG

Output of file : README.SJG contained in archive : KSH48.ZIP

I have migrated my 3.2 ksh edit.c mods into the 3.3 ksh
This file describes the mods in general and really only applies
(at this stage) to emacs-mode. I have not touched vi-mode apart
from making it use pprompt() so that '!' is correctly expanded
as in emacs-mode.

I would prefer to see both vi.c and emacs.c use a common set of
primatives in edit.c - but that looks like a lot of work.

Basically my mods affect the functions that move the cursor
about and redraw the edit line.

The input buffer "buf" is pointed to by "xbuf" and its end is
pointed to by "xend". The current position in "xbuf" and end of
the edit line are pointed to by "xcp" and "xep" respectively.
I have added "xbp" which points to the start of a display window
within "xbuf".

[A] starting position

|<-------- $COLUMNS --------->|
| |<---- x_displen ------->|
| PS1|
|\ \ \ \
xbuf xbp xcp xep xend

[B] scrolled

| |<----- COLUMNS -------->|
| |<----- x_displen ------>|
\ \ \ \ \
xbuf xbp xcp xep xend

In the above -------- represents the current edit line while
===== represents that portion which is visible on the screen.
Note that initially xbp == xbuf and PS1 is displayed.
PS1 uses some of the screen width and thus "x_displen" is less
than $COLUMNS.

Any time that "xcp" moves outside the region bounded by "xbp"
and "xbp" + "x_displen", the function x_adjust() is called to
relocate "xbp" appropriately and redraw the line.

Excessive I/O is avoided where possible. x_goto() for instance
calculates whether the destination is outside the visible
region, and if so simply adjusts "xcp" and calls x_adjust()
directly. Normally though x_adjust() is called from x_putc().

The above mechanism has be updated to use a function x_lastcp()
that returns a pointer that accurately reflects the last
visible char in the edit buffer. That is a more accurate
version of xbp + x_displen which does not account for TABS.

Other changes

I have also added some emacs mode functions.
Set a numeric arg (positive only).
Used by all word related commands.
Retrieve word from previous command (default is last
word). Use M-[1-9] to select word.
UPPER,lower,Capitalize word.

Commands like delete-word now push the deleted text so that it
may be yanked back into place.


There are bound to be some. Please report same to me:

Simon J. Gerraty

  3 Responses to “Category : OS/2 Files
Archive   : KSH48.ZIP
Filename : README.SJG

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: