UGH 1.0                    January 12, 1976                           1





                       "UGH" an Alto text editor



General Information: 
    
   About the Program
         This editor was designed and written by Bill Duvall.  The
      original version of the editor was written in ALGOL for 
      the NOVA. It was then transliterated into assembly language 
      (for obvious reasons) and then went through too many 
      iterations to enumerate here. Its more or less final form on 
      the NOVA was as "RCG" the POLOS system programmers editor.  
      This version is a bootstrapped version with all ALTO I/O done 
      in BCPL.  It is not intended as a research vehicle but rather 
      as tool a for all of us programmers who are so badly addicted to 
      this style of editor.  
       
      Its major features are: 
         NLS-like command language  
         Mouse/Keyset-oriented command specification 
         Built-in textual and structural entities
         Core based file editing (maximum file size = 32,764 chars.) 
         Basically edits strictly text files  
            (structure if desired is in an associated file)  
         Structure (via an ancillary file) 
         Clipped File views 
    
   Control Keys 
    
      BS - Backspace Character = ↑A,↑H   
      BW - Backspace Word = DEL   
      <CA> - Command Accept = ESC   
      <CD> - Command Delete = ↑X   
      <CDOT> - Center Dot = NUL (SWAT-KEY)   
          (normal SWAT key is right-shift-SWAT when in UGH) 
       
   Mouse Buttons 
    
      Bits from Left to Right (or Top to Bottom) 
         0 0 0    Not Defined 
         1 0 0    <BUG> 
         0 1 0    <CD> 
         0 1 1    <CA> 
         0 0 1    BSP (Backspace Character) 
         1 0 1    Not Defined 
         0 1 1    BSW (Backspace Word) 
         1 1 1    Not Defined 
       
   <CA>/<BUG> Convention 
       
      <BUG> may be used for <CA> whenever there is no ambiguity 
      (which is almost always). <CA> must be used when an 
      ambiguity exits, such as when using the Replace command to 
      accomplish a delete. 
       
Display Layout: 
    
   UGH uses the lines on the display screen as follows: 
    
      Line 0 - not used (not visible) 
UGH 1.0                    January 12, 1976                           2





      Line 1 - view specification feedback   
         [n1,n2] n3 n4,n5 
             n1 = lowest level statement to be displayed 
             n2 = highest level statement to be displayed 
             n3 = current indenting per level 
             n4 = maximum loadable file size 
             n5 = size of currently loaded file 
      Line 2 - feedback line, used for level selection etc.   
      Line 3 - command feedback line   
      Lines 4 thru 60 - file display window

    
Commands: 
    
   Append <ENTITY> <LITERAL> <CA> 
       
      Inserts the <LITERAL> into the file buffer following the right 
      most character of the selected entity. 
       
   Compile   
       ( ALTOASM 
       / BCPL 
       / MESA ) 
      <Prompted-LITERAL> <CA> 

      In general the Compile command is a special form of the Write
      command. The current file buffer is written to the disk using
      the selected file name.  The appropriate processor is then
      invoked via the REM.CM alto hack.  The command line written
      to REM.CM contains the processor name, the appropriate
      switch(es) to create an error file, and a return call to UGH.
      The current loaded file is also included in the command line,
      but UGH does not reload the file at this time.
 
         ALTOASM
            This command invokes the ALTOASM(/E) assembler.
         BCPL
            This command will invoke the BCPL(/F) compiler.
         MESA
            NOT YET!!

   Delete <ENTITY> <CA> <CA> 
       
      Deletes the selected entity from the file buffer. 
       
   Freeze  Line 
             / Release 
       
      Lines are frozen by "Freeze Line". 
      Lines are thawed by "Freeze Release". 
       
      Frozen lines are displayed at the top of the file display region 
      whenever the frozen line view specification is "on". 
       
   Insert <ENTITY> <LITERAL> <CA> 
       
      Inserts the <LITERAL> into the file buffer before the left most 
      character of the selected entity. 
       
      (????)A copy to the left of an entity may be executed by 
      selecting the <LITERAL> from the keyboard. 
