home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / TOOLS / SHELL.DOC < prev    next >
Text File  |  1996-06-04  |  7KB  |  225 lines

  1. #    $Id: Shell.doc,v 1.2 1994/12/08 23:48:08 duchier Exp $    
  2.  
  3.  
  4.   NAME
  5.  
  6.     shell - an interactive user interface for LIFE offering command line
  7.             editing, a history mechanism, and user rebinding of keys.
  8.  
  9.  
  10.   USAGE
  11.  
  12.     First, make sure that the directory containing the shell and parser
  13.     is part of your load_path. If it is, do
  14.  
  15.         expand_load(true) ?
  16.     load ("shell") ?
  17.  
  18.     to load the shell. The query
  19.  
  20.         shell ?
  21.  
  22.     then runs the shell.
  23.  
  24.  
  25.   DESCRIPTION
  26.  
  27.     The shell provides an interface which looks very much like that of 
  28.     the Wild_LIFE interpreter, except for minor syntactic changes to the
  29.     prompt and output messages. Thus, you can execute queries, enter 
  30.     definitions, backtrack, return to previous levels or to the top level,
  31.     as you would with the interpreter. In addition, the shell offers the
  32.     following facilities:
  33.  
  34.     - command line editing using arrow keys and (by default) Emacs keystrokes
  35.     - a history mechanism, allowing to step up/down through previously
  36.       typed commands
  37.     - saving of the history between LIFE sessions. Upon start-up, the
  38.       shell restores the history from the previous session, and upon leaving, 
  39.       saves the current history.
  40.     - the user can rebind keys as he or she wishes.
  41.     - Unix commands can be entered directly from the shell by enclosing them in
  42.       string quotes, eg "ls" lists the current directory, "csh" runs a new Unix
  43.       C-shell.
  44.  
  45.     ****  Note that multiple line input is NOT yet handled.  ****
  46.           (See Limitations below)
  47.       
  48.  
  49.   EDITING COMMANDS AND KEYBINDINGS
  50.  
  51.     This section lists the names of the editing commands, their default
  52.     keybindings (usually those of Emacs), and a brief description of each
  53.     command.
  54.  
  55.     We use the Emacs standard notation for keys. For control characters, we
  56.     write, for example, "C-a" to mean "Control-a". There is no distinction
  57.     between "C-a" and "C-A"; they are the same character. For Meta characters,
  58.     we write, for example, "M-a" to mean "Meta-a". Note that "M-a" and "M-A"
  59.     are not the same character. All Meta characters can be entered with a two
  60.     character sequence starting with ESC. Thus, "M-a" is equivalent to "ESC a".
  61.     This is useful for terminals that do not have a special Meta key,
  62.     or that cannot send Meta (i.e., 8 bit) characters. (Note: Even if your
  63.     terminal has a Meta key, you may have to do something like "stty pass8"
  64.     to get it to pass 8 bit characters).
  65.  
  66.  
  67.       beginning_of_line                    C-a
  68.     Move to the beginning of the line
  69.  
  70.       end_of_line                    C-e
  71.     Move to the end of the line
  72.  
  73.       forward_char                    C-f, right arrow
  74.     Move forward one character
  75.  
  76.       backward_char                    C-b, left arrow
  77.     Move backward one character
  78.  
  79.       forward_word                    M-f, M-F
  80.     Move forward one word
  81.  
  82.       backward_word                    M-b, M-B
  83.     Move backward one word
  84.  
  85.       next_line                        C-n, down arrow
  86.     Get the next history line
  87.  
  88.       previous_line                    C-p, up arrow
  89.     Get the previous history line
  90.  
  91.       beginning_of_history                M-<
  92.     Get the first history line
  93.  
  94.       end_of_history                    M->
  95.     Get the last history line
  96.  
  97.       transpose_chars                    C-t
  98.     Transpose the two characters before and at the cursor
  99.  
  100.       delete_backward_char                DEL
  101.     Delete the character before the cursor
  102.  
  103.       delete_char                    C-d
  104.     Delete the character at the cursor
  105.  
  106.       kill_line                        C-k
  107.     Kill to the end of the line
  108.  
  109.       kill_entire_line                    C-w
  110.     Kill the entire line from the beginning
  111.  
  112.       kill_word                        M-d, M-D
  113.     Kill forward to the end of the next word
  114.  
  115.       backward_kill_word                M-DEL
  116.     Kill back to the beginning of the previous word
  117.  
  118.       rewrite_line                    C-l
  119.     Rewrite the line (useful after garbage collection messages)
  120.  
  121.       describe_key_briefly                C-h c <key>
  122.     Print the name of the routine that <key> is bound to
  123.     and rewrite the line.
  124.  
  125.       write_history
  126.     Write the history to the file ".life-history" in the
  127.     current directory.
  128.  
  129.       interrupt
  130.     Leave the shell and return to Wild_LIFE.
  131.  
  132.       quit
  133.     Leave the shell and Wild_LIFE, after writing the history.
  134.  
  135.  
  136.   CHANGING KEYBINDINGS
  137.  
  138.     To change a keybinding, use the routine "global_set_key".
  139.     For example, to change the keybinding for "C-d" from the
  140.     default action of deleting the character at the cursor to
  141.     that of leaving the shell and Wild_LIFE, do
  142.  
  143.     global_set_key ("\C-d", quit) ?
  144.  
  145.     To have this keybinding every time you run the shell, put
  146.     the query in the file ".life-keymap" in your current directory.
  147.     To have this keybinding during just the current invocation of the
  148.     shell, execute the query at the prompt.
  149.  
  150.     Key names are written as strings. The prefix "\C-" is used for control
  151.     characters. The following special characters are also recognized:
  152.     "\t"    TAB
  153.     "\b"    DEL
  154.     "\n"    RET
  155.     "\r"    RET
  156.  
  157.     However, currently, multiple keys cannot be rebound (for example, "\C-hc"),
  158.     nor can Meta characters ("\M-a"), nor escape-prefixed characters ("\ea"). 
  159.  
  160.  
  161.   GLOBAL PARAMETERS
  162.  
  163.     The user may change the number of lines saved in the history list,
  164.     and the name of the history file, by changing the values (using setq)
  165.     of "history_limit" and "history_file", respectively. For example,
  166.     these are the default settings of these constants:
  167.  
  168.     setq (history_limit, 100) ?
  169.     setq (history_file, ".life-history")?
  170.  
  171.     Changes to these constants must be done before the shell is run.
  172.  
  173.  
  174.   LIMITATIONS
  175.  
  176.     There are many things that remain to be implemented:
  177.  
  178.     - ****  Multiple line input is not yet handled.  ****
  179.  
  180.     - Verbose mode does not work under the shell.
  181.  
  182.     - Multiple keys cannot yet be rebound (for example, "\C-hc"), nor
  183.       can Meta characters ("\M-a"), nor escape-prefixed characters ("\ea").
  184.  
  185.     - The yank facility (C-y under Emacs) is not yet implemented.
  186.  
  187.     - Killing and copying of regions (C-w, M-w) is not yet implemented.
  188.  
  189.     - Command name completion (using the TAB key as in Emacs) is not
  190.       yet implemented.
  191.     
  192.     - The quoting mechanism for keys (as in Emacs) is not yet implemented.
  193.  
  194.     - The "pretty" printer is still rather primitive.
  195.  
  196.     - Tracing mode still has some idiosyncracies: it outputs spurious
  197.       lines on failure and on aborting, and it does not output anything
  198.       during X events.
  199.  
  200.  
  201.   FILES
  202.  
  203.     When the shell is started, it looks for the following two files,
  204.     if they exist, in the *current* directory.
  205.  
  206.     .life-history       Contains the history of commands saved from the
  207.                         previous LIFE session. Note that this file is read
  208.                         in specially; it is not loaded.
  209.  
  210.     .life-keymap        Contains queries to remap keys. 
  211.                         Since this file is loaded in the usual sense, it can,
  212.                         in fact, contain any LIFE code.
  213.  
  214.     
  215.     The code for the shell is in one single file: shell.lf
  216.  
  217.     The shell also uses the LIFE parser and tokenizer: see the documentation
  218.     for those files.
  219.  
  220.   
  221.   AUTHOR
  222.  
  223.     Kathleen Milsted
  224.  
  225.