Reklama
Reklama
A Nother Text Editor
Highlights
ANTE is a flexible, general-purpose text editor.
a
particular
structure
on
text
(for
particular editing technique
(for
example,
programmable,
may
however,
and
be
example,
made
video
lines)
running
identically
on
combining
TOPS-10,
features
TENEX,
or require a
editing).
It
is
to do such things as handle
specially formatted text and perform video editing.
TOPS-10 and TENEX TECO,
It does not impose
from
and
It is based on both
both
versions
TOPS-20).
(and
It has been
deliberately kept simple, offering a powerful, symmetric set of commands
rather than a cluttered set of special purpose ones.
In addition to supporting TECO-style editing, ANTE provides a number
of new features.
The more important ones are described here.
The most significant new feature is the addition of multiple editing
environments.
This substantially increases editing flexibility -- parts
of a file may be separated and edited independently and then
number
merged,
a
of files may be edited at once and merged, and several files may
be consulted while one is being edited.
This has been
accomplished
by
extending
q-registers with the slight additional machinery necessary to
make each a separate, complete enviroment.
The editing
environment
is
A Nother Text Editor, Page 2
changed
via
the
A
command
to
a
given
q-register, after which all
commands operate on the q-register as if it were the
(the
main
text
buffer
special name "*").
is
in
main
typeout
buffer
fact nothing but a q-register with the
See EP, FA, FP, FQ, FX.
After a sequence of commands is executed one usually
the result.
text
wants
to
see
ANTE eliminates the need for ending a command stream with a
command
by
automatically
performing
one.
The
V
command
implicitly terminates a command stream unless the last
command
stream
explicit command
is
a
typeout
command,
overrides the implicit one.
in
which
case
the
has
a
positioning
word-oriented.
an
nN moves the position
the
(the
.
stream's
syntax
is
On the first pass the
verified,
If the syntax
is
and
if
proper
again and the commands are executed.
value)
n
an
by
[
and
],
define
error is detected
then
the
stream
is
See ^F.
To aid programming, ANTE uses a goto-less block
indicated
correctness
An aborted command stream
may be saved in a q-register with the B command.
Blocks,
TECO
effort to avoid the mangling of text with a mistyped command
processing is aborted.
scanned
pointer
See ^L, ^N, ^W.
stream, ANTE scans the stream twice.
of
commands.
command, N, and a delete command, O, that are
words, and nO deletes n words.
In
the
See FV, FW.
When editing documents it is useful to have word-oriented
ANTE
in
control
structure.
control scopes (which may be
nested), and are conditionally exited (any number of levels) with the FC
command.
They are closely related to the < > iterator.
A Nother Text Editor, Page 3
Command Input Controls
^A
^E
^F
^G
^H
^R
^U
^W
^V
<rubout>
<escape>
^H
<line feed>
^L
^N
delete the last character
print the command stream
delete and save the command stream (two in succession)
delete the command stream (two in succession)
delete the last character
print the current line
delete the current line
delete the last word
insert the next character into the command stream
delete the last character
terminate command stream input (two in succession)
equivalent to -LV$$ if first character
equivalent to LV$$ if first character
equivalent to -NV$$ if first character
equivalent to NV$$ if first character
Commands
Values may occur wherever n or m occur.
Integers in braces are default values.
Valid Qregs are 0 through 9, A through Z, and *.
Values
<digits>
+<value>{1}
-<value>{1}
<value>+<value>
<value>-<value>
.
Z
:
H
integer
unary sign
unary sign
addition
subtraction
the pointer position
the number of characters in the buffer
to the end of the line (equivalent to .UaL-2C.UbQaJ.,Qb)
all text (equivalent to 0,Z)
the value-producing commands Q, W, FN, FO, FTI, FZ, F*,
F/, #
Characters, Words, Lines
<n>{1}C
<n>{1}D
<n>{0}J
<n>{1}<,m>K
<n>{1}L
move pointer n characters
delete n characters
jump to the nth character
delete n lines (or from characters n to m)
move the pointer n lines
<n>{1}N
<n>{1}O
<n>{1}<,m>T
<n>{1}<,m>V
move the pointer n words
delete n words
print n lines (or from characters n to m)
equivalent to -(n-1)T FTS~$ nT (m is the print mode)
A Nother Text Editor, Page 4
Strings
I[string]
insert text (<tab> is equivalent)
<n>{1}R[string1][string2]
replace the nth instance of s1 with s2
(a null second string simply deletes the first string)
<n>{1}S[string] search n times for the string
Q-registers
A[Qreg]
B[Qreg]
change the editing context to the Qreg (initially Qreg *)
save the last command in the Qreg
(the command is inserted if the Qreg is the one being
edited;
otherwise the command replaces the Qreg's contents)
G[Qreg]
get the text from the Qreg
<n><,m>M[Qreg] execute the text in the Qreg (n and m are passed as
arguments)
<n>{1}<,m>P[Qreg]
put n lines into the Qreg (or from characters n to m)
Q[Qreg]
get the value from the Qreg
<n>{0}U[Qreg]
put the value into the Qreg
<n>{1}<,m>X[Qreg]
equivalent to <n><,m>P <n><,m>K
<n>{1}%[Qreg]
add n to the value in the Qreg
Input-Output
EG[string]
write the file, exit and go
EE
exit without writing a file
EN[string]
set the default file name used by EG, ER, EW, EX
EP[Qreg][string]
put the file into the Qreg
ER[string]
read the file
EV[string]
verify the file's existence (return 0 for success)
EW[string]
write the file
EX[string]
write the file and exit
Iteration
<n>{infinity}<
>
<n>{1}[
]
iterate
end the
iterate
end the
n times
body of an iteration
n times (like < but with default of 1)
body of an iteration (like >)
Other Commands
<n>=
W(B|I|S)
search)
print n
return the specified saved pointer position
(B: before last search, I: start of insert, S: start of
A Nother Text Editor, Page 5
FA
return to the Qreg last edited
<n>{10}FB
change the base of numeric input/output
<n>{0}<,m>{1}FC<E|N|G|L>
if n satisfies the given relation
then exit m iteration levels
(E:n=0, N:n#0, G:n>0, L:n<0) (the innermost level is 1)
<n>{1}FD[string]
delete n instances of the string
(equivalent to <n><R[string]>)
<n>{1}FE
exit n levels of iteration (equivalent to 0,<n>FCE)
FG[Qreg]
print the text in the Qreg (equivalent to @FTS[Qreg])
FH
halt command execution
<n>{" "}FI
insert n as a character at .
FK[Qreg]
eliminate the contents of the Qreg
FM[Qreg][Qreg] copy the contents of the first Qreg into the second Qreg
<n>{1}FN[string]
search (like S) and return value (0 for success)
FO
get the value of the character at .
<n>{1}<,m>FP[Qreg]
insert n lines into the Qreg (or from characters n to m)
FQ
list the status of all nonempty Qregs
<n>{" "}FR
replace n as the character at .
<n>{1}FS[string1][string2]
replace n instances of s1 with s2
(equivalent to <n><R[string1][string2]>)
<n>{0}FTE
set echo mode (1:monitor, 0:every char, -1:efficient)
FTI
input a character from the terminal
<n>{" "}<,m>FTO output n as a character to the terminal (with print mode
m)
<n>{0}FTP
set the print mode (-1:direct, 0:terse, 1:verbose)
<n>FTS[string] output the string to the terminal (with print mode n)
<n>{1000}FU
sleep n milliseconds
FV[string]
set the pointer indicator string used by the V command
<n>{0}FW
set <n> as the window size for the automatically executed
V
<n>{1}<,m>FX[Qreg]
equivalent to <n><,m>FP <n><,m>K
FY[Qreg]
verify the syntax of the commands in the Qreg
FZ[Qreg]
get the Z value from the Qreg
<n,m>F*
multiply n by m
<n,m>F/
divide n by m
#[char]
produce the character's value
?
print commands as they are executed
![string]
comment
;
accept and discard arguments
A Nother Text Editor, Page 6
Notes
String arguments:
They are normally terminated with an <escape>. They may be
delimited instead, in which case the / prefix is used.
The
command
format
is
/
<command> <delimiter> [string]
<delimiter>, for example /I'a string'. The contents of a
Qreg may also be used as a string, indicated by @. The
command format is @ <command> [Qreg], for example @SX.
Searches:
The default search string (the string argument to the S,
FD, and FN commands, and the first string argument to the R
and FS commands) is the last one given. Except for the FN
command,
if a search within an iteration fails, the
iteration is terminated. There is one wildcard character,
^X, which matches everything. Note the differences between
R, FS, and FD.
Qregs:
The * Qreg is the default for primary editing. A Qreg may
hold text and a value simultaneously. Note that for the P,
X, and FM commands the original contents of the target Qreg
are lost, for the FP and FX commands the given text is
inserted into the target's original contents, and for the EP
command the input text is appended to the target's contents.
File names:
Each Qreg has a default file name. It is set to the last
file name given to the last ER, EW, or EN command executed
in that Qreg. If the EN command is given a null argument
the default is removed. Note that the EP command does not
change the default.
Terminal print modes:
In direct mode (-1) all control characters are sent to the
terminal without translation.
In terse mode (0) some
control characters are output directly and the rest are
converted to printing characters preceded by "^".
In
verbose mode (1) some control characters are sent as text
strings (<cr>, <lf>, <escape>, <rubout>) and the rest as in
terse.
Terminal echo modes:
In monitor mode (1) all characters are echoed by the
monitor. In character mode (0) they are all echoed by ANTE.
In efficient mode (-1) those that require special treatment
are echoed by ANTE, while all others are echoed by the
monitor.
Integers:
Integers that begin with 0 are always octal.
Invoking the editor:
In general
the command line invoking ANTE can be in one of
four forms: CREATE <filename> creates a new file; EDIT
<filename> edits an exisiting file; R ANTE ;<filename> is
equivalent to EDIT; and R ANTE !<filename> executes the
given file as a macro.
">
/
Pobierz
Tylko małe przypomnienie. Możesz wyświetlić dokument tutaj. Ale co najważniejsze, nasza sztuczna inteligencja już go przeczytała. Może wyjaśnić złożone rzeczy w prosty sposób, odpowiedzieć na Twoje pytania w dowolnym języku i pomóc w szybkiej nawigacji nawet po najdłuższych lub najbardziej skomplikowanych dokumentach.
Reklama