UGH 1.0                    January 12, 1976                           3





       
   Jump To   
       ( Ahead 
       / Back 
       / <BUG> 
       / Content <Prompted-LITERAL> 
       / End 
       / Line 
       / Paragraph 
       / Return 
       / Successor 
       / Top 
       / Up) 
      <VIEWSPECS> <CA> 
       
      Jump is the command provided for moving the file buffer 
      window. 
         When specifying viewspecs in a jump command, you may 
         ether use case 3 on the Mouse/Keyset or you may simply type 
         the viewspec characters on the keyboard/keyset since there is 
         no ambiguity at this time.

      Jump Back 
         Move the file display window back (toward the beginning) 5 
         lines. 
      Jump to Content 
         Jump to content searches for the next occurrence of the 
         literal (and continues to do so as long as <CA> is typed). 
      Jump to Line 
         Puts the selected line at the top of the file display window.
      Jump to Paragraph 
         Puts the selected paragraph at the top of the file display 
         window.
      Jump to Successor 
         Searches the structure for the next paragraph at the same 
         (or lower) level of the selected paragraph and then places 
         that paragraph at the top of the file display window. 
      Jump to Top 
         Puts the first line/paragraph of the file at the top of the 
         file display window.
      Jump to End 
         Puts the last line/paragraph of the file at the top of the 
         file display window.
      Jump to Up 
         Searches the structure (backwards toward the beginning) for a 
         previous paragraph at a lower level (relative to the selected 
         paragraph) and then places that paragraph at the top of the 
         file display window. 
       
      Whenever any of the above jumps are taken, an entry is made 
      in a jump ring, saving the state of the current view.  The 
      following two commands are provided for getting back to a 
      previous view of the file. 
       
      Jump Return 
         Back up one view in the Jump Ring. 
      Jump Ahead 
         Go forward one view in the Jump Ring. 
       
   Load   
       ( Append 
UGH 1.0                    January 12, 1976                           4





       / File 
       / Merge 
       / Translate 
       / X(Text) 
      <Prompted-LITERAL> <CA> 
             
      If the literal is selected from the file display window, the 
      entity type assumed is <VISIBLE>. 
       
      Append 
         Appends a text file to the currently loaded file. 
      File 
         Loads both the text file and its associated structure (if it 
         exists). 
          
            If a text file is loaded which does not have a 
            corresponding structure file the message  
               "STRUCTURE FILE OPEN ERROR" 
            is displayed.  This is normally considered an error, but 
            you may simply type <CA> which will cause the structure
            element of the file to be set null, and you can then edit
            the file as normal.  
      Merge 
         Appends a text file to the currently loaded file and creates 
         the structure for it according to the rules of Load Translate.
      Translate 
         Loads a text file and creates a structure for it using the 
         following rules. 
          
            1) Nodes in the structure are determined by Carriage 
               Returns followed by spaces or tabs. 
            2) One tab equals one level. 
            3) "n" spaces equal one level.  
               n is the current indenting parameter. 
            4) Nodes are optimized.  
               That is, consecutive lines with the same indenting
               are placed in the same structural node. 
      X(Text) 
         Load the text file and set the structure to NULL.
       
   Move <ENTITY> <Bug-destination> <CA>  
                                      / SP (reselect destination) 
       
      Move the selected entity to after the right-most character of 
      the bugged destination entity. 
       
   Phrase <ENTITY> Level-Adjust <CA>  
       
      Makes a Node of the selected entity at the specified level. 
      The level adjust is releative to the current level of the first 
      character in the selected entity. 
       
      Phrase may cross current structure boundaries.
         CAUTION! This implies that previous structure will be thrown 
         away, in particular, PHRASE is NOT the proper command for 
         changing the level of a section or group. Use Move for this 
         purpose 
          
   Quit <CA> <CA>  
       
      Return to Alto Command level 
