💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › upl1998 › Nov98 › GSE… captured on 2024-12-18 at 01:57:11.

View Raw

More Information

-=-=-=-=-=-=-

This is a GS text editor. I wrote it for me and it reflects many of
my bias'. Still, I figure there may be others that would like it,
since in many ways it is very configurable.

Most of what's in the editor is standard stuff but there are a couple
of things I ought to tell you about.

I keep a five line stack in memory. The pushli function, which I have
on control-P, pushes the current line onto this stack, and the unpush
function, control-O, pops a line off the stack and inserts it before
the current line. This is not really a stack, however. It's really a
ring buffer, so if you fill the ring buffer with five lines of text
you can continue poping these lines indefinitely. I probably use this
stack more than any other feature in the editor.

There is another non-standard function associated with the stack.
This is the overlay function, control-W, which pops a line off the
stack and overlays it over the current line. Only characters that are
not blanks are copied.

Thus if the line on the stack is:


and the current line is:
       Hi you guys

then if you are positioned on the current line and overlay the line
from the stack the result will be:



I don't have saved macros in the editor. I have thought about adding
these but I don't really use them much myself. I do have a recorder.
When you toggle the recorder on (control-] in mine) the program
records every keystroke (up to 80 characters) until you press
control-] again. You can then play these back by pressing the playlea
key (I use the backward tick mark ` key for this).

Note that while characters are being recorded I click the speaker
whenever a key is pressed.

You will also notice that there is no find/replace function. There is
a find function but replaces are done by doing a find and then
recording a replace followed by another find. You can then use the
playlea key to do repeat replaces.

Admittedly this is not as nice as true find/replace because it
doesn't handle capital letters intelligently. I'm not sure if I'll
ever get a true find/replace done though.

The rest of the functions are pretty standard. Note that you can
assign any function to any key (I don't support pressing both
the open apple and option keys at the same time, though). You do this
by editing the s.keys file and putting what you want where you want it.

You can then assemble all the s.= files and link using the "L" exec
file.

If you have the libraries from the 360 Text Toolkit in your 'libraries'
subdirectory you will have to change the Orca library prefix.
I use the following command which points all library searches to
the directory that contains the sources.

prefix 2 /hd/temp

I put the executable in the orca utilities directory and then define it in
the syscmnd file with the following line so it remains in memory. That way
I don't loose the tabs and language type. (I also rename the executable
file "T").

T               *U                      Jay's text editor

The following are the different subroutines that you can assign to keys.

edsel        Ctrl C   This is the function that is called when you press the
                      mouse button. It works the same way whether you use
                      the Control-C or the mouse button. The first time you
                      press it the program begins to select text. The second
                      time you press it the selection stops. From then on,
                      every time you press the button the highlighted block
                      is copied to the present position. If you are within
                      the highlighted area when you press the button, the
                      block is unselected and the highlighting is removed.
                      Note - you can also unselect from anywhere with an
                      OA-u.

delchar      Ctrl D   This deletes the character you are sitting on.

inschar      Ctrl F   This inserts a blank at the present position.
findnext     Ctrl G   Search for the next occurance of a string
do_left      Ctrl H   Move to the left
tab          Ctrl I   Tab right
do_down      Ctrl J   Move down
do_up        Ctrl K   Move up
do_insert    Ctrl L   Insert a blank line just above the current one.
do_cr        Ctrl M   Go to the left margin on the next line.
eol          Ctrl N   Go to the end of the line.
unpush       Ctrl O   Pop a line off the line stack and insert it just
                      above the current one
pushli       Ctrl P   Push the current line onto the line stack (5 lines)
menu         Ctrl Q   Call the main menu.
page_up      Ctrl R   Move back one page.
autog        Ctrl T   Toggle the auto indent.
do_right     Ctrl U   Move right
page_down    Ctrl V   Move down one page
overlay      Ctrl W   Pop a line off the line stack and overlay it on
                      the current one.
wordtab      Ctrl Y   Word tab forward
do_delete    Ctrl Z   Delete the current line
tlearn       Ctrl ]   Toggle the learn mode.
                      The first time you do this turns on the recorder.
                      This records every keystroke (not mouse moves)
                      until you turn it off or run out of room in the
                      record buffer (currently 80 chars long).
                      The second time you press this button you turn off
                      the record mode.
playlea      `        Play back the record buffer
do_left      Delete   Move left one char.

open apple keys

taback       Ctrl I   Tab back to the previous tab stop.
setaux       A        Set the auxtype (= Orca language)
booktoggle   B        Change books. There are two books, each
                      corresponding to a different file. Pressing this
                      key switches from one to another.
find         F        Input a string and search forward.
blkins       I        Insert the highlighted block.
setlm        L        Set the left margin
menu         M        Main Menu
setrm        R        Set the right margin
tabset       S        Set/Clear tabs
tabtoggle    T        Toggle the Column display
unsel        U        Unselect the currently selected region
wraptog      W        Toggle the auto wrap.

optionkeys


Things to watch out for.

 1. Don't leave an area highlighted. I don't yet have an undo function
    and if you forget that something is already highlighted, you go to
    highlight something else and, instead, copy the
    already-highlighted block over top of it.

 2. Don't load a file and make a bunch of changes, intending to save it
    to a new name. Instead, load the file and immediately save it to
    the new name. The 'save to same name' menu choice is very quick to
    clobber your old file if you hit the wrong button (I include it
    because I like to be able to save often and easily and it's no
    problem if you follow this rule).


I hope you enjoy this.

Jay Wood