Trailing-Edge
-
PDP-10 Archives
-
steco_19840320_1er_E35
-
10,5676/teco/manual/tecimm.rnm
There is 1 other file named tecimm.rnm in the archive. Click here to see a list.
.chapter Immediate mode editing
.HL1 Introduction
TECO contains a means of defining key strokes so that you can have
commands immediately execute upon them. This is done by associating
a character string with the commands that are to be executed.
.HL1 Immediate mode editing
.index ^Immediate mode editing
Immediate mode editing is controlled by the FC command. The FC command
.index ^Command ><FC
will allow you to define the immediate commands, delete them, turn off
and on the immediate mode, and save or restore an immediate command table.
The format of the FC command is:
.b.c
FC(Q-register)key word$
.b
The Q-register may be required, optional or not allowed on the command
depending on which of the key words is specified. If the Q-register
is specified then it will contain text which describes the immediate
commands. The key word determines the exact function to perform on the command
table.
If an error occurs during the processing of an FC command then the
command is aborted. When the command is aborted nothing is destroyed,
but left in the state it was before the command was started.
.hl2 Concepts
The following descibes some the of basic concepts used in describing
the FC command and the FC command tables.
.hl3 Command Table
Each set of immediate mode commands is represented by an
immediate mode command table.
The command table is built from text supplied to an FC command in a
Q-register. This text descibes the strings which are acceptable as
immediate commands, and specifies what commands are to be executed when
the strings are typed on the terminal.
.hl3 Command Table Interaction
Command tables can interact in one of two ways. You can build a new
command table from a current command table or you can build a new command
table after saving the current command table.
The first we consider to be overlaying a new command table on top of
the current command table. This is accomplished by first creating a
copy of the current command table. Then the new commands are inserted into
this command table. If there is a conflict an error message may or may not
.ENTRY <FC key words
be given depending on the key word specified (INSERT or REPLACE).
.index <FC key words ><INSERT
.index <FC key words ><REPLACE
The current command table is saved so that the new command table can
be removed at some later date.
The other interaction is saving the command tables on a stack. The
initial command table and any command tables overlayed on that one
are considered to be the first item on the stack. The current command
table can be pushed onto the stack and a new command table created
as the command table on the top of the stack. The stacked command tables
may be removed from the stack by poping off the command table on the top
of the stack. This is accomplished by the PUSH and POP key words for
the FC command
.index <FC key words ><PUSH
.index <FC key words ><POP
.hl3 Saving a command table
A command table can be saved into a Q-register. This allows the editer
to by pass the process of compiling a commonly used command table again and
again.
.HL2 key words
The following describes each of the FC command key words.
.HL3 PUSH
.INDEX <FC key words ><PUSH
The PUSH key word will cause the current command table to be saved on the
command table stack and optionally define a new command table. If a Q-register
is given with this key word, the current command table will be saved and
a new command table defined from the Q-register. If the Q-register
contains a saved command table then
the command table is restored as the current command table. If the Q-register
contained text it will then compile the text in the Q-register to create
the current command table.
If the Q-register is not given, then the current command table will be saved
on the stack and a copy made of it to remain as the current command table.
.HL3 POP
.INDEX <FC key words ><POP
The POP key word will cause the current command table to be discarded
and restore the saved command table from the command table stack.
.HL3 DELETE
.INDEX <FC key words ><DELETE
The DELETE key word will cause commands to be deleted from the current
command table. The Q-register is required on this command and contains
a command table. The immediate commands are matched to ones that are
already defined and then deleted. If a command is not in the current
command table then an error message will be issued and the command is aborted.
.HL3 INSERT
.INDEX <FC key words ><INSERT
This INSERT key word will cause the immediate commands to be inserted into
the current command table. An error will occur if the immediate command
being defined conflicts with a currently defined command. This key word
requires the Q-register.
.HL3 REPLACE
.INDEX <FC key words ><REPLACE
.INDEX <FC key words ><INSERT
The REPLACE key word will work in the same manner as the INSERT key word,
except that it will not give an error if there is a conflict with
a currently defined command. This key word also requires the Q-register.
.HL3 OVERLAY
.INDEX <FC key words ><OVERLAY
This key word will cause the current command table to have a new command
table overlayed on top of it. That is the current command table will be
copied, the the new commands inserted from the Q-register that must be
specified in the command. The old command table is saved so that the user
can restore it at some future point in the editing.
.HL3 REMOVE
.INDEX <FC key words ><REMOVE
The action that is taken on an the "FCREMOVE" command is to delete the
current command table and restore an the last command table that was
overlayed. The FC command with the REMOVE key word does not accept a
Q-register as part of the command syntax.
.HL3 SAVE
.INDEX <FC key words ><SAVE
The FC(Q-reg)SAVE$ command will cause the current command table to be
saved in the specified Q-register. Only the current command table is
.index <FC key words ><REMOVE
saved and an implied FCREMOVE$ command is executed.
.HL3 RESTORE
.INDEX <FC key words ><RESTORE
The FC(Q-reg)RESTORE$ command will cause the command table saved in the
Q-register by the FC(Q-reg)SAVE$ command to be restored as the current
.index <FC key words ><SAVE
command table. The command table that was the current command table on
the execution of the command will be deleted.
.HL3 RESET
.INDEX <FC key words ><RESET
This key word does not allow a Q-register as part of the command. This
key word causes the FC data base to be reset to a virgin state. This should
be used if the current command tables have been mangled beyond repair.
TECO will not mangle the tables, but a programmer will when implementing
and debugging immediate commands.
.HL3 OFF
.INDEX <FC key words ><OFF
This key word does not allow a Q-register as part of this FC command.
The key word will cause the immediate mode command processing to be
turned off.
.HL3 ON
.index <FC key words ><ON
This key word does not allow a Q-register. This key word will cause
the immediate mode command processing to be turned on.
.HL2 Command table format
The text that is used to define a command table consists of three
basic parts; Immediate command, command type and command to execute.
The format is:
.b.i+5
Immediate command : Command type { Command to execute }
.b
These three basic parts are repeated on different lines for each
command that is to be defined. A command table would look like the following:
.b.i+5
Immediate command : Command type { Command to execute }
.b.i+5
Immediate command : Command type { Command to execute }
.b
.HL3 Immediate command
The immediate command consists of command terms seperated by or bars
("|") or just a command term. If the terms are seperated by the "|"
it means the command that is accepted is either the first term or the
second or the third and so on.
A command term consists of a set of quoted strings and keywords
separated by spaces. Any of the quoted strings or keywords, except
the last, may be followed by a plus sign (+). This indicates that
the characters allowed in the previous character position may be
repeated one or more times. For example, "1"+ "0" refers to a string
consisting of any non-zero number of ones, followed by a zero.
.note ** Note **
The plus operator can only be used to repeat one character position.
It cannot be used to indicate that a complete string can be repeated
one or more times. This is due to the complexity involved in building
a table from a set or strings of this type.
.end note
.HL4 Quoted string
.index <FC ^Command >^Quoted string
A quoted string is one or more characters inclosed in double quotation
marks. If the quoted string is to contain a double quotation mark then it
is quoted by another double quotation mark (eg. a string of just a double
quotation mark is """").
.HL4 NULL
.index <FC ^Command ><NULL
The NULL key word is a way to specify the charcter with the value of
zero.
This keyword is included since often nulls will be removed from ASCII
text, making a table which actually included a null unreliable.
.HL4 DELETE
.index <FC ^Command ><DELETE
The DELETE key word represents the character having the octal value
177.
.HL4 DECIMAL
.index <FC ^Command ><DECIMAL
DECIMAL represents the characters "0" through "9". This allows the
command table entry:
.B.I+5
DECIMAL "A" : TECO { ..... }
.b
to be the same as:
.b.i+5
"0A" | "1A" | "2A" | "3A" | "4A" | "5A" | "6A" |
.BREAK.I+5
"7A" | "8A" | "9A" : TECO { ..... }
.B
.HL4 DIGIT
.index <FC ^Command ><DIGIT
DIGIT is a synonym for DECIMAL.
.HL4 OCTAL
.index <FC ^Command ><OCTAL
OCTAL represents the characters "0" through "7" in the same manner that
.index <FC ^Command ><DECIMAL
DECIMAL represents "0" through "9".
.HL4 ALPHABETIC
.index <FC ^Command ><ALPHABETIC
ALPHABETIC represents the characters "A" to "Z" and the lower case
characters "a" to "z". The ALPHABETIC keyword functions in the same
manner that OCTAL and DECIMAL do.
.HL4 ALPHANUMERIC
.index <FC ^Command ><ALPHANUMERIC
ALPHANUMERIC is a union of the ALPHABETIC digit keywords. That is it
allows "A" to "Z", "0" to "9" and "a" to "z".
.HL4 ANY
.index <FC ^Command ><ANY
The ANY keyword allows specification of a number of characters to
be specified for a single character position. ANY takes a list
of quoted characters or octal values enclosed in parentheses as an argument.
.b
Example:
.b.i+10;ANY:("A",1,"a")
.B
This would allow both upper and lower case A and control-A to be accepted
in the character position.
.HL4 VALUE
.index <FC ^Command ><VALUE
The VALUE keyword allows specification of a single character or string
of characters by giving their octal value. The VALUE keyword may
take a single argument, or a list of octal values in parentheses.
.b
Examples:
.B.I+10;VALUE:100
.B.I+10;VALUE:(100,101,102,60)
.B
The VALUE keyword is useful in specifying control characters.
.HL4 RANGE
.index <FC ^Command ^Factor ><RANGE
RANGE allows you to specify a range of items. The first items is the
lower bounds of the range and the second item is the upper bounds of the
range. The items can be either a quoted cahracter or an octal number seperated
by a colon. An example of this is: RANGE:40:45.
.HL4 OTHER
.index <FC ^Command ^Factor ><OTHER
The commands in the to be executed part will be executed if no other
immediate commands match the charcter(s) that were input.
.HL4 ALWAYS
.index <FC ^Command ^Factor ><ALWAYS
This will cause the commands to be executed to be always executed when
an immediate command is processed.
.hl3 Command type
.entry <FC ^Command ^Type
The command type part of the command table definition specifies the
type of commands that are to be executed. These commands could be
one of three types of immediate commands, or TECO commands. The
different types of immediate commands specify different command tables
that the command should be mapped through.
The command type is optional in the command table definition. If the
command type is left off then the default will be to assume the commands
are normal TECO commands or that the command type is TECO.
.index <FC ^Command ^Type ><TECO
.HL4 BASE
.index <FC ^Command ^Type ><BASE
The BASE command type specifies that the commands that are to
be executed are immediate commands. The commands will be mapped through
the first command table that was defined or the base command table
upon which all others are built.
.HL4 IMMEDIATE
.index <FC ^Command ^Type ><IMMEDIATE
The IMMEDIATE command type specifies that the commands are immediate
commands and they are to be mapped through the current command table.
.HL4 TECO
.index <FC ^Command ^Type ><TECO
The TECO command type specifies that the commands that will be executed
are normal TECO commands.
.HL4 PREVIOUS
.index <FC ^Command ^Type ><PREVIOUS
This command type indicates the command to execute is mapped through
the last command table that was overlayed.
.hl3 Command to execute
The command to execute is text that is enclosed in braces ("{}").
The string that caused the command to executed to passed as a string argument
to the command. That is if the immediate command Control X Control A
caused a command to execute a string argument of _^X_^A would be passed
to the command.
.hl3 Examples
The first example will define a very simple set of commands. The only
commands that will be legal are:
.ls
.le;Control Z - Exit from TECO.
.le;RUBOUT - Delete the previous character
.le;All others - Insert them.
.els
.b2
.tp5
.lm+5
{_^^Z} : TECO {$EX}
.break
DELETE : TECO {$-1D}
.break
OTHER : TECO {I}
.lm-5
.b2.tp10
The second example will define a command table that will cause the function
keys on a VT-100 to do the correct positioning.
.ls
.le;Up arrow key generates - $[A
.le;Down arrow key generates - $[B
.le;Left arrow key generates - $[D
.le;Right arrow key generates - $[C
.els
.b
.lm+5
.break
"$[A" : TECO {$:-1^D}
.break
"$[B" : TECO {$:+1^D}
.break
.break
"$[C" : TECO {$:+1C}
.break
"$[D" : TECO {$:+1R}
.b
.lm-5