Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - 70,6067/edt10/edt2.mem
There is 1 other file named edt2.mem in the archive. Click here to see a list.

                                 CHAPTER 2

                                 EDT BASICS


   The first chapter briefly surveyed EDT's features.  You will use  some
   of  those  features  when  you  first start editing with EDT.  You can
   learn about the other features as you need them.

   This chapter describes basic EDT concepts and features.   Because  EDT
   has  so  many  features, including three primary editing modes, you do
   not  need  all  the  information  contained  in  this  chapter  before
   beginning your first EDT session.

   This chapter includes material for readers of all levels.  If you have
   had  little  or  no  experience  with computer editors, you should not
   expect to understand every detail.  For example,  when  you  read  the
   section  about  journal  file  recovery,  you  might  not  fully grasp
   everything.  But after a system interruption occurs and  you  see  the
   journal  file  in  your  directory,  you can refer back to the journal
   section to find out how to use this facility.

   The first sections in this chapter cover some of the  terminology  and
   concepts  that you should be familiar with when using EDT.  There is a
   brief description of starting  and  ending  an  EDT  editing  session.
   EDT's journal/recovery facility is the subject of the last section.


   In learning about EDT you should be aware of certain  terms  that  are
   used  to describe the editor and its operations.  Some of these terms,
   such as string, file, and buffer, have  the  same  meanings  in  other
   computer applications.  Others, such as mode and editing session, have
   special meanings in the context of describing EDT.

                                 EDT BASICS

   2.2.1  EDT Terminology

        TERM                    DEFINITION

   EDT                     An interactive text editor.

   Mode                    Method of  editing.   EDT  has  three  primary
                           editing modes:  keypad, line, and nokeypad.

   Screen Mode             Either keypad or nokeypad mode.   These  modes
                           can  only  be  used on certain types of screen
                           terminals.  (See Appendix C for the list.)

   Change Mode             An editing mode that you access  through  line
                           mode's  CHANGE  or  SET  MODE  CHANGE command.
                           Change  modes  are  keypad,  nokeypad,  and  a
                           secondary  editing mode called hardcopy change

   Keypad Mode             The main screen mode.  This mode uses the keys
                           located  on  the  small keypad at the right of
                           the  terminal  keyboard  to  perform   editing
                           functions.   You  can  use  this mode on VT100
                           type and VT52 terminals.

   Nokeypad Mode           A screen mode  that  uses  command  words  and
                           abbreviations  to  perform editing operations.
                           These commands enable you to extend the keypad
                           mode  operations  through EDT's key definition
                           facility.  You can use this mode on VT100 type
                           and VT52 terminals.

   Line Mode               An editing  mode  that  can  be  used  on  any
                           command  terminal  connected  to  an operating
                           system that  supports  EDT.   Line  mode  uses
                           commands to perform editing operations.

   Hardcopy Change Mode    A secondary editing mode that enables  you  to
                           use   most   nokeypad   editing   commands  on
                           terminals not supported for screen editing.

   Editing Session         The work you do with the EDT editor  from  the
                           time  you  type  the  system  EDIT/EDT command
                           until you type EDT's EXIT or QUIT command.

   Insert State            The way EDT behaves  when  you  are  inserting
                           text  in  line or nokeypad mode.  For example,
                           pressing the RETURN key adds a line terminator
                           to  your  text  instead of sending data to the
                           computer.  Use CTRL/Z to exit from the  insert

                                 EDT BASICS

   Operating System        The underlying software that runs the computer
                           to  which  your  terminal  is connected.  This
                           manual deals with EDT running on  the  TOPS-20
                           operating system.

   Prompt                  The signal that you get  from  your  operating
                           system  or  from  EDT  that  tells you to type
                           commands or information at your terminal.

   System Command Level    When you see a system prompt (for example $ or
                           @), respond with a system command.  If you are
                           at the system command level, you are not using
                           the EDT editor.

   File                    A collection of data  that  is  located  in  a
                           relatively   permanent  storage  area  in  the
                           computer.  You use EDT to create and edit text

   Text File               A  file  that  is   composed   of   ASCII-type
                           characters   such   as  letters,  digits,  and
                           punctuation marks.

   Input File              A file that contains text used by EDT  at  the
                           start of or during your editing session.

   Output File             A file that EDT creates and into which it puts

   File Specification      A unique file identifier.  File specifications
                           must  include  at least the file name, but can
                           also include device, and directory information
                           as well as file type and generation number.

   Buffer                  A temporary storage area that you  use  during
                           your editing session.

   Text Entity             A group of one or more  contiguous  characters
                           that  EDT  considers  as a special unit.  Text
                           entities include:  word, line,  sentence,  and

   Control Character       A  special  character  signal   that   affects
                           printing  or  device  operations.  To send the
                           signal to the computer, you  must  press  both
                           the  CTRL  key  and  a  keyboard key.  Control
                           characters signal such printing operations  as
                           end of line, end of page, and tab stop.

   Control Key Sequence    The combination of keys needed  to  produce  a
                           control  character.  Control key sequences are
                           represented as CTRL/x where CTRL refers to the
                           CTRL  key  and  "x"  is  a  character  on  the

                                 EDT BASICS

   Line Terminator         The signal that tells the  computer  to  start
                           the  following text on a new line.  In EDT you
                           can  reference  the  line  terminator  with  a
                           single  character  --  CTRL/M  -- and insert a
                           line terminator in your text by  pressing  the
                           RETURN key.

   Cursor                  An indicator that shows EDT's current position
                           in your text when you are using a screen mode.

   Current Line            The line where EDT is currently positioned  in
                           line   mode.   In  screen  mode  editing,  the
                           current line is the one on which the cursor is

   Direction               EDT's current direction.   EDT  works  in  two
                           directions -- forward toward the end or bottom
                           of  the  buffer  and   backward   toward   the
                           beginning or top of the buffer.

   String                  A group  of  contiguous  characters  that  you
                           supply  with  some  EDT commands.  You can use
                           strings for searching and substituting.

   Select Range            A  group  of  contiguous   characters   (often
                           extending for several lines) that you want EDT
                           to operate on.  For example, you  can  delete,
                           move, or copy a select range.

   Line Number             A number that EDT automatically assigns  to  a
                           line  of  text  during  your  editing session.
                           These line numbers only appear  when  you  are
                           working in line mode.

   Line Range              A reference to one or more  lines  that  tells
                           EDT  which  part of the text you want the line
                           mode command to affect.

   Specifier               Information you supply with  EDT  commands  to
                           tell  EDT  such  things  as  how many times to
                           perform a command and which parts of the  text
                           to  affect.   Text  entities, counts, and line
                           ranges are specifiers.

   Qualifier               A special line mode command word that modifies
                           the  way EDT performs the command.  Qualifiers
                           are optional.  Whenever you type a  qualifier,
                           you  must  precede  the  qualifier word with a
                           slash (for example, /QUERY).

   Default                 The option or setting that EDT uses  when  you
                           do not explicitly indicate otherwise.

                                 EDT BASICS

   2.2.2  Editing Modes

   The editing mode you use with EDT depends on the type of terminal  you
   have and the nature of your editing work.  If you have a VT100 type or
   VT52 terminal, you can use screen mode.  (See Appendix C for a list of
   terminals that EDT supports in screen mode.)

   You will want to focus your attention on keypad editing  if  you  have
   the  appropriate  terminal.   As you become proficient in keypad mode,
   you can increase  the  capabilities  of  keypad  editing  by  creating
   additional  keypad key definitions.  Since these definitions are based
   on nokeypad command syntax, becoming familiar  with  nokeypad  editing
   helps  you  extend your keypad editing functions.  Chapter 3 describes
   keypad editing;  Chapter 5 discusses nokeypad editing.

   If you do not have access to one of these terminals, you must use line
   mode.   Chapter  4  describes  line  mode editing commands.  Line mode
   users can go directly to Chapter 4 after reading this chapter.

   2.2.3  Editing Session

   The term editing session or EDT session refers to the work you  do  at
   your terminal from the time you issue the system EDIT command to start
   editing with EDT until you give an EDT command to  leave  the  editor.
   Most  sessions  involve inserting, locating, moving, or deleting text.
   For example, an EDT session might consist of asking EDT  to  create  a
   new  file,  typing  text  into  it,  correcting mistakes or making any
   changes you want, and saving the results.

   When you edit an existing file using EDT, you work on a  copy  of  the
   original  file.   The  original  file  remains in its directory and is
   unchanged by the editing work.  EDT places the copy in a buffer  where
   you can edit the text.  After you finish your editing session, you can
   save a copy of the edited text in an  output  file  or  you  can  save
   nothing.   The contents of your original file are unaffected in either

   Whenever you ask EDT to edit a file that does not  exist,  the  editor
   sets  up  an  empty  buffer  to hold the text you will be typing.  You
   still have the option of saving nothing when you finish  your  editing
   session,  since EDT does not actually create the new output file until
   you end your session.

                                 EDT BASICS

   2.2.4  Prompts

   In using EDT, you will see two types of prompts.  One  is  the  system
   prompt.  The system prompts are:


   Whenever you see the system prompt, you are ready  to  type  a  system
   command.  The system command associated with EDT is:


   The |hand| symbol is used in  this  manual  to  represent  the  system
   command prompt.  When |hand| appears in an example, you should see one
   of the normal system prompts at the left of your screen or paper:


   On most operating systems, EDT is the standard editor.  To call up the
   EDT  editor, all you need to type is EDIT.  However, if EDT is not the
   standard editor on your system, you must include other system commands
   to  be  sure  of getting EDT instead of some other editor.  The system
   appendices give more information on explicitly invoking EDT.

   There are a number of qualifiers  that  you  can  use  with  the  EDIT
   command.   These  system  qualifiers  enable  you to do such things as
   change the name of the output file,  use  the  recovery  facility,  or
   examine  a  file  that  you  do not have the authority to modify.  The
   system appendices describe the qualifiers that you can  use  with  the
   EDIT command.

   EDT has several prompts.  The line mode prompt is  the  asterisk  (*).
   Whenever you see the asterisk at the left of your screen or paper, you
   are ready to type a line mode command.  The /QUERY qualifier  in  line
   mode  uses  the  question  mark (?) as a prompt.  Type one of /QUERY's
   four valid responses when you see this prompt.

   In keypad mode, EDT prompts you for a search string whenever  you  use
   the  FIND  function.   The prompt is the phrase "Search for:  ".  When
   you use keypad's COMMAND function, EDT prints the prompt "Command:   "
   to tell you to type a line mode command.

                                 EDT BASICS

   2.2.5  Files

   A file is a collection of data that is treated as a distinct  physical
   unit.   Files  can  contain  a variety of data types, but EDT can work
   only with text files.  The type of material that  is  stored  in  text
   files  includes  letters, memos, computer programs, lists, and tables.
   The files are stored in the computer so that you can use them over and
   over again.

   Text files are composed of elements such as words  and  numbers.   The
   text  elements  are groups of characters that include letters, digits,
   punctuation  marks,  and  certain  signal  codes  (for  example,  line
   terminator, horizontal tab, and page separator).  Appendix D lists all
   the characters that are valid in text files.

   Files that contain other computer codes or signals are not  considered
   to be text files and cannot be edited with EDT.

   Some non-standard text files, such as those that have  been  processed
   by  the  RUNOFF  formatter,  can  be  edited  with EDT.  You should be
   careful when editing such files;  you might not get  the  results  you
   expect.  If possible, convert the files to standard text format before
   editing them.  If you cannot do this, you should  be  aware  of  which
   elements  make  that  file format non-standard.  Try to avoid altering
   those elements.

   You can edit any text file that you have access to.  If the file is in
   your  current  directory,  simply  use the file specification with the
   system EDIT command.  For files  in  other  directories,  be  sure  to
   include the directory specification in the EDIT command line.

   When you give EDT the name of a file  that  does  not  exist  in  your
   current  directory  or  in  the  directory you specify, EDT prints the

             Input file does not exist

   If you are using EDT to create a new file, this message confirms  that
   there  is no file with that name.  You can now enter the text you want
   that file to contain.  When you type the EXIT command at  the  end  of
   your session, EDT creates a file containing the text you typed.

   If you expected EDT  to  find  an  existing  file  but  received  this
   message,  you  have  probably  typed  the  wrong file specification or
   forgotten to identify the directory.  Use EDT's QUIT command  to  stop
   the editing session and start over again with the system EDIT command.

                                 EDT BASICS

   2.2.6  Input And Output Files

   EDT uses several files during an editing session.  The  term  external
   file  refers  to files outside of your editing session.  These include
   several types of input and output files.

   Input files are files that already contain text that EDT uses to start
   your  editing  session or that EDT adds to your editing session.  When
   you edit an existing file, that file is the primary input  file.   EDT
   copies  the  text  from that file into its MAIN buffer so you can edit

   A startup command file is another type of input file.  EDT  reads  the
   information  contained  in  that  file and processes it before turning
   over the editing session to you.

   During your editing session you can use the line mode INCLUDE  command
   to  copy  other files into your editing session.  These files are also
   input files.

   Output files are those created by EDT at the end  of  or  during  your
   editing  session.  The primary output file is the one that EDT creates
   when you use the EXIT command to end your session.  This  output  file
   contains the copy of the text in your MAIN buffer.

   Using line mode's WRITE or PRINT command  you  can  create  additional
   output  files  during  your  editing  session.  These output files can
   contain either the entire contents or a portion of any  buffer.   When
   you  type  the file specification with the WRITE or PRINT command, EDT
   creates that file either  in  the  current  directory  or  in  another
   directory  if  you  include the directory specification in the command
   line.  Note, however, that you cannot create new directories with  the
   WRITE or PRINT command.

   EDT's journal file is also an output file.  EDT creates this  file  as
   soon   as  you  start  your  editing  session  and  continues  to  add
   information to it until the end of your  session.   However,  in  most
   cases, when you end your session, EDT discards the journal file.  (See
   the last section in this chapter for more information on  the  journal

   2.2.7  File Specification

   You use the file specification to identify a specific  file.   A  full
   file specification can consist of five elements:

             file name                file type
             device name              directory name
             generation number

   On the TOPS-20 operating system, you can omit  the  generation  number
   whenever  you  want  to edit the most recent generation of the file or
   create a new file.  Similarly, file specifications in  some  operating

                                 EDT BASICS

   systems  do  not  have  node names.  If your operating system does use
   node names, you can omit the node name whenever you are editing a file
   on your local node.

   Whenever you are required to use a file specification  in  an  EDT  or
   system  command,  you  must  include  at  least  the  file  name.  The
   remaining elements are optional.  Most of the examples show  both  the
   file  name  and  the file type whenever a file specification is called

   2.2.8  Buffers

   An EDT buffer resembles a file in that it occupies  storage  space  in
   the  computer system and is used to contain text.  However, the use of
   that space is temporary.  EDT buffers exist only for the  duration  of
   your editing session.  When you end your session, EDT discards all the
   buffers you used.

   The first thing EDT does when you start to edit an existing file is to
   copy  the text from that file into a buffer called MAIN.  The original
   file still exists in its directory;  EDT works only on the copy.  When
   you  use  EDT to create a new file, the first thing the editor does is
   set aside an empty buffer called MAIN.  No new  file  actually  exists
   until you end your EDT session.

   When you use the EXIT command to  finish  your  editing  session,  EDT
   copies  the  contents  of  the  MAIN  buffer into a new file.  All the
   buffers created during your session are deleted and the storage  space
   they  occupied  is turned over to the operating system for other uses.
   Before you give the EXIT command, you can transfer the contents of any
   other  buffer  to an external file by using line mode's WRITE command.
   When you do not want to save a copy  of  the  MAIN  buffer,  end  your
   session with the QUIT command.

   In addition to establishing the MAIN  buffer  at  the  start  of  your
   session,  EDT  also sets up another buffer called PASTE.  EDT uses the
   PASTE buffer for screen mode CUT and PASTE functions.  Both  the  MAIN
   and PASTE buffers are always part of your EDT session.  You can delete
   the contents of these buffers during your  editing  session,  but  you
   cannot remove the buffers themselves.

   You  can  create  additional  buffers  to  store  pieces  of  text  or
   additional material that you might want to look at during your editing
   session.  Various line and nokeypad commands enable you to create  new
   buffers.   Some  line mode commands transfer EDT to the buffer that is
   named in the command line.  Whenever  you  see  the  buffer  specifier
   included  in  the  command  syntax  for  a  line mode or nokeypad mode
   command, you can use that command to create a new buffer.

   Buffer names can contain  any  alphanumeric  characters  (letters  and
   digits,  but  not  punctuation marks or control characters).  However,
   the name must begin with  a  letter.   You  can  use  one  punctuation
   character,  the  hyphen  (-),  in  buffer names.  If you like, you can

                                 EDT BASICS

   create a buffer name that has over 80 characters in it.  But since you
   will  have  to type the buffer name at least once, you will find short
   names easier to use.

   The SHOW BUFFER line mode command tells you the names of  all  buffers
   that  exist  for your editing session and indicates the current buffer
   with the equal sign (=).  Line mode's CLEAR  command  can  delete  any
   buffer  that  you no longer need except MAIN or PASTE.  In the case of
   MAIN or PASTE, the CLEAR command removes the contents of  the  buffer,
   but does not discard the location.  After you use the CLEAR command to
   delete any other buffer, that buffer name no longers  appears  in  the
   SHOW BUFFER list.

   You might become confused when specifying a buffer name in a line mode
   command  because  EDT usually transfers you to the new buffer.  If you
   find yourself in an empty buffer, you might wonder  what  happened  to
   the  text  you  were  just  editing.  The SHOW BUFFER command not only
   tells you the name of the buffer you are in, but shows you  the  names
   of all the other buffers in your current EDT session and tells you how
   many lines each contains.  You can use this information to  find  your
   way back to the buffer where you were working.

   EDT has some special storage areas whose names  never  appear  in  the
   SHOW  BUFFER  list  because  EDT maintains complete control over them.
   You cannot specify these buffers in commands or enter them in any way.
   However,  you can influence the characters that are stored in them and
   decide when or whether to insert their contents into your text.  These
   special  buffers  include the delete character buffer, the delete word
   buffer, the delete line buffer, the search buffer, and the  substitute
   buffer.   The  three delete buffers are used only by the screen mode's
   delete and undelete functions.

   2.2.9  Text Entities

   Text entities refer to specific elements of text that  EDT  recognizes
   as  units  when  you  are  working  in  a  screen mode.  These include
   characters, words,  lines,  sentences,  paragraphs,  as  well  as  the
   beginning  or  end  of  these elements.  Text entities are used in the
   screen modes to move the cursor and to limit the extent of  operations
   such  as  deleting  text.   (A  complete  discussion  of text entities
   appears at the beginning of Chapter 5.)

   In addition to helping you move the cursor, entities can  be  used  to
   determine  how  much  text  EDT  will  act  on.  You use entities with
   functions that delete text, create select ranges, change the  case  of
   letters,  or  reformat  text by means of the FILL function so that EDT
   knows which part of the text to work on.

   You should be familiar with these entities when you start editing in a
   screen mode:

                                 EDT BASICS

        ENTITY                       DESCRIPTION

        character      Any   single   character:    a   letter,    digit,
                       punctuation mark, or control character.

        word           A group of contiguous characters that are  bounded
                       by spaces, ends of lines, tabs, or ends of pages.

        line           A group of contiguous characters that begins  just
                       after  a  line  terminator  and ends with the next
                       line terminator.

        sentence       A group of contiguous characters that  is  bounded