glenda.party
term% ls -F
term% pwd
$home/manuals/unix_v8/9/jim
term% cat index.txt
JIM(9.1)                                                              JIM(9.1)



NAME
       jim, jim.recover - text editor

SYNOPSIS
       jim [ files ]
       jim.recover [ -f ] [ -t ] [ files ]

DESCRIPTION
       Jim  is  the text editor for the jerq terminal.  It relies on the mouse
       to select text and commands.   It  runs  only  under  mux(9.1).   Jim's
       screen  consists of a number of frames, a one-line command and diagnos‐
       tic frame at the bottom and zero or more larger file frames  above  it.
       Except  where  indicated,  these frames behave identically.  One of the
       frames is always the current frame, to which typing  and  editing  com‐
       mands  refer, and one of the file frames is the working frame, to which
       file commands such as pattern searching and IO refer.

       A frame has at any time a selected region of text, indicated by reverse
       video  highlighting.   The selected region may be a null string between
       two characters, indicated by a narrow vertical bar between the  charac‐
       ters.   The  editor  has  a  single save buffer containing an arbitrary
       string.  The editing commands invoke transformers between the  selected
       region and the save buffer.

       The  mouse  buttons  are used for the most common operations.  Button 1
       (left) is used for selection.  Clicking button 1 in a  frame  which  is
       not the current frame makes the indicated frame current.  Clicking but‐
       ton 1 in the current frame selects the null string closest to the mouse
       cursor.   Making  the same null selection twice (`double clicking') se‐
       lects (in decreasing precedence) the bracketed or quoted  string,  word
       or  line  enclosing the selection.  By pushing and holding button 1, an
       arbitrary contiguous visible string may be selected.  Button 2 provides
       a small menu of text manipulation functions, described below.  Button 3
       provides control for inter-frame operations.

       The button 2 menu entries are:

       cut    Copy the selected text to the save buffer and delete it from the
              frame.   If  the selected text is null, the save buffer is unaf‐
              fected.

       paste  Replace the selected text by the contents of the save buffer.

       snarf  Copy the selected text to the save buffer.  If the selected text
              is null, the save buffer is unaffected.

       look   Search  forward for the next occurrence of the selected text or,
              if the selection is null, to the next occurrence of the text  in
              the save buffer.

       <mux>  Exchange save buffers with mux.

       Also  stored  on  the  button 2 menu are the last Unix command and last
       search string typed (see below); these may be selected  to  repeat  the
       action.

       Typing replaces the selected text with the typed text.  If the selected
       text is not null, the first character typed  forces  an  implicit  cut.
       Control  characters  are discarded, but BS (control H), ETB (control W)
       and ESC have special meanings.  BS is the  usual  backspace  character,
       which  erases  the  character before the selected text (which is a null
       string when it takes effect).  ETB erases back  to  the  word  boundary
       preceding the selected text.  There is no line kill character.  ESC se‐
       lects the text typed since the last button hit or ESC.  If  an  ESC  is
       typed  immediately after a button hit or ESC, it is identical to a cut.
       ESC and paste provide the functionality for a simple undo feature.

       The button 3 menu entries are:

       new    Create a new frame, much as in mux.

       reshape
              Change the shape of the indicated frame, as in mux.   The  frame
              is indicated by a button 3 hit after the selection.

       close  Close the indicated frame and its associated file.

       write  Write the indicated frame's contents to its associated file.

       The rest of the menu is a list of file names available for editing.  To
       work in a different file, select the file from the menu.  If  the  file
       is  not open on the screen, the cursor will switch to an outline box to
       prompt for a rectangle to be swept out with button 3, as in the New op‐
       erator  of  mux.  (Unlike mux, there is a shorthand: sweeping the empty
       rectangle creates the largest possible rectangle.)   The  file  is  not
       read  until its frame is first opened.  If the file is already open, it
       will simply be made the workframe and current frame (for typing).   The
       format of the lines in the menu is

       -      possibly  an apostrophe, indicating that the file has been modi‐
              fied since last written,

       -      possibly a period or asterisk, indicating the file is open  (as‐
              terisk) or the workframe (period),

       -      a blank,

       -      and the file name.  The file name may be abbreviated by compact‐
              ing path components to keep the menu manageable,  but  the  last
              component will always be complete.

       The  work  frame  has a scroll bar — a black vertical bar down the left
       edge.  A small tick in the bar indicates the relative position  of  the
       frame  within the file.  Pointing to the scroll bar and clicking a but‐
       ton controls scrolling operations in the file:

       button 1  Move the line at the top of the screen to the y  position  of
                 the mouse.

       button 2  Move  to the absolute position in the file indicated by the y
                 position of the mouse.

       button 3  Move the line at the y position of the mouse to  the  top  of
                 the screen.

       The  bottom  line  frame  is  used for a few typed commands, modeled on
       ed(1), which operate on the work frame.   When  a  carriage  return  is
       typed  in  the  bottom line, the line is interpreted as a command.  The
       bottom line scrolls, but only when the first character of the next line
       is  typed.   Thus,  typically, after some message appears in the bottom
       line, a command need only be typed; the previous contents of  the  line
       will be automatically cleared.  The commands available are:

       e file Edit the named file, or use the current file name if none speci‐
              fied.  Note that each file frame has an associated file name.

       f file Set the name of the file associated with the work frame, if  one
              is specified, and display the result.

       g files
              Enter  the  named files into the filename menu, without duplica‐
              tion, and set the work frame to one of the named files.  If  the
              new  work frame's file is not open, the user is prompted to cre‐
              ate its frame.  The arguments to are passed through echo(1)  for
              shell metacharacter interpretation.

       w file Write the named file, or use the current file name if none spec‐
              ified.  The special command w' writes all  modified  files  with
              file names.

       q      Quit the editor.

       =      Print the line number of the beginning of the selected text.

       /      Search  forward  for  the string matching the regular expression
              after the slash.  If found, the matching text is selected.   The
              regular  expressions  are exactly as in egrep(1), with two addi‐
              tions: the character `@' matches any character,  including  new‐
              line, and the sequence `\n' specifies a newline, even in charac‐
              ter classes.  The negation of a character class does not match a
              newline.   An  empty  regular expression (slash-newline) repeats
              the last regular expression.

       ?      Search backwards for the expression after the query.

       94     Select the text of line 94, as in ed.

       cd     Set the working directory, as in the shell.  There is no  CDPATH
              search.

       >Unix-command
              Send the selected text to the standard input of Unix-command.

       <Unix-command
              Replace  the  selected  text by the standard output of Unix-com‐
              mand.

       |Unix-command
              Replace the selected text by the standard  output  of  Unix-com‐
              mand, given the original selected text as standard input.

       If  any  of  <, > or | is preceded by an asterisk *, the command is ap‐
       plied to the entire file, instead of just the selected  text.   If  the
       command for < or | exits with non-zero status, the original text is not
       deleted; otherwise, the new text is selected.   Finally,  the  standard
       error  output  of the command, which is merged with the standard output
       for >, is saved in the file $HOME/jim.err.  If the  file  is  non-empty
       when the command completes, the first line is displayed in the diagnos‐
       tic frame.  Therefore the command `>pwd' will report jim's current  di‐
       rectory.

       Attempts  to quit with modified files, or edit a new file in a modified
       frame, are rejected.  A second `q' or `e' command  will  succeed.   The
       `Q'  or  `E'  commands ignore modifications and work immediately.  Some
       consistency checks are performed for the `w' command.  Jim will  reject
       write requests which it considers dangerous (such as writes which would
       change a file modified since read it into its memory).   A  second  `w'
       will always write the file.

       If  jim  receives  a hangup signal, it writes a file $HOME/jim.recover,
       which is a shell command file that, when executed,  will  retrieve  the
       files that were modified when jim exited.  The -t option prints a table
       of contents, but does not unpack the files.  By default, jim.recover is
       interactive; the -f option suppresses the interaction.  If no files are
       named to jim.recover, it will recover all the saved files.

FILES
       /usr/jerq/mbin/jim.m      terminal support program
       $HOME/jim.err             saved diagnostic output from Unix commands

BUGS
       The regular expression matcher is non-deterministic (unlike egrep), and
       may be slow for spectacular expressions.
       When reshaped, the open frames must be re-opened manually.
       The < and | operators should snarf the original text.



                                                                      JIM(9.1)