UGH 1.0                    January 12, 1976                           5





       
   Replace <ENTITY> <LITERAL> <CA>  
       
      Replaces the selected entity with the literal. If entity 
      selection is followed by a <CA> (i.e. empty literal),
      the command functions as a Delete. 
       
   Substitute <LITERAL> for <LITERAL> <CA>  
      DOIT? (ALL / <CA> / N / SP) 
       
      Substitutes the first literal for the second literal if the 
      response to the query is <CA>. 
       
         If the response is N or SP, the substitution is not done. 
          
            In either case, the file buffer is searched for the next 
            occurence of the string, and, if one is found, the cycle is
            repeated. 
         If the response to the query "DOIT?" is "ALL", all remaining 
         occurrences of the string are replaced. 
         The search for substitutes always begins at the top of the 
         current file display window (excluding frozen lines). 
          
      Note: Either literal may have structure associated with it; in 
      which case the structure is substitited along with the literal. 
         Structure is not, however, matched in the search; 
         substitution candidates are selected on the basis of string 
         equality only.
       
   Viewspecs <Viewspec-string> <CA> 
       
       The following characters are used to alter the user view of 
      the file. They may be specified via the Viewspecs command or 
      at jump time (case is ignored on inputting viewspec 
      characters).  Level clipping is done at the paragraph level. 
       
         a: Decrease the lowest displayable level by one 
            (i.e. display one less level). 
         b: Increase the lowest displayable level by one 
            (i.e. display one more level). 
         c: Set the lowest displayable level to 64 (Max). 
         d: Set the lowest displayable level to the highest level. 
         e: Set the lowest displayable level to the level of the 
            paragraph at the top of the file display window (or the
            selected paragraph if in a jump command). 
         f: Invert the state of the frozen line display flag 
            (i.e. if frozen lines are displayed, DON'T and vice 
            versa). 
         g: Invert the state of the mouse coordinate display flag
            (i.e. if mouse coordinates are displayed, DON'T, etc.). 
         i: Increase the highest displayable level by one. 
         j: Decrease the highest displayable level by one. 
         k: Set the highest displayable level to 0 (Min). 
         l: Set the highest displayable level to the lowest level. 
         m: Set the highest displayable level to the level of the
            paragraph at the top of the file display window (or the
            selected paragraph if in a jump command). 
         p: Invert the state of the viewspec feedback display flag. 
         s: Set spacing (the number of lines separating paragraphs). 
            Effects both the display view and the Write Translate 
            command. 
UGH 1.0                    January 12, 1976                           6





         t: Set indenting (the number of 16-bit units used to
            indicate levels). 
            Effects both the display view and the Write Translate 
            command. 
         v: Invert the state of the invisibles display flag. 
         x: Recreate the display. 
         y: Invert the state of the video background. 
          
   Write   
       ( File 
       / Translate 
       / X(Text) 
      <Prompted-LITERAL> <CA>  
             
      If the literal is selected from the file display window, the 
      entity type assumed is <VISIBLE>.  UGH prompts the user with 
      a default file name (the name of the loaded file). A <CA> will 
      use the default , typing a space will allow you to bug the 
      name, and of course you may simply type the desired file name 
      (no leading spaces!). 
       
      File 
         Writes both the text file and its associated structure  
      Translate 
         Writes a text file and formats it for printing. Appends
         the extension ".txt" to the default file name (deletes the
         current extension if present). 
          
            The file is formated to be as close to its current 
            representation on the screen as possible. 
            The following funnies exist: 
               1) Level indenting on the display is done with the
                  ALTO Display tab feature, and as such is in
                  multiples of 16 bits. For translation purposes,
                  each level is represented by three spaces.  
               2) UGH uses whatever font the ALTO OS was using 
                  when UGH was executed. 
               3) All the fixed/propotional font uglies exist. 
                
      X(Text) 
         Writes the text file 
    
    

Entities: 
    
   CHARACTER <BUG> 
       
      A single character. 
       
   TEXT (Bug-left [Bug-right]) 
       
      An arbitrary string of text (may cross structure boundaries). 
       
   WORD <BUG> 
       
      A string of letters and/or digits. Selecting a character 
      between two words will cause both to be selected. The 
      character selected is also included (may not cross structure 
      boundaries). 
       
UGH 1.0                    January 12, 1976                           7





   VISIBLE <BUG> 
       
      A string of Printing characters (i.e delimited by a space, CR, 
      tab, etc.) Selecting non-Printing characters between two 
      visibles will cause both to be selected. The character selected 
      is also included (may not cross structure boundaries). 
       
   LINE <BUG> 
       
      A string of characters delimited by CR's (may not cross 
      structure boundaries). 
       
   INTERVAL (Bug-first [Bug-second]) 
       
      An interval of lines...inclusive of first and last. (MAY cross 
      structure boundaries.) 
       
   PARAGRAPH <BUG> 
       
      A paragraph is the smallest structural entity. 
      Paragraphs are created via the Phrase and Load Translate 
      commands, or they are designated during literal entry (by 
      use of CDOT). 
       
   SECTION <BUG> 
       
      A Section is the paragraph selected plus all paragraphs 
      between it and the next paragraph whose level (indenting) is 
      less than or equal to that of the selected paragraph. 
       
   GROUP (Bug-first [Bug-second]) 
       
      All paragraphs between the two selected (inclusive). 
       
   LITERAL  
       
      A literal is a string (with associated structure when 
      applicable) which may be either entered from the keyboard, or 
      selected from the display. 
       
      If the literal is selected from the display, it is assumed to be 
      of the entity type specified by the command; for example if the 
      command is Append Paragraph the selected literal would be a 
      paragraph. 
       
      For commands which do not require an entity specification, 
      selected literals will always be TEXT. 
       
      Whenever a literal is selected from the display area, the user 
      will be asked for confirmation (CA>/BUG). 
         If a space is typed for confirmation, the literal may be 
         reselected without having to respecify the command. Old bug 
         indications are not erased however. 
         The Current maximum size of a literal is 2000 characters. 

   Prompted-LITERAL  
       
      In certain cases, such as filenames, UGH thinks it knows what
      literal you are going to supply.  When this happens UGH gives
      you the chance to simply confirm this knowledge is correct or 
      to supply a new string in a rather funny, but effective way. 
