home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
gnu
/
info
/
termcap.info-3
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-07-11
|
49KB
|
831 lines
This is Info file /home/gd/gnu/termcap/termcap.info, produced by
Makeinfo-1.52 from the input file /home/gd/gnu/termcap/termcap.texi.
This file documents the termcap library of the GNU system.
Copyright (C) 1988 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.
File: termcap.info, Node: Insdel Char, Next: Standout, Prev: Insdel Line, Up: Capabilities
Insert/Delete Character
=======================
"Inserting a character" means creating a blank space in the middle
of a line, and pushing the rest of the line rightward. The character
in the rightmost column is lost.
"Deleting a character" means causing the character to disappear from
the screen, closing up the gap by moving the rest of the line leftward.
A blank space appears in the rightmost column.
Insertion and deletion of characters is useful in programs that
maintain an updating display some parts of which may get longer or
shorter. It is also useful in editors for redisplaying the results of
editing within a line.
Many terminals provide commands to insert or delete a single
character at the cursor position. Some provide the ability to insert
or delete several characters with one command, using the number of
characters to insert or delete as a parameter.
Many terminals provide an insert mode in which outputting a graphic
character has the added effect of inserting a position for that
character. A special command string is used to enter insert mode and
another is used to exit it. The reason for designing a terminal with
an insert mode rather than an insert command is that inserting
character positions is usually followed by writing characters into
them. With insert mode, this is as fast as simply writing the
characters, except for the fixed overhead of entering and leaving
insert mode. However, when the line speed is great enough, padding may
be required for the graphic characters output in insert mode.
Some terminals require you to enter insert mode and then output a
special command for each position to be inserted. Or they may require
special commands to be output before or after each graphic character to
be inserted.
Deletion of characters is usually accomplished by a straightforward
command to delete one or several positions; but on some terminals, it
is necessary to enter a special delete mode before using the delete
command, and leave delete mode afterward. Sometimes delete mode and
insert mode are the same mode.
Some terminals make a distinction between character positions in
which a space character has been output and positions which have been
cleared. On these terminals, the effect of insert or delete character
runs to the first cleared position rather than to the end of the line.
In fact, the effect may run to more than one line if there is no
cleared position to stop the shift on the first line. These terminals
are identified by the `in' flag capability.
On terminals with the `in' flag, the technique of skipping over
characters that you know were cleared, and then outputting text later
on in the same line, causes later insert and delete character
operations on that line to do nonstandard things. A program that has
any chance of doing this must check for the `in' flag and must be
careful to write explicit space characters into the intermediate
columns when `in' is present.
A plethora of terminal capabilities are needed to describe all of
this complexity. Here is a list of them all. Following the list, we
present an algorithm for programs to use to take proper account of all
of these capabilities.
String of commands to enter insert mode.
If the terminal has no special insert mode, but it can insert
characters with a special command, `im' should be defined with a
null value, because the `vi' editor assumes that insertion of a
character is impossible if `im' is not provided.
New programs should not act like `vi'. They should pay attention
to `im' only if it is defined.
String of commands to leave insert mode. This capability must be
present if `im' is.
On a few old terminals the same string is used to enter and exit
insert mode. This string turns insert mode on if it was off, and
off it it was on. You can tell these terminals because the `ei'
string equals the `im' string. If you want to support these
terminals, you must always remember accurately whether insert mode
is in effect. However, these terminals are obsolete, and it is
reasonable to refuse to support them. On all modern terminals, you
can safely output `ei' at any time to ensure that insert mode is
turned off.
String of commands to insert one character position at the cursor.
The cursor does not move.
If outputting a graphic character while in insert mode is
sufficient to insert the character, then the `ic' capability
should be defined with a null value.
If your terminal offers a choice of ways to insert--either use
insert mode or use a special command--then define `im' and do not
define `ic', since this gives the most efficient operation when
several characters are to be inserted. *Do not* define both
strings, for that means that *both* must be used each time
insertion is done.
String of commands to output following an inserted graphic
character in insert mode. Often it is used just for a padding
spec, when padding is needed after an inserted character (*note
Padding::.).
String of commands to insert N character positions at and after
the cursor. It has the same effect as repeating the `ic' string
and a space, N times.
If `IC' is provided, application programs may use it without first
entering insert mode.
Flag whose presence means it is safe to move the cursor while in
insert mode and assume the terminal remains in insert mode.
Flag whose presence means that the terminal distinguishes between
character positions in which space characters have been output and
positions which have been cleared.
An application program can assume that the terminal can do character
insertion if *any one of* the capabilities `IC', `im', `ic' or `ip' is
provided.
To insert N blank character positions, move the cursor to the place
to insert them and follow this algorithm:
1. If an `IC' string is provided, output it with parameter N and you
are finished. Otherwise (or if you don't want to bother to look
for an `IC' string) follow the remaining steps.
2. Output the `im' string, if there is one, unless the terminal is
already in insert mode.
3. Repeat steps 4 through 6, N times.
4. Output the `ic' string if any.
5. Output a space.
6. Output the `ip' string if any.
7. Output the `ei' string, eventually, to exit insert mode. There is
no need to do this right away. If the `mi' flag is present, you
can move the cursor and the cursor will remain in insert mode;
then you can do more insertion elsewhere without reentering insert
mode.
To insert N graphic characters, position the cursor and follow this
algorithm:
1. If an `IC' string is provided, output it with parameter N, then
output the graphic characters, and you are finished. Otherwise
(or if you don't want to bother to look for an `IC' string) follow
the remaining steps.
2. Output the `im' string, if there is one, unless the terminal is
already in insert mode.
3. For each character to be output, repeat steps 4