File psl-1983/3-1/doc/nmode/nm-editing.ibm artifact 1a6a8caa96 part of check-in d9e362f11e


,MOD
- R 44X (11 April 1983) <PSL.NMODE-DOC>NM-EDITING.ibm
PLA 97_LAS 80 0_FIR 2_INT 1 6.0_TYP 160 163 162 193_INP 12 101_MAR 2
,END
,PRO
201 OUT 160_202 OUT 163_203 OUT 162_204 OUT 193
205 INP 12 101_206 INP 12 102
,END
,DEFINE
 UNIT SPACE
 FUNCTION
,END

          201/NMODE Manual (Basic Editing Commands)                             Page 4-1


          202/4.  Basic Editing Commands

            201/We now give the basics of how to enter text, make corrections, and save
          the text in a file.  If this material is new to you, you might learn it more
          easily by running the NTEACH program.

          202/4.1  Inserting Text

            201/To insert printing characters into the text you are editing, just type them.
          When the selected buffer is an editing buffer, all printing characters you
          type are inserted into the text at the cursor (that is, at 202/point201/), and the
          cursor moves forward.  Any characters after the cursor move forward too.
          If the text in the buffer is FOOBAR, with the cursor before the B, then if
          you type XX, you get FOOXXBAR, with the cursor still before the B.

            To correct text you have just inserted, you can use Backspace.  Backspace
          deletes the character 203/before 201/the cursor (not the one that the cursor is on top
          of or under;  that is the character 203/after 201/the cursor).  The cursor and all
          characters after it move backwards.   Therefore, if you type a printing
          character and then type Backspace, they cancel out.

            To end a line and start typing a new one, type Return (Customizers, note:
          this runs the function 203/return-command201/).  Return operates by inserting a line
          separator, so if you type Return in the middle of a line, you break the line
          in two.

            If you add too many characters to one line, without breaking it with a
          Return, the line will display a "!" at the extreme right margin.  This does
          not stop you from adding further characters, but those characters will not be
          visible until the line is somehow broken, or until you scroll the window
          horizontally using C-X >.

            Direct  insertion  works  for  printing  characters  and  space,  but other
          characters act as editing commands and do not insert themselves.  If you
          need to insert a control character, Altmode, Tab, Backspace or Rubout, you
          must  202/quote  201/it  by  typing  the  Control-Q  (203/insert-next-character-command201/)
          command first.  See Section 3 [Control], page 1.

          202/4.2  Moving The Cursor

            201/To do more than insert characters, you have to know how to move the
          cursor.  Here are a few of the commands for doing that.


                  C-A    Move to the beginning of the line.
                  C-E    Move to the end of the line.
                  C-F    Move forward over one character.
                  ESC-C Same as C-F.
                           Many terminals have an arrow key pointing right which
                          sends
                           this escape sequence.
          201/Page 4-2                                 NMODE Manual (Moving The Cursor)


                  C-B    Move backward over one character.
                  ESC-D Same as C-B.
                           Many terminals have an arrow key pointing left which sends
                           this escape sequence.
                  C-N    Move down one line, vertically.  If you start in the middle of
                          one line, you end in the middle of the next.  From the last
                          line of text, it creates a new line.
                  ESC-B Same as C-N except that it will not create a new line.
                           Many terminals have an arrow key pointing down which
                          sends
                           this escape sequence.
                  C-P    Move up one line, vertically.
                  ESC-A Same as C-P.
                           Many terminals have an arrow key pointing up which sends
                           this escape sequence.
                  C-L    Clear the screen and reprints everything.  C-U C-L reprints
                          just the line that the cursor is on.
                  C-T    Transpose two characters (the ones before and after the
                          cursor).
                  M-<    Move to the top of your text.
                  M->    Move to the end of your text.

            There is a special command: C-X C-N (203/set-goal-column-command201/), which
          affects how C-P, ESC-A, C-N, and ESC-B act.  Without an argument, C-X
          C-N will store the current column so that the vertical movement commands will
          try to move into it when they move point up or down, regardless of the
          column that point is in prior to the vertical movement.  To remove the goal
          column, give the C-X C-N command with an argument.

            There  is a command, C-X = (203/what-cursor-position-command201/), which is
          normally used to obtain information about where one is in a buffer.  If given
          an argument, however, it will treat the argument as a line-number and it will
          jump to the corresponding line.

          202/4.3  Erasing Text

                  201/Backspace  Delete the character before the cursor.
                  C-D    Delete the character after the cursor.
                  C-K    Kill to the end of the line.

            You already know about the Backspace command which deletes the character
          before the cursor.  Another command, Control-D, deletes the character after
          the cursor, causing the rest of the text on the line to shift left.   If
          Control-D is typed at the end of a line, that line and the next line are joined
          together.

            To erase a larger amount of text, use the Control-K command, which kills a
          line at a time.  If Control-K is done at the beginning or middle of a line, it
          kills all the text up to the end of the line.  If Control-K is done at the end
          of a line, it joins that line and the next line.  See Section 11 [Killing], page
          1, for more flexible ways of killing text.
          201/NMODE Manual (Files)                                                Page 4-3


          202/4.4  Files

            201/The commands above are sufficient for creating text in the NMODE buffer.
          The more advanced NMODE commands just make things easier.  But to keep
          any text permanently you must put it in a 202/file201/.  Files are the objects which
          the  operating  system  uses  for  storing  data  for  communication  between
          different programs or to hold onto for a length of time.  To tell NMODE to
          edit text in a file, choose a 202/filename201/, such as FOO, and type C-X C-V
          FOO<CR>.  This 202/visits 201/the file FOO so that its contents appear on the screen
          for editing.  You can make changes, and then 202/save 201/the file by typing C-X
          C-S.  This makes the changes permanent and actually changes the file FOO.
          Until then, the changes are only inside your NMODE, and the file FOO is not
          really changed.  If the file FOO doesn't exist, and you want to create it,
          visit it as if it did exist.  When you save your text with C-X C-S the file
          will be created.

            Of course, there is a lot more to learn about using files.  See Section 15
          [Files], page 1.

          202/4.5  Using Blank Lines Can Make Editing Faster

                  201/C-O        Insert one or more blank lines after the cursor.
                  C-X C-O   Delete all but one of many consecutive blank lines.

            It is much more efficient to insert text at the end of a line than in the
          middle.  So if you want to stick a new line before an existing one, the best
          way is to make a blank line there first and then type the text into it, rather
          than inserting the new text at the beginning of the existing line and finally
          inserting a line separator.   Making the blank line first also makes the
          meaning of the text clearer while you are typing it in.

            To make a blank line, you can type Return and then C-B.  But there is a
          single  character  for  this:  C-O  (Customizers:  this  is  the  function
          203/open-line-command201/) So, FOO<CR> is equivalent to C-O FOO C-F.

            If you want to insert many lines, you can type many C-O's at the
          beginning (or you can give C-O an argument to tell it how many blank lines
          to make.  See Section 5 [Arguments], page 1, for how).  As you then insert
          lines of text, you will notice that Return behaves strangely: it "uses up" the
          blank lines instead of pushing them down.

            If you don't use up all the blank lines, you can type C-X C-O (the
          function 203/delete-blank-lines-command201/) to get rid of all but one.  When point is
          on a blank line, C-X C-O replaces all the blank lines around that one with a
          single blank line.  When point is on a nonblank line, C-X C-O deletes any
          blank lines following that nonblank line.

REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]