HELP FORMAT David Roberts, October 1982
lib format;
=== VED COMMANDS TO FORMAT TEXT FILES ==================================
The following are commands to assist with simple on-screen formatting of
text files in ved. For more elaborate (but non-interactive) formatting,
the RUNOFF program is probably more appropriate.
Although these commands will be autoloaded as necessary, they can all
be loaded at once with
lib format;
or, in VED
<enter> lib format
_____________________________________________________________________________
ENTER LCOL and ENTER RCOL provide convenient ways of setting the margins. To
avoid ambiguity about where 'the margins' are, I'll refer throughout this
help file to the 'leftmost' and 'rightmost' columns: these are the screen
columns which are, respectively, as far left and as far right as text is
ordinarily able to stand. ('Ordinarily' because there are ways to overrun the
margins if you want to.)
ENTER LCOL (mnemonic LEFTMOST COLUMN)
sets the leftmost column. The command can be used with or without an
argument. If no argument is given, the column the cursor is standing on
becomes the leftmost column. If the command is followed by a number, that
column becomes the leftmost column. If the command is followed by '?' the
margin setting is unchanged but the command line tells you what the leftmost
column is. (ENTER MARGIN is similar, but if given a numerical argument
understands it as the number of column positions BEFORE the leftmost column.)
ENTER RCOL (mnemonic RIGHTMOST COLUMN)
does the equivalent job as ENTER LCOL on the rightmost column.
_____________________________________________________________________________
ENTER RULER
inserts between the line on which the cursor stands and the one above, a
'ruler' that numbers the screen columns and indicates the limits of left and
right margins and tab settings. On this help file it looks like this:
1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890123456789
<---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|--->
That is, the leftmost column is indicated by '<', the rightmost by '>' and
the tab positions by '|'. The 'ruler' appears within a marked range so that
when you've finished with it ENTER D should make it go away.
_____________________________________________________________________________
ENTER JJ
performs full justification on a block of text in a marked range; that is,
the first and last characters on each line (except the last lines of
paragraphs) are aligned with the leftmost and rightmost columns
respectively--as in this help file. The way that the procedure works at the
moment is quite simple: the command first of all eliminates all redundant
spces from the marked range (as in ENTER GOBBLE), it then carries out the
same actions as ENTER J to tidy text, and finally inserts into each line at
equal intervals sufficient spaces to align the last character with the
rightmost column. It could be made more intelligent--for example by trying to
put spaces after punctuation where it can--but unless there is some demand
for this, the programming effort does not seem all that worth while at the
moment.
ENTER JJP
works like ENTER JP except that the current paragraph is fully justified.
ENTER GOBBLE
removes redundant spaces from a block of text in a marked range: no more than
one space is allowed between two non-space characters. Leading spaces at the
beginnings of lines are left intact, hence paragraph indentations won't be
altered. The command is intended as an antidote to ENTER JJ; however, it may
not return text to exactly the same form as it was before the ENTER JJ
command: if, for example, you are in the habit of inserting two spaces after
a full stop (a familiar convention) you will lose one of these. Since ENTER J
(and ENTER JJ, which uses it) will remove redundant spaces after full stops
in some instances, it might be better to single space in any case.)
_____________________________________________________________________________
ENTER AL, ENTER AR, and ENTER AC are commands that align in various ways
individual lines in a marked range.
ENTER AL (mnemonic ALIGN LEFT).
moves all the lines of text in a marked range so that the first character of
each is aligned on the leftmost column.
ENTER AR (mnemonic ALIGN RIGHT).
moves all lines of text in a marked range so that its last character of each
is aligned on the rightmost column.
ENTER AC (mnemonic ALIGN CENTRE).
moves all lines of text in a marked range so that each is centred between the
leftmost and rightmost columns.
_____________________________________________________________________________
ENTER BL, ENTER BR, and ENTER BC are commands that align as a unit the whole
block of text in a marked range (unlike ENTER AL, etc, which move the
individual lines).
ENTER BL <n> (mnemonic BLOCK LEFT), where <n> is a number,
moves a block of text in a marked range that number of columns to the left.
The command will allow you to move text beyond the leftmost column if there
is room on the screen; if there is not enough room it is moved as far as it
will go (hence you can do things like ENTER 999). If the command is used
without an argument, the block is moved to the left by a single column.
ENTER BR <n> (mnemonic BLOCK RIGHT), where <n> is a number,
moves a block of text in a marked range that number of columns to the right.
If the command is used without an argument, the block is moved to the right
by a single column.
ENTER BC (mnemonic BLOCK CENTRE)
moves a block of text in a marked range so that each is centred between the
leftmost and rightmost columns.
_____________________________________________________________________________
ENTER OVER (mnemonic OVERLAY).
overlays one block of text upon another. I'll call the text that does the
overlaying the 'overtext' and the text that is overlaid the 'undertext'. Then
if the following is the undertext:
Mary had a little lamb,
Its fleece was white as snow
and the following is the overtext:
|JOHN |
| BLACK COAL|
this is the result:
|JOHN had a little lamb, |
|Its fleece was BLACK as COAL|
That is, each character in the overtext that isn't a blank replaces the
character in the equivalent position in the undertext; elsewhere the
undertext remains unchanged.
The command is used in the following way: the overtext is put in a marked
range, the cursor is moved to the first line of the undertext, and the ENTER
OVER command is issued. Then the new text should appear in place of the old
undertext. If you miscalculated and the effect you get is not what you were
hoping for, all is not lost: the old undertext is stored in vveddump and can
be brought back by ENTER Y. (See help YANK) (NB The command won't let you
overlay a text upon itelf.)
_____________________________________________________________________________
Although these commands were principally intended for use on text files (most
of them to make the construction of tables easier), several (such as AL and
BL) may also be found useful for program files.
See HELP * PAGE for information about pagination.Author: David Roberts, October 1982