home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34exe.zip / doc / package.doc < prev    next >
Text File  |  1995-01-14  |  41KB  |  973 lines

  1. ========================================================================
  2. ==        ME Packages             Craig Durland  10/91 ==
  3. ========================================================================
  4.  
  5. Here is some documentation on some of the packages of Mutt programs I
  6. use.
  7.  
  8.              Copyright 1991 Craig Durland
  9.     Distributed under the terms of the GNU General Public License.
  10.   Distributed "as is", without warranties of any kind, but comments,
  11.            suggestions and bug reports are welcome.
  12.  
  13. ========================================================================
  14. ==            Customizing me3.mut                  ==
  15. ========================================================================
  16.  
  17. Overview:
  18.   When ME runs, it tries to load several files:
  19.     osstuff.mco : OS related stuff.
  20.     ./mext.mco  : Directory local ME extensions
  21.     myme.mco    : Your personal ME extensions.
  22.   (You can change this behavior, see package me3.mut below).
  23.  
  24.  
  25. Package:    me3.mut
  26. How loaded: Compiled into ME (with the C compiler).
  27. Description:
  28.   This is (most of) the front end for ME.  It sets up lots of
  29.     keybindings, autoloading, etc.  When ME runs, me3.mut tries to load
  30.     several files:
  31.       osstuff.mco : OS related stuff.
  32.       ./mext.mco  : Directory local ME extensions
  33.       myme.mco    : Your personal ME extensions.
  34.  
  35.   If you want to change basic ME, edit this file, and recompile ME.
  36.  
  37. Package:    myme.mut
  38. How loaded: By me3.mut as part of start up.
  39. Description:
  40.   This is the file that you put your personal extensions to ME in.
  41.     This is the stuff you don't want to everybody to have to use.  You
  42.     should put myme.mco in a spot that that is only in your ME3 path
  43.     (such as your home directory).
  44.   A copy of the file I use is in ../mutt/misc/myme.mut.
  45. See also:  cmdline.mut
  46.  
  47. Package:  osstuff.mco
  48. See:  OS Stuff below.
  49.  
  50. Package:    ./mext.mut
  51. How loaded: By me3.mut as part of start up.
  52. Description:
  53.   If this file is the current directory when ME starts, me3.mut will
  54.     load it.  Use it to hold stuff you want ME to know about only in
  55.     this directory.
  56.   For example, I have a bunch of Mutt code to help me design bicycles.
  57.     I could autoload it but then I would have to type something
  58.     every time I wanted to work on a bicycle.  Since I do all the work in
  59.     the bicycle directory, I just put the code in bicycle/myme.mco and
  60.     when I run ME, it is loaded automatically.
  61.  
  62.  
  63. ========================================================================
  64. ==            Process the Command Line              ==
  65. ========================================================================
  66.  
  67. Package:    cmdline.mut
  68. How loaded: part of me3.mut.
  69. Description:
  70.   This file handles the processing of the command line.  There are some
  71.   built in (to ME) defaults (see "Command Line Options" in me3.doc).
  72.   You can add your own by using COMMAND-LINE-HOOK in your myme.mut.
  73. Hooks:
  74.   (COMMAND-LINE-HOOK)        Not bound
  75.     Use (register-hook) to register your command line processor.  It
  76.       will be called for each argv[].  If the arg is for you, process it
  77.       in some way, shape or form and return TRUE.  Else returns FALSE.
  78.     For example:  (register-hook COMMAND-LINE-HOOK "my-command-line")
  79. Functions:
  80.   (next-cmd-line-arg)        Not bound
  81.   (next-cmd-line-arg pointer-to-string)
  82.     If you need another command line arg, use this.  If there are args
  83.       left on the command line, it puts the next one into string and
  84.       returns TRUE.  Else "<no arg>" is put into the string and FALSE is
  85.       returned.
  86.   (any-cmd-line-args-left)    Not bound
  87.     Returns TRUE if there are any command line args left to be
  88.       processed.
  89.   (push-back-cmd-arg)        Not bound
  90.     If, for some reason, the arg needs to be processed again, you can
  91.       call this.  It pushes back the current arg.  Can be called until
  92.       all args have been pushed.
  93.   (stop-processing-cmd-line)    Not bound
  94.     If you want process-command-line to stop (after this arg (or before
  95.       if you push it back)), call this.  Processing will resume when
  96.       process-command-line is called again.
  97.  
  98. See also:  ME-command-line in basic.mut for example code.
  99.  
  100. ========================================================================
  101. ==            Mark Rings                      ==
  102. ========================================================================
  103.  
  104. Package:    markring.mut
  105. How loaded: part of me3.mut, turned on for interactive buffers
  106. Description:
  107.   Mark rings provide a way to mark multiple places in a buffer so you
  108.   can jump to them easily.  Note that they can't span buffers.  Up to 4
  109.   marks (easily changeable in markring.mut) are kept, as more are set,
  110.   the ring wraps around and reuses the older marks.
  111. Functions:
  112.   (markring-push)    M-C-p or F-9
  113.     Push the dot into the end of the ring.
  114.   (markring-pop)    M-p
  115.     Goto the next mark in the ring.
  116.   (markring-delete)    Not bound
  117.     Remove the most recently popped mark from the ring.
  118.   (markring-init)    Not bound
  119.     Use this if a markring was not setup in this buffer (it normally is)
  120.     or you want to remove all marks from the ring and start over.
  121.  
  122. ========================================================================
  123. ==            Kill Rings                      ==
  124. ========================================================================
  125.  
  126. Package:    killring.mut
  127. How loaded: manually
  128. Description:
  129.   The kill ring package is a port of the GNU Emacs kill ring code.  It
  130.     provides the same functionality.
  131. Functions:
  132.   (kill-region)            C-w
  133.     Same as cut-region but puts the region into the kill ring.
  134.   (copy-region-as-kill)        M-w
  135.     Same as kill-region (copy-region) but the region is not deleted.
  136.   (append-next-kill)        M-C-w
  137.     The NEXT kill will be appended to the top entry in the kill ring,
  138.       rather than creating a new entry in the ring.
  139.   (yank)            C-y
  140.     Insert the top entry of the kill ring.  C-u C-y inserts the nth
  141.       entry from the ring.
  142.   (yank-pop)            M-y
  143.     If the last command was yank or yank-pop, yank-pop will replace the
  144.       yank with the ring entry before it.  This allows you to cycle
  145.       through the ring to find the item you want.
  146.  
  147. ========================================================================
  148. ==            Mode Support                      ==
  149. ========================================================================
  150.  
  151. Package:    alamode.mut
  152. How loaded: part of me3.mut
  153. Description:
  154.   This is the package that turns on modes.  Here is how it works (in the
  155.     order that things happen):
  156.   - When a interactive buffer is created, if the environment variable
  157.     MEMODE is set, "-mode" is appended to it and a call is made to that
  158.     function.  For example, if MEMODE is set to "mail", every time a
  159.     interactive buffer is created, "mail-mode" is called for that
  160.     buffer.  If the mode doesn't exist, ME will complain.
  161.   - If there is no MEMODE variable, the buffer name is looked at.  The
  162.     list of modes is looked at to see if any of the modes fits the name.
  163.     (You can change the list with auto-mode-list (see below).)  Here are
  164.     the default modes:
  165.       Extension        Program Run
  166.       ---------        -------    ---
  167.     .c        c-mode
  168.     .h        c-mode
  169.     .mut        mutt-mode
  170.     .doc        text-mode
  171.     .txt        text-mode
  172.     If the program is not there, ME will complain, but you might not
  173.       see it because other things will be written to the command line
  174.       after the error message (like "[Read 10 lines]").  No harm is done
  175.       if the mode is not run.
  176.     If there are no matches, the default-major-mode is run (see below).
  177.   - When a file is read into a interactive buffer, the first line of the
  178.     buffer is looked at.  If it contains text of the form "-*-foo-*-",
  179.     foo-mode is run.
  180. Functions:
  181.   (default-major-mode)    Not bound
  182.     Set the default major mode.  This is the mode set for a interactive
  183.       buffer when no other mode seems to fit.
  184.     For example:  If you want text mode to be the default:
  185.     (default-major-mode "text").  The "-mode" is appended when the mode
  186.       needs to be run.
  187.     The mode might be changed when the file is read in (see above).
  188.     The default is "none".
  189.   (auto-mode-list) (bool append)(string mode-re mode-name ...)
  190.     Append or Prepend to the list of modes.
  191.     Input:
  192.       append:  TRUE if you want your list of modes to be appended (ie
  193.     searched last) to the list of modes.  There are two reasons you
  194.     might want to do this:  If you have not-very-often used mode,
  195.     putting it a the end of the list means a quicker search time for
  196.     the more often used modes.  If you want to override one of the
  197.     defaults, prepend so your new mode will be found first.
  198.       mode-re:
  199.         This is a regular expression that the buffer name is tested with.
  200.       If there is a match, mode-name is run.  For example, if you
  201.       want to test for the extension foo, use '.*\.foo$'.  The
  202.       single quote is important.  This re matches any string that
  203.       ends with the characters ".foo".  Note:  the re is not a
  204.       searching re - it is in place regular expression match.  That
  205.       is why you need the .* at the start.
  206.     Notes:
  207.       The mode-re is used to match the buffer name NOT the file
  208.         name.  Since I do the match at buffer create time, I don't
  209.         have a file name.  If you want to match file names, you will
  210.         need to change the call to set-mode from buffer-created-hook
  211.         to file-read-hook.  I used buffer-created-hook because then
  212.         I can use (switch-to-buffer) and have the mode set without
  213.         reading in a file.
  214.       My Unix mailer uses temp files named "/tmp/Re<digits>".  An re
  215.         to match that is 'Re[0-9]+$'.  Then, whenever mail uses ME
  216.         to edit mail, you can edit with your favorite mail mode.
  217.       mode-name:  The name of the mode you want to run if there is a
  218.         match.  If you want c mode, use "c".  The "-mode" is appended
  219.     when the mode needs to be run.
  220.     Here is the default:
  221.       (auto-mode-list TRUE
  222.     '.*\.c$'    "c"
  223.     '.*\.h$'    "c"
  224.     '.*\.mut$'    "mutt"
  225.     '.*\.doc$'    "text"
  226.     '.*\.txt$'    "text"
  227.       )
  228.     If you want to get rid of mode, prepend it and use none.  For
  229.       example, if you don't like c mode, use
  230.       (auto-mode-list FALSE '.*\.c$' "none"  '.*\.h$' "none") and c-mode
  231.       won't be called.  Of course, you could also just remove cmode.mco
  232.       and achieve the same result.
  233.     If you want to get rid of all modes, use 
  234.       (auto-mode-list FALSE '.' "none").  This will set every buffer to
  235.       none-mode.
  236. Notes:
  237.   While using the mode-re's gives a lot of flexibility, I wonder about
  238.     the speed hit.  Knowing how all this is implemented, it seems like
  239.     all those regular expression tests has got to take a long time.  It
  240.     doesn't seem to on my machine (but its a real fast machine).  Does
  241.     anyone use anything but the extension?  If not, it might make more
  242.     sense to just have a list of (extension, mode) pairs.
  243.   Sigh, I found a good use for the full name.  See my comments about
  244.     mail in mode-re above.
  245.  
  246. ========================================================================
  247. ==            C Mode                          ==
  248. ========================================================================
  249.  
  250. Package:    cmode.mut
  251. How loaded: 
  252.   Autoloaded when a buffer with extension ".c" or ".h" created or when a
  253.   file is read in with "-*-c-*-" in the first line.
  254. Modes:
  255.   Major: C
  256.   Minor: none or comment
  257. Description:
  258.   Electric C mode.  A collection of routines I've found useful when
  259.   editing C code.  It is turned on when ever you edit a .c or .h file.
  260.   Helps with comments, backspacing over tabs, { and a few others.
  261.  
  262.     Electric C mode is designed to help keep your C code formatted "as
  263.   you code".  You don't have to remember anything special - as you type,
  264.   what you type is looked at and may trigger certain actions.  This is a
  265.   minimalist C mode ment to enable you to keep your C code formatted in
  266.   a consistent manner.  The only extensive help is for comments.
  267.  
  268. Characters that trigger formatting:
  269.   Enter (return):  Matches the indent level of the previous line.
  270.   "{": When a "{" is pressed, one of the following will happen:
  271.     - If the space bar is pressed, "{ }" is generated and the cursor is
  272.       put between the braces.
  273.     - If Enter is pressed:
  274.         And the rest of the line is blank, you will get something like:
  275.          if (a) {        or  if (a)
  276.            cursor        {
  277.          }              cursor
  278.                  }
  279.         depending on where the "{" was.  The cursor is indented by
  280.        the amount specified by "indent-level".
  281.       If the rest of the line was not blank, a newline-and-indent is
  282.        done and the text after the { is indented.
  283.         For example:
  284.          if (a) foo(): if a "{ Enter" is done before the foo()
  285.          you will get:
  286.          if (a) {
  287.            foo()
  288.     - Otherwise, a "{" is inserted.
  289.   Backspace:  Behaves like backspacing over spaces even when backspacing
  290.     over tabs.
  291.   Newline (control-J):  Used to give some white space after a variable
  292.     declaration block.  The cursor is left at the same column as the
  293.     start of the declarations.
  294.       int j;    => int j;
  295.             blank line
  296.             cursor
  297.   "/": Comment assistance.
  298.     - If "*" is pressed and the rest of the line is blank and there is
  299.       text to the left of the "/", "/* */" is generated and the cursor
  300.       is put in the middle of the comment.  This is for end of line
  301.       comments like:  if (a) foobar(); /* comment */
  302.     - If "*" is pressed and the entire line is blank, block comment mode
  303.       is entered.  In this mode, your comment will autowrap at the
  304.       comment-wrap-column.  When you hit Enter or autowrap, stars are
  305.       put in the proper place, whitespace is added to match the previous
  306.       comment line.  If you press Enter "/", comment mode will
  307.       terminate.  "*/" or "*" blanks "/" will also terminate comment
  308.       mode.  If you want to get out of comment mode without using the
  309.       above, press M-; or execute "nocomment".
  310.       Examples:
  311.          /*
  312.               * Comment
  313.           *   Indented a bit
  314.           *   Next line follows the indent.
  315.           */
  316.          /*
  317.          ** Another comment style
  318.          */
  319.     - Otherwise, a "/" is inserted.
  320.   Meta-;
  321.     If in block comment mode, turn off comment mode.
  322.     If the cursor is on a line that is part of a block comment, start up
  323.       block comment mode.  This is very handy for adding to an existing
  324.       block comment.
  325.   Meta-J:  Format a C block comment.
  326.     If you munge a block comment and want to set it right, use this.
  327.     This formats all the lines between the dot and mark inclusive.
  328.     Put the region around the comment (or the part of the comment you
  329.       want to format) and press M-j.  The comment is commented in the
  330.       format of comment mode.
  331.     Notes:
  332.       To make sure that line breaks are preserved, insert blank lines at
  333.     the breaks.  The blank lines will be deleted after the comment
  334.     is formatted.
  335.       To change the indent level of the block, indent the first line of
  336.     the region to where you want.
  337.   Control-U Meta-J: Format a C boxed comment.
  338.     Same as format block comment except the comment is boxed:
  339.      /********************************
  340.       *   Comment            *
  341.       ********************************/
  342.     You can convert between boxed and block comments by just reformatting.
  343.  
  344. Constants (in cmode.mut) that can be modified to change formatting style:
  345.   Enter-key-action
  346.     Set this to "newline-and-indent" or "newline".  One of these is
  347.       called when the enter key is presses.
  348.   INDENT-LEVEL
  349.     This is the number of spaces to indent a block ie :
  350.     {
  351.         <block indent>
  352.     }
  353.     Default is 2.
  354.   COMMENT-WRAP-COLUMN
  355.     The column to word wrap at when in comment mode.  The default is 76.
  356.   TAB-SIZE
  357.     How many spaces to use when tab is hit.  The default is 0 which
  358.     means use hard tabs (which look like 8 spaces).
  359.   C-STARS
  360.     The number of stars to use at the left when in comment mode.
  361.     Use " *" if you use this style (1) (the default):
  362.     /*
  363.      *
  364.      */
  365.     Use "**" if you use this style (2):
  366.     /*
  367.     **
  368.     */
  369.   COMET
  370.     Match this with C-STARS:
  371.     Use " */" for style (1) and "*/" for style (2).
  372.  
  373.   BOXED-COMMENT-SPACE
  374.     The number of blank lines before and after text in boxed comment.
  375.     Default is 1.
  376.   BOXED-COMMENT-TRAILING-BLANKS
  377.     Blanks between text and *.  Default is 1.
  378.   BOXED-COMMENT-EDGE-STARS
  379.     You probably want to match this with C-STARS.  Use "*" or "**".
  380.  
  381. System Variables
  382.   tab-size
  383.     This is set to the constant tab-size.  You can change this with
  384.       c-mode-hook.
  385.   word-wrap
  386.     When in comment mode, word-wrap is set to the comment-wrap-column.
  387.       When comment mode ends, it is reset to 0.
  388.  
  389. Buffer Variables
  390.   "comment-offset" (number)
  391.  
  392. Functions:
  393.   (c-mode)    Not bound
  394.     Turn on C mode for the current buffer.
  395.  
  396. Hooks
  397.   (c-mode-hook)
  398.     This hook is called (if it exists) after c mode has initialized
  399.       itself.  With this hook you can override settings or do those few
  400.       extra things you wished c mode set up.  For example, this is the
  401.       perfect place to set the tab-size to what you think it should be.
  402.     This is a program you add to your code (typically in myme.mut).
  403.     Use this hook if you don't want to modify the constants in
  404.       cmode.mut.
  405.  
  406. Customizing (usually done in c-mode-hook)
  407.   (c-mode-etc) (int indent-level comment-wrap-column) (string c-stars comet)
  408.     Call this routine to change routine stuff.
  409.     Default (done by c-mode) is 
  410.     (c-mode-etc INDENT-LEVEL COMMENT-WRAP-COLUMN C-STARS COMET)
  411.   (c-mode-boxed) (int boxed-comment-space boxed-comment-trailing-blanks)
  412.      (string boxed-comment-edge-stars)
  413.     Use this to change the boxed comment style.
  414.     Default (done by c-mode) is 
  415.       (c-mode-boxed BOXED-COMMENT-SPACE BOXED-COMMENT-TRAILING-BLANKS
  416.             BOXED-COMMENT-EDGE-STARS)
  417.  
  418. ========================================================================
  419. ==        More Help For C Programming                  ==
  420. ========================================================================
  421.  
  422. Package:    cstuff.mut
  423. How loaded: Manually
  424. Description:
  425.   A few routines I didn't feel like integrating into C mode.
  426. Functions:
  427.   (end-slide)            M-`
  428.     Slide all text to the right of the cursor so that the last character
  429.     on the line is in column 78.  You can use C-u<column> to override
  430.     the 78 or just change the constant in cstuff.mut.  This is real
  431.     handy if have a bunch of one line comments that you want to end in
  432.     same column.  For example:
  433.     switch (foo)
  434.     {
  435.       case x:           /* we do this amazing thing when x */
  436.       case y:                 /* and doodah when y */
  437.     Just put the cursor in the white space between before the command
  438.       and press "M-`".
  439.   (c-header-with-text)        Not bound
  440.     This is used to generate fancy headers that look like:
  441.     /* ********************************************************* */
  442.     /* ********************* Fancy Header ********************** */
  443.     /* ********************************************************* */
  444.     Just answer "Fancy Header" when you are asked for the header text.
  445.  
  446. ========================================================================
  447. ==            Mutt Mode                      ==
  448. ========================================================================
  449.  
  450. Package:    muttmode.mut
  451. How loaded: 
  452.   Autoloaded when a buffer with extension ".mut" created or when a file
  453.   is read with "-*-mutt-*-" in the first line.
  454. Modes:
  455.   Major: Mutt
  456.   Minor: none or comment
  457. Description:
  458.   Electric Mutt mode.
  459. Functions:
  460.   (mutt-mode)            Not bound
  461.     Turn on Mutt mode for the current buffer.
  462.   (deref-key)            F-3
  463.     Press a key, the name of the function it is bound to is inserted in
  464.       the buffer.
  465.   (pgm-completer)        F-4
  466.     Use command completion to choose a Mutt or ME keyword and insert it.
  467.   (pgm-completer-in-place)    ESC ESC
  468.     Complete the word the cursor is on/in.  Word is assumed to be the
  469.       name of a program or a Mutt or ME keyword.
  470.   (pgm-ask-complete)        ESC =
  471.     Complete the word the cursor is on/in as far as possible and then
  472.       ask for the rest of the word.  Word is assumed to be the name of a
  473.       program or a Mutt or ME keyword.
  474.     Typically used when pgm-completer-in-place doesn't complete the
  475.       entire word.
  476.   (Mutt-mode-{)            {
  477.     Handle "{" and "{{" according to Mutt rules.
  478.   (Mutt-comment-out-block)    Not bound
  479.     Put ";" in column 1 of all lines in the region.
  480.   (Mutt-comment)        M-;
  481.   (end-Mutt-comment)        M-;
  482.     Toggle comment mode.
  483.   (Mutt-Enter)            C-m (enter or return) 
  484.     Handle enter in comment mode.
  485.   (BS-untabify)            C-h (backspace)
  486.     Just like backspace but turns tabs into spaces when backing up over
  487.       them.
  488.   (format-Mutt-comment)        M-j
  489.     Format a region as a Mutt comment.
  490.   (Mutt-header-with-text)    Not bound
  491.     Create a header like:
  492.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  493.     ;;;;;;;;;;;;;;;;;;;;;;; Create a Header ;;;;;;;;;;;;;;;;;;;;;;;
  494.     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  495.  
  496. ========================================================================
  497. ==        Text Browser, Hyper Link System                  ==
  498. ========================================================================
  499.  
  500. Package:    web.mut
  501. How loaded:  Manually or by the ME help system.
  502. Description:
  503.   A [very] small hyper-text text browser.  Currently set up for ME but
  504.     could be expanded.
  505. Functions:
  506.   (web-mode)        Not bound
  507.     Browse the buffer, follow links to other topics.  Press "?" for help.
  508.   (web-doc)        ?
  509.     Show the commands available in web mode.
  510.   (web-select-item)    C-m (enter or return)
  511.     Use the word the cursor is on as link to another topic.  The link
  512.       may or may not exist.
  513.   (web-word)        Not bound
  514.     Ask the user for a link to follow.
  515.   (pgm-bound-to)    Not bound
  516.     Show all the keys a program is bound to.
  517.  
  518. See also:  webindex.mut
  519.  
  520. ========================================================================
  521. ==            Text Mode                      ==
  522. ========================================================================
  523.  
  524. Package:    textmode.mut
  525. How loaded: 
  526.   Autoloaded when a buffer with extension ".doc" or ".txt" created or
  527.   when a file is read with "-*-text-*-" in the first line.
  528. Modes:
  529.   Major: Text
  530.   Minor: none
  531. Description:
  532.   Text mode.  Help with editing documents, etc.  Does line centering,
  533.   region centering, auto word wrap, format paragraphs, mark paragraphs,
  534.   move the cursor about in a paragraph, etc.
  535. Functions:
  536.   (text-mode)            Not bound
  537.   (adjust-block)        M-j
  538.     Format all lines in a block (lines between dot and mark inclusive).
  539.     Uses sysvar (word-wrap) or constant fill-column as the right margin.
  540.   (center-line)            M-s
  541.     Center the text in the line that the cursor is on.  With C-U, center
  542.      n lines.  Uses (word-wrap) or (screen-width) as right margin.
  543.   (center-region)        Not bound
  544.     Center all lines in a block.
  545.   (underline-line)        Not bound
  546.     Underline a line of text.  All nonspace characters are underlined
  547.     with dashes.
  548.  
  549.   (forward-paragraph)        M-e
  550.     Attempts to move to the end of a paragraph.
  551.   (backward-paragraph)        M-a
  552.     Attempts to move to the beginning of a paragraph.
  553.   (mark-paragraph)        M-h
  554.     Attempts to make the region include the paragraph the cursor is in.
  555.     Put mark at beginning of this paragraph, point at end.  If between
  556.     paragraphs, mark the next one.
  557.   (cut-paragraph)        Not bound
  558.     Cut to end of paragraph.
  559.   (backward-cut-paragraph)    Not bound
  560.     Cut back to start of paragraph.
  561.  
  562. Constants that can be set to affect text mode.
  563.   FILL-COLUMN
  564.     This is used to set the right margin in text mode.  Default is 72.
  565.   TAB-SIZE
  566.     How many spaces to use when tab is hit.  The default is 0 which
  567.     means use hard tabs (which look like 8 spaces).
  568.  
  569. System Variables
  570.   tab-size
  571.     This is set to the constant TAB-SIZE.  You can change this with
  572.     text-mode-hook.
  573.   word-wrap
  574.     This is set to the constant FILL-COLUMN.  You can change this with
  575.     text-mode-hook.
  576.  
  577. Hooks
  578.   (text-mode-hook)
  579.     This hook is called (if it exists) after text mode has initialized
  580.       itself.  With this hook you can override settings or do those few
  581.       extra things you wished text mode set up.  For example, this is
  582.       the perfect place to set the tab-size to what you think it should
  583.       be.
  584.     This is a program you add to your code (typically in myme.mut).
  585.     Use this hook if you don't want to modify the constants in
  586.       textmode.mut.
  587.  
  588. Customizing (usually done in text-mode-hook)
  589.   (text-fill-column) [int fill-column]
  590.     This is only currently used if word-wrap is 0.  It basically sets
  591.       the wordwrap fill-column for formatting text.
  592.     (text-fill-column) :  Returns the current value of fill-column.
  593.     (text-fill-column fill-column) : Sets the fill-column to fill-column.
  594.     Notes:
  595.       You can't call this until text mode is loaded.
  596.       I'm not real sure about the use of this.  Set it if you set
  597.     word-wrap to zero.  I'll need to think some more on how this
  598.     should work.
  599.  
  600. ========================================================================
  601. ==        Mail Mode                          ==
  602. ========================================================================
  603.  
  604. Package:    mailmode.mut
  605. How loaded: Auto loaded or via the MEMODE environment variable
  606. Modes:
  607.   Major: Text
  608.   Minor: Mail
  609. Description:
  610.   A minor mode of text-mode.
  611.   A [short] set of programs that make it a bit easier to work with
  612.     electronic mail or Usenet notes.
  613. Functions:
  614.   (mail-mode)    Not bound
  615.     Turns on mail mode.
  616.     Here are two way to get mail-mode turned on automatically when you
  617.       edit mail:
  618.     set-mode (in alamode.mut) sets this mode if the environment variable
  619.       MEMODE is set to "mail".  In my .profile, I have:
  620.     EDITOR=$HOME/bin/me3
  621.     MAILER=mailx
  622.       In .kshrc:
  623.     alias mail="MEMODE=mail   $MAILER"
  624.       Thus, whenever I type "mail" and get into the editor, I get ME in
  625.       mail-mode.
  626.     Another (better) way to do this is to note the name the mailer uses
  627.       for temporary files (the ones it uses to hold the mail you are
  628.       editing).  I use mailx and the form is:  "/tmp/Re<digits>".  So,
  629.       to get mail-mode when editing mail, add
  630.      (auto-mode-list TRUE
  631.        'Re[0-9]+$'  "mail"        ;; mailx:  "/tmp/Re<digits>"
  632.      )
  633.       to your startup file (myme.mut).
  634.   (mail-format-quote-region)    M-`    (meta backquote)
  635.     Format a region-block (all lines in region) and put a prefix
  636.       (default is "> ") in front of each line.  With arg (C-u), askes
  637.       what to use as a prefix.
  638.     This is very handy when want to reply to something that was sent to
  639.       you.  You can cut out the relevant chunk and have it formatted
  640.       nicely.  If you are replying to several people in the same
  641.       letter, use the arg option - this allows you to prefix everything
  642.       Peter says with something like "Peter> " so that everybody
  643.       receiving your mail will know who said what.  You can change the
  644.       default by changing "quoter" in mailmode.mut.
  645.   (mail-quote-region)    Not bound
  646.     Put the prefix in front of every line in the region.  No formatting.
  647. Constants:
  648.   quoter : The default string that is used when quoting text.
  649.     Initially "> ".
  650.  
  651. ========================================================================
  652. ==        Picture Mode                          ==
  653. ========================================================================
  654.  
  655. Package:    picture.mut
  656. How loaded: Auto loaded in me3.mut
  657. Description:
  658.   GNU Emacs Picture mode.  This mode is used to edit tables, text
  659.     pictures, etc.  Well documented in picture.mut or use the GNU Emacs
  660.     manual.
  661.   I've added a picture function that I find useful:  picture-box.
  662.   Note:  My port is something of a quick hack.  I didn't implement
  663.     rectangle registers (I put everything into the cut buffer).  I don't
  664.     use picture mode all that much and so haven't really beat on it.
  665.     In my limited testing, everything seems to work but I'm sure there
  666.     some things I missed.
  667. Functions:
  668.   (edit-picture)    Not bound  Autoloaded
  669.   (picture-box)        Not bound
  670.     Draw a box around the rectangle region.
  671.  
  672. ========================================================================
  673. ==        Buffer Menu Mode                      ==
  674. ========================================================================
  675.  
  676. Package:    buf-menu.mut
  677. How loaded: Auto loaded in me3.mut
  678. Description:
  679.   GNU Emacs buffer mode.  This mode allows you to manipulate buffer in
  680.   the list-buffers window.
  681. Functions:
  682.   (buffer-menu)        C-uC-xC-b  Autoloaded
  683.     Turns on Buffer Menu mode for the list-buffers buffer.
  684.   (Buffer-menu-doc)    "?"
  685.     Display documentation about buffer menu mode.
  686.  
  687. ========================================================================
  688. ==            Directory Stack                      ==
  689. ========================================================================
  690.  
  691. Package:    dir.mut
  692. How loaded: Auto loaded in me3.mut.
  693. Description:
  694.   Directory stack ala c-shell (UNIX only).  The stack size is fixed but
  695.   can be easily changed in dir.mut.
  696. Functions:
  697.   (cd)        Auto Loaded
  698.     Change the current directory.
  699.   (dirs)    Not auto loaded
  700.     Show the contents of the directory stack in a popup menu.  The top
  701.       entry is the current directory, next is the directory you left to
  702.       get to the current directory.  Press return to move to the current
  703.       directory (ie do nothing) or move the ">" cursor to the directory
  704.       you want to move to and hit return.
  705.   (pwd)        Auto Loaded
  706.     Show the current directory.
  707.   (pu)        Auto Loaded
  708.     Change the current directory, using the stack to save the changes.
  709.     (pu directory) pushes the current directory on the stack and sets
  710.        the current directory to directory.
  711.     (pu "") swaps the top 2 entries on the stack.
  712.     (pu "+n") swaps the top of the stack with the nth stack item.  n
  713.        starts at zero.
  714.     (pu "+") runs (dirs) to give you a popup menu to select a stack
  715.        entry from.
  716.   (po)        Not auto loaded
  717.     Discards the top entry on the stack and sets the current directory
  718.      to the new top of stack.
  719.  
  720. ========================================================================
  721. ==        Search [and Replace] Across Files              ==
  722. ========================================================================
  723.  
  724. Package:    findit.mut
  725. How loaded: Autoloaded in me3.mut
  726. Description:
  727.   Uses grep to search for a string in many files.  Once all the files
  728.     are found, the first file is visited and the string is looked for
  729.     with incremental search.  You can continue the search, edit or do
  730.     anything you want.  Once you are finished, use C-xC-n to visit the
  731.     next file containing the string.
  732.   With arg (C-u), do a search and replace across a bunch of files.  In
  733.     other aspects, acts the same as search.
  734. Functions:
  735.   (findit)    Not bound
  736.     Search for a string.  Use C-u for search and replace.
  737.   (showit)    C-xC-n
  738.     Goto the next file containing the string.
  739.  
  740. ========================================================================
  741. ==        Gomoku Game                          ==
  742. ========================================================================
  743.  
  744. Package:    gomoku.mut
  745. How loaded: Manually
  746. Description:
  747.   GNU Emacs Gomoku is a game played between two players (one of which is
  748.     ME) on a rectangular board.  Each player, in turn, marks a free
  749.     square of its choice.  The winner is the first one to mark five
  750.     contiguous squares in any direction (horizontally, vertically or
  751.     diagonally).
  752.   For more info, "use the source, Luke".
  753. Functions:
  754.   (gomoku)    Not bound
  755.  
  756. ========================================================================
  757. ==        Hide Buffers                          ==
  758. ========================================================================
  759.  
  760. Package:    hidebuf.mut
  761. How loaded: part of me3.mut
  762. Description:
  763.   Implements a "soft" buffer hidden bit.  Buffers can be put aside for a
  764.   little while and restored later.  I use this as a kind of workspace
  765.   manager - when I go off on a tangent, I can hide the files I'm working
  766.   on and when I've finished, unhide the files and pick up where I left
  767.   off.  Hiding files gets them out of the way of your current work.
  768. Functions:
  769.   (next-buffer)        F-2
  770.     Find the next unhidden buffer and make it the current one.  Next
  771.     means alphabetically.  With this routine, you can just bang on
  772.     function key 2 to move though all the buffers.
  773.   (prev-buffer)        Not bound
  774.     Find the previous unhidden buffer and make it the current one.
  775.   (hide-buffer)        M-h
  776.     Hide the current buffer.
  777.   (unhide-buffer)    Not bound
  778.     Unhide a buffer by name.
  779.   (unhide-buffers)    Not bound
  780.     Unhide all buffers.
  781.  
  782. ========================================================================
  783. ==            Hook Support                      ==
  784. ========================================================================
  785.  
  786. Package:    hook.mut
  787. How loaded: part of me3.mut.
  788. Description:
  789.   Provides support for the hooks that ME calls:  create-buffer-hook,
  790.     clear-buffer-hook, command-line-hook, free-buffer-hook, idle-hook,
  791.     read-file-hook, enter-me-hook, leave-ME-hook, process-hook,
  792.     stop-ME-hook.
  793.   In addition, it creates hooks of its own for interactive buffers:
  794.     Iclear-buffer-hook, Icreate-buffer-hook, Ifree-buffer-hook,
  795.     Iread-file-hook.
  796.   The interactive hooks are called for buffers that have the Interactive
  797.     bit set.  See buffer-flags in me3mutt.doc of some more info.
  798.   If you program uses a hook, it should register the hook (probably in a
  799.     MAIN routine).  In this way, many programs can share hooks with a
  800.     minimum of fuss.
  801.   I don't support two hooks:
  802.     - modeline-hook : Needs to be handled differently.  See modeline.mut.
  803.     - key-pressed-hook : Slows things down too much.  Your on your own.
  804. Functions:
  805.   (register-hook)    Not bound
  806.   (register-hook hook-id name-of-routine-to-call)
  807.     Get the hook-id out of me.mh.  name-of-routine-to-call is string.
  808.     Must not be HIDDEN.
  809.   (unregister-hook)    Not bound
  810.   (unregister-hook hook-id name-of-routine-to-call)    Not bound
  811.     Remove a hook from the hook list.  The args are the same as
  812.       register-hook.  Returns TRUE if the hook was removed, FALSE is the
  813.       hook could not be found.
  814.     Currently, only IDLE-HOOK is supported.
  815. See also:  The hook section of me3mutt.doc
  816.  
  817. ========================================================================
  818. ==        External Processes                      ==
  819. ========================================================================
  820.  
  821. These two packages use the compute server.  See me3mutt.doc and
  822. comserver.doc for more info on what it does and how to run it.
  823.  
  824. To run the compute server, use "comserver $HOME/.ME2.socket".
  825. Since the compute server is quite verbose, you will want to run it in
  826. its own window.  If that is not possible (or desirable), use this
  827. command:  "comserver $HOME/.ME2.socket >/dev/null 2>/dev/null &".
  828.  
  829. Package:    compile.mut
  830. How loaded: compile and grep are autoloaded in me3.mut
  831. Description:
  832.   Run a compile, grep or just about any output only process (such as
  833.     "ls" or "cc"), collect the output and optionally visit each line in
  834.     each file that is flagged.
  835.   Output is collected as the compile sends it out - you can still edit
  836.     normally.  This a "multiprocessing" compile - many things are going
  837.     on at once.  Note that ME only processes the compile output when
  838.     nothing else is happening - if a Mutt program is running or ME is
  839.     waiting for you (eg waiting for you to answer a question in the
  840.     minibuffer), compile output is queued and will be processed when
  841.     things are quiet again.  The *Compile* window can be removed from
  842.     the screen without affecting things.  DON'T delete the *Compile*
  843.     buffer (until to compile is done and you don't care about the
  844.     output).
  845.   Modeled after grep and compile in GNU Emacs.
  846.   This stuff only works on machines running unix (at least until
  847.     somebody ports the compute server to other OSes).
  848.   The compute server must be running.  It is what actually runs the
  849.     compiles - ME just processes the output.  See create-process in
  850.     me3mutt.doc for how to run the compute server.
  851. Functions:
  852.   (compile)        Not bound    Autoloaded
  853.     Run a command, in a shell and put the output in the *Compile*
  854.       buffer.  You can run things like make, "cc -o foo foo.c", ls or
  855.       just about anything that is output only (can't send input to the
  856.       remote processes).  Since the command is run in a shell (sh), you
  857.       can use things like $HOME, *.c, etc.
  858.     Use compile-next-error to step through the errors.
  859.   (grep)        Not bound    Autoloaded
  860.     Run grep, collect the output and use compile-next-error to step
  861.       through the matches.
  862.   (stop-compile)    Not bound
  863.     Stop the process running in the *Compile* buffer.
  864.   (compile-next-error)    C-x`  (control-X backquote)
  865.     Looks in the *Compile* buffer, makes a list of errors (or grep
  866.       matches), visits the file(s) with the error(s) and puts the cursor
  867.       at the bogus line.  Each time you press C-X`, the cursor moves to
  868.       the next error.  You can edit as much as you like at each error.
  869.       You can start using C-X` before the compile is done (it is
  870.       possible for the error list to get out of sync if you change a
  871.       file before the compiler is done with it but that should be a
  872.       minor problem).
  873.     Knows how to parse the output of:  mc2, grep, HP-UX 8.0 cc, Apollo
  874.       cc and hopefully other compilers.  I tried to match what GNU Emacs
  875.       does but working with regular expressions can be a real pain in
  876.       the butt so there might be some bugs in here.  Apollo cc is a real
  877.       pain.
  878.     Doesn't know about ld:  If you have loader errors, you won't see
  879.       them if you remove the *Compile* window or shrink it so you can't
  880.       read all of it.  I usually just look at the *Compile* buffer to
  881.       make sure all went as expected.
  882. Hooks
  883.   process-hook is used to capture the output of the compile or grep.
  884.  
  885. ========================================================================
  886. ==        Tags                              ==
  887. ========================================================================
  888.  
  889. Package:    tags.mut
  890. How loaded: manually
  891. Description:
  892.   Tags are a small database for C functions.  Have you ever edited some
  893.     C code and come across a function and say to yourself "I wonder
  894.     where this function is?", well, tags can help answer that for you.
  895.   Tags uses the Unix ctags command.
  896.   To start things, create the tags database:
  897.     In the current directory: "ctags -xtw files.[ch] >Tags"
  898.     In a subtree: "find . -name '*.[ch]' -print | xargs ctags -xtw >Tags"
  899.     Keep the tags file in the directory it is created in.
  900.   When the tags code is loaded, it will ask you what directory the tags
  901.     file is in.  If you are not going to be changing directories, you
  902.     can use ".".  If you might, give the full path name for the
  903.     directory (file name completion is on).  Remember to only give the
  904.     directory name.
  905. Functions:
  906.   (goto-tag)        M-.
  907.     Look up a keyword in the tags data base, visit the file it is
  908.       defined in and put the dot at the start of the routine.
  909.     If just hit return when asked for the tag, the word after the dot is
  910.       used.  This is nice for things like:
  911.         foobar(fred,sam);
  912.     ^ dot
  913.       Hit M-. <enter> and you will in the file that foobar is defined
  914.       in.
  915.   (select-tag-file)    Not bound
  916.     Load the tags database.  See above.  If you want to change to a new
  917.     database, just run this again.
  918.   (where-is-tag)    Not bound
  919.     Shows the file that the tag is defined in.  As in goto-tag but just
  920.     tells you the file instead of editing it.
  921.  
  922. ========================================================================
  923. ==        OS Stuff                          ==
  924. ========================================================================
  925.  
  926. Package:    unix.mut
  927. How loaded: 
  928.   Compiled and then unix.mco is renamed to osstuff.mco.  osstuff.mco is
  929.   loaded by me3.mut.
  930. Description:
  931.   osstuff is a file that is loaded so you have a place to put all your
  932.   OS specific code.  When you use ME on a variety of machines, this is
  933.   very handy.
  934. Functions (unix.mut):
  935.   (chmod)        Not bound
  936.     Runs change mode on the file connected to the current buffer.  Real
  937.     handy when you check out a file, read it in, edit it and when you
  938.     try to save you find out it is read-only.  ick.  Just run chmod and
  939.     enter "a+w" and then save it.
  940.   Some stuff to try and figure out the terminal type.
  941.  
  942. ========================================================================
  943. ==        VT100 Type Terminals                      ==
  944. ========================================================================
  945.  
  946. Package:    xterm.mut
  947. How loaded:
  948.   In unix.mut.  The environment variable "TERM" is looked at to try and
  949.   figure out if this file should be loaded.
  950. Description:
  951.   Some terminals support function keys, arrow keys, etc.  This file adds
  952.     some support for xterm, vt100 and ansi style terminals.
  953.   Decodes arrow keys and function keys (those keys that send out "Escape
  954.     [ ...").
  955.  
  956. ========================================================================
  957. ==        HP Terminal Support                      ==
  958. ========================================================================
  959.  
  960. Package:    hpterm.mut
  961. How loaded: 
  962.   In unix.mut.  The environment variable "TERM" is looked at to try and
  963.   figure out if this file should be loaded.
  964. Description:
  965.   Try and sent up a HP terminal so ME can understand it when you press a
  966.   function or arrow key.  HP terminals make life difficult for Emacs
  967.   because the function keys send out text that is the same as other
  968.   Emacs commands.  It can be very hard to tell if you pressed down arrow
  969.   or M-b (which do two very different things).
  970.  
  971.   In order for this stuff to work, you must be using a version of ME
  972.   that knows about HP terminals.  You can turn this on in config.h.
  973.