home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / termcap.info-3 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  49KB  |  831 lines

  1. This is Info file /home/gd/gnu/termcap/termcap.info, produced by
  2. Makeinfo-1.52 from the input file /home/gd/gnu/termcap/termcap.texi.
  3.    This file documents the termcap library of the GNU system.
  4.    Copyright (C) 1988 Free Software Foundation, Inc.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided that
  10. the entire resulting derived work is distributed under the terms of a
  11. permission notice identical to this one.
  12.    Permission is granted to copy and distribute translations of this
  13. manual into another language, under the above conditions for modified
  14. versions, except that this permission notice may be stated in a
  15. translation approved by the Foundation.
  16. File: termcap.info,  Node: Insdel Char,  Next: Standout,  Prev: Insdel Line,  Up: Capabilities
  17. Insert/Delete Character
  18. =======================
  19.    "Inserting a character" means creating a blank space in the middle
  20. of a line, and pushing the rest of the line rightward.  The character
  21. in the rightmost column is lost.
  22.    "Deleting a character" means causing the character to disappear from
  23. the screen, closing up the gap by moving the rest of the line leftward.
  24. A blank space appears in the rightmost column.
  25.    Insertion and deletion of characters is useful in programs that
  26. maintain an updating display some parts of which may get longer or
  27. shorter.  It is also useful in editors for redisplaying the results of
  28. editing within a line.
  29.    Many terminals provide commands to insert or delete a single
  30. character at the cursor position.  Some provide the ability to insert
  31. or delete several characters with one command, using the number of
  32. characters to insert or delete as a parameter.
  33.    Many terminals provide an insert mode in which outputting a graphic
  34. character has the added effect of inserting a position for that
  35. character.  A special command string is used to enter insert mode and
  36. another is used to exit it.  The reason for designing a terminal with
  37. an insert mode rather than an insert command is that inserting
  38. character positions is usually followed by writing characters into
  39. them.  With insert mode, this is as fast as simply writing the
  40. characters, except for the fixed overhead of entering and leaving
  41. insert mode.  However, when the line speed is great enough, padding may
  42. be required for the graphic characters output in insert mode.
  43.    Some terminals require you to enter insert mode and then output a
  44. special command for each position to be inserted.  Or they may require
  45. special commands to be output before or after each graphic character to
  46. be inserted.
  47.    Deletion of characters is usually accomplished by a straightforward
  48. command to delete one or several positions; but on some terminals, it
  49. is necessary to enter a special delete mode before using the delete
  50. command, and leave delete mode afterward.  Sometimes delete mode and
  51. insert mode are the same mode.
  52.    Some terminals make a distinction between character positions in
  53. which a space character has been output and positions which have been
  54. cleared.  On these terminals, the effect of insert or delete character
  55. runs to the first cleared position rather than to the end of the line.
  56. In fact, the effect may run to more than one line if there is no
  57. cleared position to stop the shift on the first line.  These terminals
  58. are identified by the `in' flag capability.
  59.    On terminals with the `in' flag, the technique of skipping over
  60. characters that you know were cleared, and then outputting text later
  61. on in the same line, causes later insert and delete character
  62. operations on that line to do nonstandard things.  A program that has
  63. any chance of doing this must check for the `in' flag and must be
  64. careful to write explicit space characters into the intermediate
  65. columns when `in' is present.
  66.    A plethora of terminal capabilities are needed to describe all of
  67. this complexity.  Here is a list of them all.  Following the list, we
  68. present an algorithm for programs to use to take proper account of all
  69. of these capabilities.
  70.      String of commands to enter insert mode.
  71.      If the terminal has no special insert mode, but it can insert
  72.      characters with a special command, `im' should be defined with a
  73.      null value, because the `vi' editor assumes that insertion of a
  74.      character is impossible if `im' is not provided.
  75.      New programs should not act like `vi'.  They should pay attention
  76.      to `im' only if it is defined.
  77.      String of commands to leave insert mode.  This capability must be
  78.      present if `im' is.
  79.      On a few old terminals the same string is used to enter and exit
  80.      insert mode.  This string turns insert mode on if it was off, and
  81.      off it it was on.  You can tell these terminals because the `ei'
  82.      string equals the `im' string.  If you want to support these
  83.      terminals, you must always remember accurately whether insert mode
  84.      is in effect.  However, these terminals are obsolete, and it is
  85.      reasonable to refuse to support them.  On all modern terminals, you
  86.      can safely output `ei' at any time to ensure that insert mode is
  87.      turned off.
  88.      String of commands to insert one character position at the cursor.
  89.      The cursor does not move.
  90.      If outputting a graphic character while in insert mode is
  91.      sufficient to insert the character, then the `ic' capability
  92.      should be defined with a null value.
  93.      If your terminal offers a choice of ways to insert--either use
  94.      insert mode or use a special command--then define `im' and do not
  95.      define `ic', since this gives the most efficient operation when
  96.      several characters are to be inserted.  *Do not* define both
  97.      strings, for that means that *both* must be used each time
  98.      insertion is done.
  99.      String of commands to output following an inserted graphic
  100.      character in insert mode.  Often it is used just for a padding
  101.      spec, when padding is needed after an inserted character (*note
  102.      Padding::.).
  103.      String of commands to insert N character positions at and after
  104.      the cursor.  It has the same effect as repeating the `ic' string
  105.      and a space, N times.
  106.      If `IC' is provided, application programs may use it without first
  107.      entering insert mode.
  108.      Flag whose presence means it is safe to move the cursor while in
  109.      insert mode and assume the terminal remains in insert mode.
  110.      Flag whose presence means that the terminal distinguishes between
  111.      character positions in which space characters have been output and
  112.      positions which have been cleared.
  113.    An application program can assume that the terminal can do character
  114. insertion if *any one of* the capabilities `IC', `im', `ic' or `ip' is
  115. provided.
  116.    To insert N blank character positions, move the cursor to the place
  117. to insert them and follow this algorithm:
  118.   1. If an `IC' string is provided, output it with parameter N and you
  119.      are finished.  Otherwise (or if you don't want to bother to look
  120.      for an `IC' string) follow the remaining steps.
  121.   2. Output the `im' string, if there is one, unless the terminal is
  122.      already in insert mode.
  123.   3. Repeat steps 4 through 6, N times.
  124.   4. Output the `ic' string if any.
  125.   5. Output a space.
  126.   6. Output the `ip' string if any.
  127.   7. Output the `ei' string, eventually, to exit insert mode.  There is
  128.      no need to do this right away.  If the `mi' flag is present, you
  129.      can move the cursor and the cursor will remain in insert mode;
  130.      then you can do more insertion elsewhere without reentering insert
  131.      mode.
  132.    To insert N graphic characters, position the cursor and follow this
  133. algorithm:
  134.   1. If an `IC' string is provided, output it with parameter N, then
  135.      output the graphic characters, and you are finished.  Otherwise
  136.      (or if you don't want to bother to look for an `IC' string) follow
  137.      the remaining steps.
  138.   2. Output the `im' string, if there is one, unless the terminal is
  139.      already in insert mode.
  140.   3. For each character to be output, repeat steps 4