home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / mutt / memutt.doc < prev    next >
Lisp/Scheme  |  1988-10-11  |  30KB  |  635 lines

  1. ========================================================================
  2. ==        The ME Mutt Connection          Craig Durland  8/88 ==
  3. ========================================================================
  4.   This document describes the link between the Mutt programming langauge
  5. (see MUTT.DOC) and the Mutt Editor (see ME.DOC).
  6.  
  7. ========================================================================
  8. ==        The ME Mutt functions                      ==
  9. ========================================================================
  10. (append-to-register n [text])    [NUMBER [STRING] : VOID]
  11.   Append text or region to register n.
  12.   Register 0 is the kill buffer.  Registers 1,2,3,4 are general purpose.
  13.   For example:
  14.     If the region contains "This is a test" then
  15.       (clear-register 0)
  16.       (append-to-register 0) (append-to-register 0 " foo bar")
  17.     will set the kill buffer to "This is is a test foo bar".
  18.   Note: appending to a register that contains a rectangle does nothing.
  19.   See also:  clear-register, copy-rectangle, insert-register, the kill
  20.     buffer commmands in ME.DOC.
  21. (arg-flag)        [zip : BOOLEAN]
  22.   Check to see if somebody set the arg-prefix before calling this
  23.     routine (via (universal-argument) or (arg-prefix n)).
  24.   See also: arg-prefix.
  25. (arg-prefix [arg])    [[NUMBER] : NUMBER]
  26.   Get or set the universal-argument.
  27.   With an arg, its the same as ^U before a function.
  28.     Notes:
  29.       The arg-flag is set to TRUE.
  30.       This really sets two prefixes:  one for ME commands and one for
  31.     Mutt pgms.  ME commands and exe-key use and reset the prefix to
  32.     1.  Pgms can only read the prefix and so it will stay the same
  33.     for all children of a pgm unless it is changed by (arg-prefix
  34.     n).  If it is changed, all the children AND parents will see the
  35.     new value.  It is a good idea to make a copy of the value upon
  36.     entry to a pgm if it is possible that a child will do a
  37.     (arg-prefix n).
  38.       If prefix is not set, it is always 1 (and the arg-flag is FALSE)
  39.     when a pgm or ME command is run from the keyboard.
  40.   Note that there is a difference between (arg-prefix 1) and the default.
  41.     eg (arg-prefix 1)(delete-char) puts the deleted character into the kill
  42.     buffer but (delete-char) does not.
  43.   For example, to make META-n start the (universal-argument) count at n,
  44.     use the following (where n is 1,2,3,4,5,6,7,8 or 9):
  45.     (defun
  46.       META-arg { (arg-prefix (- (key-pressed) 0x230))(universal-argument) }
  47.       MAIN
  48.       {
  49.     (int j)
  50.     (for (j 1)(< j 10)(+= j 1)
  51.       (bind-to-key (concat "META-arg")(concat "M-" j)))
  52.       }
  53.     )
  54.   See also: (arg-flag), (universal-argument) in ME.DOC.
  55. (argc)        [zip : NUMBER]
  56.   The number of parameters on the command line when ME was invoked +1.
  57.   eg "ME foo bar" has argc == 3.
  58.   Use argv to look at the parameters.
  59. (argv)        [NUMBER : STRING]
  60.   The ME command line parameters.  There are argc of them, numbering
  61.     0...argc-1.  (argv 0) is the name of the program (ME) (unless you are
  62.     running on MS-DOS 2.x where it is ""), (argv 1) is the first file name
  63.     (which is loaded by ME), (argv 2) is the next file name, etc.
  64.   For example:
  65.     ; sequentially load the files specified on the command line
  66.     (int nth-file) ; file to load next (a global var initialized to 0)
  67.     (defun next-file
  68.     {
  69.       (if (== 0 nth-file)(nth-file 2))    ; already loaded first file
  70.       (if (< nth-file (argc))
  71.     { (visit-file (argv nth-file))(+= nth-file 1) }
  72.     (msg "All files read in.")
  73.       )
  74.     })
  75. (attached-buffer n | name)    [NUMBER|STRING : NUMBER]
  76.   If given a number, attached-buffer returns the buffer that is attached
  77.     to window n.  n==-1 means use the current window.
  78.   If given a name, attached-buffer returns the buffer that is named
  79.     name.  Returns -1 if there if the buffer does not exist.
  80.   For example:
  81.     if the third window is displaying buffer "foobar" and foobar is
  82.       the second buffer then:
  83.       (attached-buffer -1) and (attached-buffer 2) both return 1.
  84.       (attached-buffer "foobar") returns 1.
  85.       (attached-buffer "FOOBAR") returns -1.
  86.   See also: buffers, windows.
  87.  
  88. (buffer-created-hook)    [zip : zip]
  89.   This is called when a buffer is created and allows a pgm to set up
  90.     a buffer.
  91.   Note: You defun this pgm.
  92.   WARNING: This can give ME a headache.  Don't do anything fancy (like
  93.     switching buffers, inserting, etc).  Not even I know for sure what
  94.     is safe here.
  95.   BUGS: Does not get called on first file on command line.
  96.     eg me foo.bar - buffer-created-hook not called on foo.bar but
  97.     is called there after (assuming it is defuned in init.mut).
  98.     The elsleazo workaround is to put (buffer-created-hook) at the end
  99.       of init.mut (ie after the hook has been defuned).
  100.   See also:  buffer-var,  init.mut (an example of how to use 
  101.     buffer-created-hook to set modes based on file name extension).
  102. (buffer-flags n [x])        [NUMBER [NUMBER] : NUMBER]
  103.   Get or set the buffer flags.  There are 8 flags represented by the
  104.     lower 8 bits of x.
  105.     Bit   Flag
  106.     0x01  Modified.  1 if the buffer has been modified since last save.
  107.     0x02  NoCare.  Don't care about buffer contents.
  108.     0x04  Hidden.  Buffer is hidden from user.
  109.     The other bits are not used (currently) and may be used by pgms.
  110.   Notes:
  111.     The Modified flag reports the same info that buffer-modified does.
  112.       If you want to mark a buffer as not modified it is better to use
  113.       not-modified or buffer-modified because buffer-flags will not
  114.       update the modeline if the buffer is being displayed.
  115.     The NoCare flag is used whenever ME wants exit or change a buffer -
  116.       it is set, ME will not ask before changes are made.
  117.     A buffer with the Hidden flag set is invisible to the user -
  118.       (next-buffer) skips it, the help and command completion routines
  119.       ignore it.
  120.   ME only changes the Modified flag.
  121.   See also: buffer-modified, buffers.
  122. (buffer-modified n [bool])    [NUMBER [BOOLEAN] : BOOLEAN]
  123.   Check to see if buffer n is modified.
  124.   If n==-1 the current buffer is used.
  125.   (buffer-modified -1) : TRUE if the current buffer is modified.
  126.   (buffer-modified 0) : TRUE if the first buffer is modified.
  127.   (buffer-modified -1 FALSE) : mark the current buffer as not modified.
  128.   (buffer-modified n FALSE) : mark the nth buffer as not modified.
  129.   See also: buffer-flags, buffers, current-buffer, (not-modified).
  130. (buffer-name n)            [NUMBER : STRING]
  131.   Return the name of the nth buffer.
  132.   (buffer-name -1) returns the name of the current buffer.
  133.   (buffer-name 0) returns the name of the first buffer.
  134.   See also: buffers, current-buffer, file-name.
  135. (buffer-stats n array INT 6)    [NUMBER BLOB : VOID]
  136.   Get some stats on the nth buffer.  n==-1 means current buffer.
  137.   These  stats  are:  buffer-size  (in   characters),   dot  (number  of
  138.     characters  from the start of the  buffer),  lines  (number  of text
  139.     lines in the buffer),  buffer-row (the line in the buffer the dot is
  140.     on), wasted (the number of  characters  allocated  but not used) and
  141.     character-at-dot  (ASCII  value  - eg if  the  dot is on a "A"  then
  142.     character-at-dot==65).
  143.   Note that buffer-size may NOT be the same as the file size.
  144.   An example of a typical  buffer stats routine (ie whats bound to
  145.     "^X=") is:
  146.     (defun show-buffer-stats    ; bind this to "^X="
  147.     {
  148.       (INT buffer-size dot lines buffer-row wasted char-at-dot ratio)
  149.     
  150.       (buffer-stats -1 (pointer buffer-size))
  151.       (ratio 0)(if (!= 0 buffer-size)(ratio (/ (* 100 dot) buffer-size)))
  152.       (msg "Row=" buffer-row " (of " lines ")"
  153.       " Col=" (current-column) " Y=" (window-row)
  154.       " CH=0x" (tobase char-at-dot 16) " .=" dot
  155.       " (" ratio "% of " buffer-size "))
  156.     })
  157. (buffer-var n [value])        [NUMBER [NUMBER] : NUMBER]
  158.   Each buffer has 10 numeric variables (numbered 0,1,...9) associated
  159.     with it.  These vars are not used by ME - they are there for pgm use.
  160.     They live and die with the buffer and are not initialized.
  161.   eg (buffer-var 0 123) sets var 0 to 123.  (msg (buffer-var 0)) displays
  162.     123 in the minibuffer.  (x (buffer-var 0)) assigns 123 to x.
  163.     (buffer-var 1 (+ (buffer-var 0) 1)) set bvar 1 to 124.
  164.   See also: buffer-created-hook, markring.mut (an example).
  165. (buffers)            [zip : NUMBER]
  166.   Return the number of buffers.
  167.   If (buffers) returns n, the buffers are numbered 0 ... n-1.
  168.   See also: buffer-modified, buffer-name, current-buffer, file-name.
  169.  
  170. (clear-buffer n [yes/no])        [NUMBER [STRING] : BOOLEAN]
  171.   Clear the nth buffer.  n==-1 means current buffer.
  172.   Remove all contents of the buffer and clear the marks.  If the buffer
  173.     is modified (and not marked NoCare), clear-buffer will ask if it
  174.     should be cleared.  If you want the buffer cleared no matter what,
  175.     use (clear-buffer n "yes").  If you want the user to decide:
  176.     (ask-user)(clear-buffer n).
  177.   See also: (kill-buffer) (in ME.DOC).
  178. (clear-register n)    [NUMBER : NUMBER]
  179.   Clears the nth register by setting it to "".
  180.   Register 0 is the kill buffer.  Registers 1,2,3,4 are general purpose.
  181.   See also: append-to-register, insert-register, the kill buffer commmands
  182.     in ME.DOC.
  183. (compare-dot-and-mark)    [zip : NUMBER]
  184.   Returns: 1 (dot on same line as mark), 2 (dot above mark),
  185.     3 (dot below mark).
  186.   See also: region-stats.
  187. (complete "prompt" selector)    [STRING NUMBER : STRING]
  188.   Works the same as ask but allows command completion.
  189.     Selector: bitwise OR the lists you want:
  190.     bit   value    list
  191.      0    1    ME keywords (listed in ME.DOC)
  192.      1    2    pgm names
  193.         2    4    Mutt keywords
  194.         3    8    buffer names
  195.      4    16    system vars
  196.   eg:  (defun pgm-completer {(insert-text (complete "command: " 23))})
  197.   See also: ask
  198. (copy-rectangle register)    [NUMBER : VOID]
  199.   Copy the region-rectangle to the register.  The buffer is not changed.
  200.     The register only contains the rectangle after the copy - anything
  201.     in the register before the copy is lost.
  202.   If there is no mark, the pgm aborts.
  203.   The region-rectangle is the rectangle that has the point at one corner
  204.     and the mark at the oppsite corner.
  205.   Register 0 is the kill buffer.  Registers 1,2,3,4 are general purpose.
  206.   For example:  To put the rectangle into the kill buffer and remove it
  207.     from the screen, use:  (defun cut-rect { (copy-rectangle 0)
  208.     (erase-rectangle 0) })
  209.   See also: erase-rectangle, register-stats, region-stats.
  210. (current-buffer)        [zip : NUMBER]
  211.   Return the number of the current buffer.
  212.   See also: buffer-modified, buffer-name, buffers, file-name.
  213. (current-column [column])        [[NUMBER] : NUMBER]
  214.   With no argument, returns the column after the dot.  Otherwise, the
  215.     dot is set to column.
  216.   (beginning-of-line) is 1.
  217.   When you set the current-column, the dot will get as close as possible
  218.     to the position you specify, subject to:
  219.     - the dot will not leave the current line.
  220.     - because  of tabs and such, the dot may not be in the  column  you
  221.        specify but will be BEFORE the  character  that would have caused
  222.        the dot to be beyond the specified position.
  223.   The new dot column is returned.
  224.   If you wish to force the dot to be in column n, use (current-column n)
  225.     (to-col n).
  226. (current-directory [name])    [[STRING] : STRING|BOOLEAN]
  227.   (current-directory) returns the current directory (eg "/users/craig").
  228.   (current-directory "tools") attempts to set the current directory to
  229.       tools.  Returns TRUE if successful, FALSE otherwise.
  230.   Note: This is available on UNIX only.  Wildcards and ~ OK.
  231.   See also: dir.mut for examples.
  232. (current-window)        [zip : NUMBER]
  233.   Return the number of the current window.  The windows are numbered 0,
  234.     1, ... (windows)-1 where window 0 is the top window on the screen.
  235.   See also: attached-buffer, windows,
  236.     (next-window), (previous-window) (in ME.DOC).
  237.  
  238. (delete-window n)        [NUMBER : BOOLEAN]
  239.   Remove the nth window from the screen.  n==-1 means the current window.
  240.   If there is only one window on screen, it is not deleted and FALSE is
  241.     returned otherwise TRUE is returned.
  242.   See also: (delete-other-windows) (in ME.DOC).
  243.  
  244. (EoB)        [zip : BOOLEAN]
  245.   True if the cursor is at the end of the buffer.  Note that end of
  246.     buffer is the empty line you get to with (end-of-buffer).
  247. (erase-rectangle delete)    [BOOLEAN : VOID]
  248.   Delete or clear the region-rectangle.  If delete is TRUE, the text in
  249.     the rectangle is removed, otherwise it is set to blanks (short lines
  250.     are not extended).
  251.   The dot is left at the upper left corner of the rectangle and the mark
  252.     is at the lower right corner.
  253.   The region-rectangle is the rectangle that has the point at one corner
  254.     and the mark at the oppsite corner.
  255.   See also: copy-rectangle, register-stats.
  256. (exe-key keycode)    [NUMBER : BOOLEAN]
  257.   Execute a key gotten by get-key.  This is the same as pressing that
  258.     key combo on the keyboard.
  259.   Returns TRUE if the key was executable.
  260.   Note: key-pressed is set to the key being executed.
  261.   See also: arg-prefix, get-key, key-pressed.
  262.  
  263. (file-name n)        [NUMBER : STRING]
  264.   Return the name of the file  attached to the nth buffer.  If a file is
  265.     NOT attached, returns "".
  266.   (file-name -1) returns the name of the file  attached to the  current
  267.     buffer.
  268.   See also: buffer-modified, buffer-name, buffers, current-buffer,
  269.     rename-buffer (in ME.DOC).
  270. (forward-line n)    [NUMBER : BOOLEAN]
  271.   Move the dot forward n lines (backwards if n < 0).
  272.   The dot is left at column one.
  273.   Returns TRUE if all OK, FALSE if try move off the edge of the buffer
  274.     (the dot is left at the closest edge).
  275.  
  276. (get-key)        [zip : NUMBER]
  277.   Wait for and grap the next ME key combo pressed.  These have a rather
  278.     strange format so it is a good idea to print out the ones you need
  279.     with (insert-text (get-key)).  If you look at the hex values you
  280.     might see a pattern.
  281.   key combo    get-key value
  282.     CR C-M      333 (0x014D)
  283.     f1 F-1     2097 (0x0831)
  284.     a           97 (0x0061)
  285.     A           65 (0x0041)
  286.     ^A C-A      321 (0x0141)
  287.     ^XA ^Xa C-XA 1089 (0x0441)
  288.     ^X^A C-XC-A     1345 (0x0541)
  289.     M-A          577 (0x0241)
  290.   See also: exe-key, getchar.
  291. (get-matched sub-string)    [STRING : STRING]
  292.   Return the RE substitution of the last (re-search-xxx) or
  293.     (looking-at).
  294.   See REGEXP.DOC for syntax of the sub string.
  295.   eg if (re-search-forward 'f\w*r') matched "foobar" then (get-matched "&")
  296.     returns "foobar".
  297.   See also: (looking-at), (RE-string), (re-search-forward),
  298.     (re-search-reverse).
  299. (getchar)        [zip : STRING]
  300.   Get a character from the keyboard with no echo.  This is different from
  301.     get-key in that the string is the ASCII value of the next key hit.  You
  302.     should only use this for real raw input.
  303.   See also: get-key.
  304. (getenv    environment-variable-name)    [STRING : STRING]
  305.   Get the value of a environment variable.
  306.   Returns "" if not found.
  307.   For example: (getenv "SHELL") might return "D:/MUSH.EXE".
  308.  
  309. (insert-register n)    [NUMBER : VOID]
  310.   Insert the contents of nth register at the point in the current buffer.
  311.   Register 0 is the kill buffer.  Registers 1,2,3,4 are general purpose.
  312.   (insert-register 0) is the same as (yank).
  313.   If the register contains a rectangle, the upper left corner of the
  314.     rectangle will be at the dot.
  315.   See also:  append-to-register, clear-register, register-stats, the
  316.     kill buffer commmands in ME.DOC.
  317. (insert-text stuff)    [STRINGs|NUMBERs|BOOLEANS|VOIDs : VOID]
  318.   Same as msg but the string is inserted into the current buffer.
  319.   eg (insert-text "foo = " foo)
  320.   See also: msg
  321. (isspace)        [zip : BOOLEAN]
  322.   TRUE if character under cursor is a space or tab.
  323.  
  324. (key-bound-to keystroke-string)    [STRING : STRING]
  325.   Tell what command a key is bound to.
  326.   For example, (key-bound-to "^A") returns "beginning-of-line".
  327.   If the key is not bound, key-bound-to returns "".
  328.   The typical  function to tell what a key is bound to is:
  329.     (defun describe-key    ; what is a key bound to
  330.     {
  331.       (string key 10 bind 80)
  332.       (key (ask "Key: "))
  333.       (if (== "" (bind (key-bound-to key)))(msg key " is not bound.")
  334.       (msg key " is bound to " bind))
  335.     })
  336.   For Mutt programmer types, a handy program is:
  337.     (defun deref-key    ; surround a command with braces
  338.     {
  339.       (string key 10 bind 80)
  340.       (key (ask "Key: "))
  341.       (if (!= "" (bind (key-bound-to key)))(insert-text "(" bind ")"))
  342.     })
  343.     This allows programming using keys rather than remembering command
  344.       names.
  345.   See also: complete.
  346. (key-pressed)        [zip : NUMBER]
  347.   Return the keycode of the key pressed to invoke the currently
  348.     executing pgm.
  349.   Note: exe-key sets this.
  350.   See also: exe-key, picture-self-insert in picture.mut for an example.
  351. (key-pressed-hook key)    [NUMBER : zip]
  352.   This is called when the user presses a key in the main loop (ie
  353.     key-pressed-hook is not called from the following:  get-key,
  354.     exe-key, anything that queries the user in the mini buffer).  The
  355.     key is passed to the hook.  See get-key for the format of a key.
  356.     After the hook has finished, the key is executed.
  357.   For example:
  358.     If the user presses "a" (key-pressed-hook 0x61) is called and then
  359.       "a" is inserted.
  360.     Pressing ^X^F causes (key-pressed-hook 0x546) to be called.  After
  361.       the hook returns, visit-file is called.  Any keys pressed while in
  362.       visit-file will NOT trigger the hook.
  363.   See also: saveall.mut and abbrev.mut for examples.
  364. (key-waiting)    [zip : BOOLEAN]
  365.   Returns TRUE if a user pressed key is sitting in the input buffer.
  366.   See also: getchar, get-key.
  367.  
  368. (looking-at RE-string)    [STRINGs|NUMBERs|BOOLEANS|VOIDs : BOOLEAN]
  369.   Test to see if the text following the dot matches a regular expression.
  370.     TRUE if it does.  The arguments are concatenated together to form the RE.
  371.   See REGEXP.DOC for syntax of the pattern string.
  372.   eg if the text following the dot is "foobar" then (looking-at 'f\w*r')
  373.     returns TRUE.
  374.   You can retrieve the matched info with get-matched.
  375.   Remember that if you use the "string" form, "\" & "^" MUST be quoted:
  376.     "\\", "\^" if you don't want strange results.  You can
  377.     avoid this problem by using ' instead of ".  (See MUTT.DOC).
  378.   See also: get-matched, RE-string.
  379. (modify-syntax-entry modify-string)    [STRING : STRING]
  380.   Modify the syntax table that is used by things that deal with words, etc.
  381.     eg (forward-word) or (re-search-forward).
  382.   String has the form: <type><characters to modify> where type is "w" if
  383.     characters are parts of words, "W" if characters are not parts of words.
  384.   eg (modify-syntax-entry "W0123456789") sez numbers are not parts of words
  385.     (modify-syntax-entry "w-") sez "-" is part of a word.
  386.   Default parts of words are: A-Za-z0123456789$'_
  387. (move-cursor row column)    [NUMBER NUMBER : VOID]
  388.   Move the hardware cursor to (row,column).
  389.   Row and column are both start at zero.
  390.   Move-cursor does not change the point.
  391.  
  392. (prefix-key n [new-prefix])    [NUMBER [STRING] : STRING]
  393.   Get or set the nth prefix key.  Returns the prefix keycode in ASCII
  394.     form.
  395.   n  notes
  396.   0  The META prefix.  Default is C-[ (ESCAPE).
  397.   1  Default is C-X.
  398.   2  open
  399.   3  open
  400.   META is a prefix so it can be overloaded (mimiced by) another key.
  401.     A consequence of this is you cannot prefix a METAed key when a META
  402.     key is a prefix.  For example, C-XM-P is OK but M-XM-P is not.
  403.   If you have a real META key, you can turn off prefix key 0.
  404.   Prefix keys 2 and 3 are open - use them for anything you like.
  405.   To turn off a prefix key, set it to "S-" or some other impossible
  406.     keycode (like "S-0").
  407. (puts "string")        [STRINGs|NUMBERs : STRING]
  408.   Send a string to the terminal.  ME does not see this.
  409.   Useful for defining function keys or creating popup windows.
  410.   See also: insert-text, msg, popup.mut
  411.  
  412. (RE-string RE-pattern string)    [STRING STRING : BOOLEAN]
  413.   Test to see if a string matches a regular expression.
  414.     TRUE if it does.
  415.   You can retrieve the matched info with get-matched.
  416.   See REGEXP.DOC for syntax of the pattern string.
  417.   See also: get-matched, looking-at.
  418. (region-stats pointer-to-data)    [BLOB : VOID] 
  419.   Get stats on the region.  pointer-to-data is a pointer the data area
  420.     that the stats are put into:
  421.   (byte type) (int ulcol width height) (INT size)
  422.     type:  1 (dot on same line as mark), 2 (dot above mark), 3 (dot
  423.       below mark).  This is the same info as (compare-dot-and-mark).
  424.     ulcol: upper left column of the region-rectangle.
  425.     width, height:  of the region-rectangle.
  426.     size: Number of bytes in the region.
  427.   For example:
  428.     get-region-stats
  429.     {
  430.       (byte type)(int ulcol width height)(INT size)
  431.  
  432.       (region-stats (loc type))
  433.       (msg
  434.     (switch type
  435.       1 "Dot and mark on same line."
  436.       2 "Dot above mark."
  437.       3 "Dot below mark."
  438.     )
  439.     " Upper left column:" ulcol
  440.     " Width:" width " Height:" height " Size:" size
  441.       )
  442.     })
  443.   See also: compare-dot-and-mark.
  444. (register-stats register pointer-to-data)    [NUMBER BLOB : VOID] 
  445.   Get stats on register.  pointer-to-data is a pointer the the data area
  446.     that the stats are put into:
  447.   (byte type) (int width height) (INT size)
  448.     type: 0 means text and 1 is rectangle.
  449.     width, height:  If the register is a rectangle.
  450.     size: Number of bytes in the register.
  451.   For example:
  452.     (defun get-register-stats
  453.     {
  454.       (byte type)(int width height)(INT size)
  455.       (int n)
  456.  
  457.       (n (atoi (ask "register: ")))
  458.       (register-stats n (loc type))
  459.       (msg "Register[" n "]: " (if (== type 0) "Text." "Rectangle.")
  460.     " Width:" width " Height:" height " Size:" size
  461.       )
  462.     })
  463.  
  464. (sysvar sysvar-name [value])    [STRING [NUMBER] : NUMBER]
  465.   Access or set a sysvar.  This enables a pgm to give the user access to
  466.     sysvars.
  467.   Example:
  468.     (string sysvar-name 50)(sysvar-name "HELP")
  469.     (sysvar sysvar-name) gets the current value of HELP and 
  470.     (sysvar sysvar-name 0) sets it to zero.
  471.   See also: sysvar.mut for coding examples.
  472.  
  473. (to-col column)        [NUMBER : NUMBER]
  474.   Insert space until the dot is at column.  If the dot is at or past
  475.     column, nothing happens.
  476.   Returns column.
  477.   If the sysvar tab-stops is zero then tabs and blanks are used,
  478.     otherwise only blanks are used as space.
  479.  
  480. (update)        [zip : VOID]
  481.   Hard refresh the screen.  Does not affect the minibuffer.  Different from
  482.     (refresh-screen) in that the refresh occurs now, rather than waiting
  483.     for the program to end.
  484.   Note that keys in the typeahead buffer will keep the update from
  485.     completing.
  486.  
  487. (window-ledge n [left-edge])    [NUMBER [NUMBER] : NUMBER]
  488.   Set the left edge of window n.  Returns  the current or new value.  If
  489.     n==-1, the current window is used.  The window will display only the
  490.     text starting at column left-edge.
  491.   If  horizontal-scroll  is enabled and setting  window-ledge causes the
  492.     cursor to move off screen, the display  routines will reset the left
  493.     edge so that the cursor is on screen.  Turning off horizontal-scroll
  494.     will prevent this.
  495.   With this command you can scroll  windows  manually (ie without  using
  496.     the cursor) (see wscroll.mut).
  497.   The current screen column can be calculated by:
  498.     (- (current-column)(window-ledge -1))
  499.   See also: horizontal-scroll.
  500. (window-height n)        [NUMBER : NUMBER]
  501.   Return the height of the nth window (n==-1 means current window).
  502.   Note that the height does not include the mode line.  If there is only
  503.     one window then
  504.     (window-height -1) == (window-height 0) == (- (screen-length) 1).
  505. (window-row)            [zip : NUMBER]
  506.   Return the row the dot is on in the current window.  The top row of a
  507.     window is 1.  Note that this is not the screen row (unless the
  508.     current window is the top most one).
  509.   Note:  It is the display  routines that figure out the window-row.  If
  510.     called when the display is out of sync (such as a pgm doing  display
  511.     manipulation) this could very well be incorrect.  update can force a
  512.     display sync.
  513. (windows)        [zip : NUMBER]
  514.   Return the number of window on the screen.
  515.   See also: current-window.
  516.  
  517. (yesno prompt)    [STRINGs|NUMBERs|BOOLEANs|VOIDs : BOOLEAN]
  518.   Show the prompt (with " [y/n]? " appended) and wait for [Y, y, N, or n]
  519.     CR to be typed.  Returns TRUE on Y or y.  The pgm aborts on ^G.
  520.  
  521. ========================================================================
  522. ==        SYSTEM VARIABLES (sysvars)                  ==
  523. ========================================================================
  524. System vars are used like any other var - (sysvar) returns its value and
  525.   (sysvar value) sets it to value.
  526. Most sysvars are global - they effect all buffers, windows, etc.  Some
  527.   sysvars are buffer local - they only effect a single buffer.  When you
  528.   set a local sysvar, it is set for the current buffer.  If you want to set
  529.   these to something other than the default for every buffer, do so in
  530.   buffer-created-hook.
  531. Unless otherwise noted, all sysvars are global.
  532.  
  533. HELP    Set the help level        [[NUMBER] : NUMBER]
  534.   (HELP) returns the current setting.
  535.   (HELP n) sets the level to n and returns n.
  536.   Help level:
  537.     0 : no help
  538.     !0 : gimme help (if you make typo in (ME-command)
  539.     (describe-bindings) will be executed).
  540.   Initial value: 1
  541.  
  542. beeper            [[NUMBER] : NUMBER]
  543.   Now and then ME will beep at you.  This annoys some people.  You can tell
  544.     ME to shut up by setting beeper to 0.  Setting it to nonzero restores
  545.     the gift of gab.
  546.   Initial value: 1
  547.  
  548. case-fold-search    [[NUMBER] : NUMBER]
  549.   Affects searching (query-replace, search-forward, search-reverse).
  550.   If 1, case is ignored.
  551.   Initial value: 1
  552. horizontal-scroll [step-size]    [[NUMBER] : NUMBER]
  553.   This sysvar controls horizontal scrolling - moving text left and right
  554.     on the screen.  If 0,  horizontal  scrolling is disabled,  otherwise
  555.     the horizontal  scrolling rate is set to step-size.  When the screen
  556.     has to scroll, it will move in chunks in order to reduce the  amount
  557.     screen   thrashing.  Change  it  to  best  suit  your  hardware  and
  558.     preferences.
  559.   The range for step-size is [0 : screen-width).  If you set it outside
  560.     of this range, you are asking for many unpleasent surprises.
  561.   See also: window-ledge.
  562.  
  563. modeline-color    [[NUMBER] : NUMBER]
  564.   Change the the mode line color.
  565.   Note that the color values are display dependent.
  566.   See also: text-color, ERRATA.DOC.
  567.  
  568. overstrike [value]     [[NUMBER] : NUMBER]
  569.   Overstrike is the mode opposite of insert (the default mode).  Overstrike
  570.     mode is very much a bag on the side of ME and ment only for occasional
  571.     use.
  572.   The following are different in overstrike mode:
  573.     - The tab key is disabled but you can still set the tab stops.
  574.     - <CR> sends you the start of the next line.
  575.     - Backspace is the same as backward-character.
  576.     - The mode line.
  577.     - self-insert don't, they overstrike.
  578.   If you wish to have overstrike toggled by the insert key, put the
  579.     following into your init.mut:
  580.     (defun toggle-overstrike {(overstrike (- 1 (overstrike)))})
  581.     (bind-to-key "toggle-overstrike" "F-G")
  582.   Initial value: 0
  583.  
  584. screen-length    [new-screen-length]    [[NUMBER] : NUMBER]
  585.   Change the size of the physical screen.  This allows the same ME code
  586.     to run on different size screens.
  587.   For example, say ME came  configured  for a HP150 (which has 24 screen
  588.     lines) and you wanted to run it on a HP110 (which has 16 lines).  To
  589.     change  the   screen   size:  (screen-length   16).  (screen-length)
  590.     returns the screen size -1.  This is ME's "logical" screen size - ME
  591.     leaves one line open for the minibuffer.
  592.   If you need to use this often, put it in you init.mut file.
  593.   Range: [5 : physical screen length]
  594.   See also: ERRATA.DOC file.
  595. screen-width    [[NUMBER] : NUMBER]
  596.   Change the physical screen width.
  597.   Range: [5 : physical screen width]
  598.  
  599. tab-stops    Local    [[NUMBER] : NUMBER]
  600.   If given an argument then set the tab stops to every nth column.
  601.     If n==0 use the tab character.
  602.     If n>1 use spaces to simulate the tab character.
  603.   Initial value: 0
  604.  
  605. text-color    [[NUMBER] : NUMBER]
  606.   Change the the text color.
  607.   Note that the color values are display dependent.
  608.   See also: modeline-color, ERRATA.DOC.
  609.  
  610. word-wrap    Local    [[NUMBER] : NUMBER]
  611.   Setting word-wrap >0 turns it on, 0 turns it off.
  612.   Initial value: 0
  613.   When ME decides it is time to word wrap, it does a (exe-key "^M")
  614.     which executes whatever is bound to the Enter key.  This also
  615.     provides a hook if your pgm wants to do something at that time.
  616.   See also: word wrap, (set-fill-column) (both in ME.DOC).
  617.  
  618. ========================================================================
  619. ==        Miscellaneous                          ==
  620. ========================================================================
  621.  
  622. Initialization file (init.mco)
  623.      ME has an initialization file "init.mco".  It attempts to load this
  624.   file first from the current directory.  If it is not there then it
  625.   looks at the environment variable ME and tries that directory.  Note
  626.   that a trailing slash is required for the ME variable.  So, in MS-DOS,
  627.   "set ME=C:/medir/" will cause "C:/medir/init.mco" to be loaded.
  628.  
  629.      Note that if there is an initialization file and it loads OK, ME
  630.   does not process the command line in any way.  This means that
  631.   init.mut can process argv in any way it wants to.  It also means it
  632.   has to read in any files the user stuck there for editing.  This means
  633.   you can create your own command line options, read all the files in at
  634.   once, read the files one at a time, etc.
  635.