UGH 1.0                    January 12, 1976                           8





      Prompted-LITERAL is simply short hand for:

            ( <CA>
            / <LITERAL>
            / SP
               ( <BUG-Visible>
               / <LITERAL> )
            )
UGH 1.0                    January 12, 1976                           9





  
Command Summary:  
             
   Append <ENTITY> <LITERAL> <CA>  
   Compile   
       ( ALTOASM 
       / BCPL 
       / MESA ) 
      <Prompted-LITERAL> <CA> 
   Delete <ENTITY> <CA> <CA>  
   Freeze  Line  
   Insert <ENTITY> <LITERAL> <CA>  
   Jump To   
      ( Ahead 
      / Back 
      / <BUG> 
      / Content <Prompted-LITERAL> 
      / End 
      / Line 
      / Paragraph 
      / Return 
      / Successor 
      / Top 
      / Up) 
      <VIEWSPECS> <CA> 
   Load   
      ( Append 
      / File 
      / Merge 
      / Translate 
       X(Text) 
      <Prompted-LITERAL> <CA> 
   Move <ENTITY> <Bug-destination> <CA> / SP  
   Phrase <ENTITY> Level-Adjust <CA>  
   Quit <CA> <CA>  
   Replace <ENTITY> <LITERAL> <CA>  
   Substitute <LITERAL> for <LITERAL> <CA>  
   Viewspecs <Viewspec-string> <CA> 
   Write   
      ( File 
      / Translate 
      / X(Text) 
      <Prompted-LITERAL> <CA> 
    
Entity Summary:

   CHARACTER <BUG> 
   TEXT (Bug-left [Bug-right]) 
   WORD <BUG> 
   VISIBLE <BUG> 
   LINE <BUG> 
   INTERVAL (Bug-first [Bug-second]) 
   PARAGRAPH <BUG> 
   SECTION <BUG> 
   GROUP (Bug-first [Bug-second]) 
   LITERAL  
UGH 1.0                    January 12, 1976                          10





      
Viewspecs Summary: 
 
      a: Decrease the lowest displayable level y one 
         (i.e. display one less level). 
      b: Increase the lowest displayable level by one 
         (i.e. display one more level). 
      c: Set the lowest displayable level to 64 (Max). 
      d: Set the lowest displayable level to the highest level. 
      e: Set the lowest displayable level to the level of the 
         paragraph at the top of the file display window (or the
         selected paragraph if in a jump command). 
      f: Invert the state of the frozen line display flag. 
         (i.e. if frozen lines are displayed then DON'T and vice 
         versa). 
      g: Invert the state of the mouse coordinate display flag 
         (i.e. if mouse coordinates are displayed then DON'T, etc.). 
      i: Increase the highest displayable level by one. 
      j: Decrease the highest displayable level by one. 
      k: Set the highest displayable level to 0 (Min). 
      l: Set the highest displayable level to the lowest level. 
      m: Set the highest displayable level to the level of the 
         paragraph at the top of the file display window (or the
         selected paragraph if in a jump command). 
      p: Invert the state of the viewspec feedback display flag. 
      s: Set spacing (the number of lines separating paragraphs). 
         Effects both the display view and the Write Translate 
         command. 
      t: Set indenting (the number of 16-bit units used to indicate
         levels).  Effects both the display view and the
         Load/Write Translate commands. 
      v. Invert the invisibles display flag.
      x: Recreate the display. 
      y: Invert the state of the video background. 
          
      
UGH 1.0                    January 12, 1976                          11






Mouse and Keyset Codes 
   Mouse buttons: 
      Case:   -0-    -1-   -2-   -3-   -4-   -5-   -6-   -7- 
       
   Keyset Chord 
    
      00000    a      CD    BC   CA 
      00001    a      A     !    ................................ 
      00010    b      B     "             . 
      00011    c      C     #             . 
      00100    d      D     $             . 
      00101    e      E     %             . 
      00110    f      F     &             . 
      00111    g      G     '             . 
      01000    h      H     (             . 
      01001    i      I     )             . 
      01010    j      J     @             . 
      01011    k      K     +             . 
      01100    l      L     -             . 
      01101    m      M     *     not currently defined 
      01110    n      N     /             . 
      01111    o      O     ↑             . 
      10000    p      P     0             . 
      10001    q      Q     1             . 
      10010    r      R     2             . 
      10011    s      S     3             . 
      10100    t      T     4             . 
      10101    u      u     5             . 
      10110    v      V     6             . 
      10111    w      W     7             . 
      11000    x      X     8             . 
      11001    y      Y     9             . 
      11010    z      Z     =             . 
      11011    ,      <     [             . 
      11100    .      >     ]             . 
      11101    ;      :     ←             . 
      11110    ?      \     ALT           . 
      11111    SP     TAB   CR   .................................