perm filename EINIT.CMD[1,3]5 blob sn#368191
filedate 1978-07-20 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00011 PAGES
C REC PAGE DESCRIPTION
C00003 00002 αβxCOMMENT This is the (new) system library of ETV macros. The
C00005 00003 αβxcomment REF - Horizontal attach and copy
C00007 00004 αβxcomment REF - Reverse a line, reverse an FMUNGE character ↔
C00008 00005 αβxcomment REF - #bloat gives you # number of empty records for this page
C00010 00006 αβxcomment REF - word transposition. ↔
C00011 00007 αβxcomment REF - counters. For example, to number the lines of a page.
C00013 00008 αβxcomment REF - Find in a list of files. Take the cursor and point it to the
C00015 00009 αβxcomment REF - Saving a readonly page SAVE.
C00016 00010 αβxcomment LIS - counting macros
C00022 00011 αβxcomment REF - Convert a directory to file names.
αβxCOMMENT This is the (new) system library of ETV macros. The
librarian is REF. Please send (copiously commented) additions to him.
Most of the macros in this file can be used by loading the appropriate
macro page into your E core image. This is done with the extended
execute command. Thus, to get the horizontal attachment and copying
macros on the next page, one would type to E:
<control>xEXE [1,3](3)<carriage return>
Some of these macros, however, might require modification
to suit your purposes. For example, you probably would want to use the
find macros on page 8 to find stuff in your own files. Copy that
macro page to your own file, modify the macros to suit yourself, and
then execute that page.
αβxcomment REF - Horizontal attach and copy
These macros are for horizontal attachments. Calling the macro HA inserts
a mark in the line (a <vt>), and aborts. Resuming under another
character picks up everything from the original mark to that character,
and places it in the horizontal attachment buffer. Doing a further
"resume", or calling the macros HD or HAB will deposit that text in a line.
Doing a deposit at the end of a line unfortunately leaves you in line
HC will do a copy, rather than an attach. HSAVE will save your horizontal
attach buffer in the macro HD1. Invoking the macro HD will also deposit
your horizontal attach buffer.
αβxatt hab⊗↔αβxred hab1⊗↔αβk
αβxcomment REF - Reverse a line, reverse an FMUNGE character ⊗↔
αβxcomment If you call the macro REVERSe with an argument of the size of the
line involved, it will reverse that line.
αβxcomment point the arrow at the line to be reversed ⊗↔
αβxcomment So, to reverse an fmunge character 16 wide, 25 long, call, 25 times:
(note the 16 in the CHRREV macro) ⊗↔
αβxcomment REF - #bloat gives you # number of empty records for this page
This macro saves your file! (it causes the page(s) in core to be written on disk) ⊗↔
αβxcomment turn off autoburping⊗↔
αβxcomment move to the end of the page and start a new page⊗↔
αβxcomment fill the page with # records of garbage⊗↔
αβxcomment go to the bottom of the previous page, and delete the page mark⊗↔
αβxcomment save the world, delete the trash, save the world. Reset autoburp⊗↔
αβxcomment REF - word transposition. ⊗↔
αβxcomment move the cursor under the first of two words in the MIDDLE of
a line to be transposed, then execute ⊗↔
β⊗↔αs α β⊗↔αs α β⊗↔
αβxcomment break the line around the two words⊗↔
αβxcomment grab the second and move it up ahead of the first⊗↔
αβxcomment go up a line and re-patch the world⊗↔
αβxcomment pick up the last part of the last line, leaving the cursor in a
αβxcomment REF - counters. For example, to number the lines of a page.
The numbers from 1 to 46. When you need
to either 1) Number a group of lines or 2) GENSYM some symbols,
make a copy of this line, and, in your macro, peel numbers off from the
αβxcomment Fills an attach buffer with the numbers 1 through 45 ⊗↔
αβxcomment Point the arrow at the first line to be numbered, and call this
macro with the number of lines to be numbered as its argument⊗↔
αβxcomment drop the attach buffer, and peel the first number off it⊗↔
αβxcomment affix it to the next line⊗↔
αβxcomment and proceed. If something other than a tab is desired between
the numbers and the lines, replace the first ⊗= with <control>d<string>.
If only every nth line is to be numbered, insert n-1 <cr> here. ⊗↔
αβxcomment REF - Find in a list of files. Take the cursor and point it to the
first of a list of files. (one to a line) Will continue until either the
next blank line, or until the current string is found. ⊗↔
αβxcomment REF - Saving a readonly page SAVE.
Its often useful to be able to save the world (write out in the
core pages) when in readonly mode, by leaving readonly mode, saving, and
then returning. This macro turns it into one command.⊗↔
αβxcomment LIS - counting macros
The macro inc is the basic counting macro. It assumes that the arrow
is at a line containing only a number, represented as a string of decimal
digits. Inc adds one to this number, and leaves the result on the line
in place of the old number. Inc can handle numbers up to about 100 digits
long, and could be fixed to handle numbers as long as will fit in the line
Inc operates by separating the last digit, and turning it into a macro call
of the form incnx where x is the digit. This macro call is then executed.
The incnx macros all replace the given digit with its successor, and incn9
also causes a carry, by repeating the process of turning the last digit into
a macro call. There are also some things to make inc properly extend numbers
(carry off the left-most digit), and the macro close which concatenates
the number back together on one line again.
The macros initn, add1n, and nextn use the macro n as a register - it
holds an integer represented as a string of decimal digits. Initn sets n to
0. Add1n increments n by 1. Nextn increments n by 1 and inserts a new
line where the arrow is pointing, with the new value of n as its contents.
(All three of these do a ctrl-cr before anything else, to exit the line
editor and line insert mode.)
BEWARE! INC changes the value of the STOPONE/STOPALL/STOPZERO switch
(leaving it set to STOPALL). Also, a mark at the number line will be lost.
β α⊗↔ αxcomment insert a leading space, to allow for carry
off left end of number ⊗↔
αβm⊗↔β⊗↔αu αxcomment mark place and put in trailing blank line,
both for use by CLOSE ⊗↔
αz inccry ⊗↔ αxcomment increment: make last digit it into an
INCNx macro call, and ... ⊗↔
α1α0α0αzincdo⊗↔ αxcomment execute INCNx macro(s) ⊗↔
αz inca ⊗↔ αxcomment deletes leading space if still there,
else deletes extra blank line that is there ⊗↔
αzclose⊗↔ αxcomment return digits to one line ⊗↔
αxDEFINE inccry⊗↔ αxcomment make last digit of previous line into an
INCNx macro call ⊗↔
αxDEFINE incdo⊗↔ αxcomment execute present line as a macro ⊗↔
αxcomment The INCNx macros - each turns the present line into the
single digit x+1, where <space>+1 is 1 and 9+1 is 0. Then all but
INCN9 abort back to INC, while INCN9 causes a carry by turning the
next digit into an INCNx macro call, which is then executed by the
repeated INCDO ⊗↔
αXDEFINE incn ⊗↔1αk⊗↔α⊗↔α3αxabort⊗↔αβ⊗↓
αxDEFINE inca⊗↔ αxcomment kill extra blank or empty line
introduced by carrying from last digit ⊗↔
αXDEFINE CLOSE⊗↔ αxcomment back up to previous mark, and concatenate
all lines through next empty line ⊗↔
αx stopone ⊗↔⊗↔α-αmα1α0α0αz cls1 ⊗↔αβdαuα-αβmαx stopall ⊗↔αβ⊗↓
⊗↔α0αx nonempty ⊗↔αuα⊗=αdαβ⊗↓
α⊗↔αβ⊗↔αz n ⊗↔α⊗↔ αxcomment put n on a new line ⊗↔
αz inc ⊗↔ αxcomment increment it ⊗↔
α1αxredef n ⊗↔ αxcomment save the new value ⊗↔
αz nextn ⊗↔ αxcomment get new value ⊗↔
αβd αxcomment delete it from the file ⊗↔
α1αxredef n ⊗↔
αβxcomment REF - Convert a directory to file names.
FIXFIL Takes a page of directory information from WILD or DIR, and converts
it to a list of file names, one to a line. Useful for editing directories. ⊗↔
α6α .α3α [α3α β,α3α ]αK⊗↔⊗↔αβ⊗↓