home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34exe.zip
/
doc
/
package.doc
< prev
next >
Wrap
Text File
|
1995-01-14
|
41KB
|
973 lines
========================================================================
== ME Packages Craig Durland 10/91 ==
========================================================================
Here is some documentation on some of the packages of Mutt programs I
use.
Copyright 1991 Craig Durland
Distributed under the terms of the GNU General Public License.
Distributed "as is", without warranties of any kind, but comments,
suggestions and bug reports are welcome.
========================================================================
== Customizing me3.mut ==
========================================================================
Overview:
When ME runs, it tries to load several files:
osstuff.mco : OS related stuff.
./mext.mco : Directory local ME extensions
myme.mco : Your personal ME extensions.
(You can change this behavior, see package me3.mut below).
Package: me3.mut
How loaded: Compiled into ME (with the C compiler).
Description:
This is (most of) the front end for ME. It sets up lots of
keybindings, autoloading, etc. When ME runs, me3.mut tries to load
several files:
osstuff.mco : OS related stuff.
./mext.mco : Directory local ME extensions
myme.mco : Your personal ME extensions.
If you want to change basic ME, edit this file, and recompile ME.
Package: myme.mut
How loaded: By me3.mut as part of start up.
Description:
This is the file that you put your personal extensions to ME in.
This is the stuff you don't want to everybody to have to use. You
should put myme.mco in a spot that that is only in your ME3 path
(such as your home directory).
A copy of the file I use is in ../mutt/misc/myme.mut.
See also: cmdline.mut
Package: osstuff.mco
See: OS Stuff below.
Package: ./mext.mut
How loaded: By me3.mut as part of start up.
Description:
If this file is the current directory when ME starts, me3.mut will
load it. Use it to hold stuff you want ME to know about only in
this directory.
For example, I have a bunch of Mutt code to help me design bicycles.
I could autoload it but then I would have to type something
every time I wanted to work on a bicycle. Since I do all the work in
the bicycle directory, I just put the code in bicycle/myme.mco and
when I run ME, it is loaded automatically.
========================================================================
== Process the Command Line ==
========================================================================
Package: cmdline.mut
How loaded: part of me3.mut.
Description:
This file handles the processing of the command line. There are some
built in (to ME) defaults (see "Command Line Options" in me3.doc).
You can add your own by using COMMAND-LINE-HOOK in your myme.mut.
Hooks:
(COMMAND-LINE-HOOK) Not bound
Use (register-hook) to register your command line processor. It
will be called for each argv[]. If the arg is for you, process it
in some way, shape or form and return TRUE. Else returns FALSE.
For example: (register-hook COMMAND-LINE-HOOK "my-command-line")
Functions:
(next-cmd-line-arg) Not bound
(next-cmd-line-arg pointer-to-string)
If you need another command line arg, use this. If there are args
left on the command line, it puts the next one into string and
returns TRUE. Else "<no arg>" is put into the string and FALSE is
returned.
(any-cmd-line-args-left) Not bound
Returns TRUE if there are any command line args left to be
processed.
(push-back-cmd-arg) Not bound
If, for some reason, the arg needs to be processed again, you can
call this. It pushes back the current arg. Can be called until
all args have been pushed.
(stop-processing-cmd-line) Not bound
If you want process-command-line to stop (after this arg (or before
if you push it back)), call this. Processing will resume when
process-command-line is called again.
See also: ME-command-line in basic.mut for example code.
========================================================================
== Mark Rings ==
========================================================================
Package: markring.mut
How loaded: part of me3.mut, turned on for interactive buffers
Description:
Mark rings provide a way to mark multiple places in a buffer so you
can jump to them easily. Note that they can't span buffers. Up to 4
marks (easily changeable in markring.mut) are kept, as more are set,
the ring wraps around and reuses the older marks.
Functions:
(markring-push) M-C-p or F-9
Push the dot into the end of the ring.
(markring-pop) M-p
Goto the next mark in the ring.
(markring-delete) Not bound
Remove the most recently popped mark from the ring.
(markring-init) Not bound
Use this if a markring was not setup in this buffer (it normally is)
or you want to remove all marks from the ring and start over.
========================================================================
== Kill Rings ==
========================================================================
Package: killring.mut
How loaded: manually
Description:
The kill ring package is a port of the GNU Emacs kill ring code. It
provides the same functionality.
Functions:
(kill-region) C-w
Same as cut-region but puts the region into the kill ring.
(copy-region-as-kill) M-w
Same as kill-region (copy-region) but the region is not deleted.
(append-next-kill) M-C-w
The NEXT kill will be appended to the top entry in the kill ring,
rather than creating a new entry in the ring.
(yank) C-y
Insert the top entry of the kill ring. C-u C-y inserts the nth
entry from the ring.
(yank-pop) M-y
If the last command was yank or yank-pop, yank-pop will replace the
yank with the ring entry before it. This allows you to cycle
through the ring to find the item you want.
========================================================================
== Mode Support ==
========================================================================
Package: alamode.mut
How loaded: part of me3.mut
Description:
This is the package that turns on modes. Here is how it works (in the
order that things happen):
- When a interactive buffer is created, if the environment variable
MEMODE is set, "-mode" is appended to it and a call is made to that
function. For example, if MEMODE is set to "mail", every time a
interactive buffer is created, "mail-mode" is called for that
buffer. If the mode doesn't exist, ME will complain.
- If there is no MEMODE variable, the buffer name is looked at. The
list of modes is looked at to see if any of the modes fits the name.
(You can change the list with auto-mode-list (see below).) Here are
the default modes:
Extension Program Run
--------- ------- ---
.c c-mode
.h c-mode
.mut mutt-mode
.doc text-mode
.txt text-mode
If the program is not there, ME will complain, but you might not
see it because other things will be written to the command line
after the error message (like "[Read 10 lines]"). No harm is done
if the mode is not run.
If there are no matches, the default-major-mode is run (see below).
- When a file is read into a interactive buffer, the first line of the
buffer is looked at. If it contains text of the form "-*-foo-*-",
foo-mode is run.
Functions:
(default-major-mode) Not bound
Set the default major mode. This is the mode set for a interactive
buffer when no other mode seems to fit.
For example: If you want text mode to be the default:
(default-major-mode "text"). The "-mode" is appended when the mode
needs to be run.
The mode might be changed when the file is read in (see above).
The default is "none".
(auto-mode-list) (bool append)(string mode-re mode-name ...)
Append or Prepend to the list of modes.
Input:
append: TRUE if you want your list of modes to be appended (ie
searched last) to the list of modes. There are two reasons you
might want to do this: If you have not-very-often used mode,
putting it a the end of the list means a quicker search time for
the more often used modes. If you want to override one of the
defaults, prepend so your new mode will be found first.
mode-re:
This is a regular expression that the buffer name is tested with.
If there is a match, mode-name is run. For example, if you
want to test for the extension foo, use '.*\.foo$'. The
single quote is important. This re matches any string that
ends with the characters ".foo". Note: the re is not a
searching re - it is in place regular expression match. That
is why you need the .* at the start.
Notes:
The mode-re is used to match the buffer name NOT the file
name. Since I do the match at buffer create time, I don't
have a file name. If you want to match file names, you will
need to change the call to set-mode from buffer-created-hook
to file-read-hook. I used buffer-created-hook because then
I can use (switch-to-buffer) and have the mode set without
reading in a file.
My Unix mailer uses temp files named "/tmp/Re<digits>". An re
to match that is 'Re[0-9]+$'. Then, whenever mail uses ME
to edit mail, you can edit with your favorite mail mode.
mode-name: The name of the mode you want to run if there is a
match. If you want c mode, use "c". The "-mode" is appended
when the mode needs to be run.
Here is the default:
(auto-mode-list TRUE
'.*\.c$' "c"
'.*\.h$' "c"
'.*\.mut$' "mutt"
'.*\.doc$' "text"
'.*\.txt$' "text"
)
If you want to get rid of mode, prepend it and use none. For
example, if you don't like c mode, use
(auto-mode-list FALSE '.*\.c$' "none" '.*\.h$' "none") and c-mode
won't be called. Of course, you could also just remove cmode.mco
and achieve the same result.
If you want to get rid of all modes, use
(auto-mode-list FALSE '.' "none"). This will set every buffer to
none-mode.
Notes:
While using the mode-re's gives a lot of flexibility, I wonder about
the speed hit. Knowing how all this is implemented, it seems like
all those regular expression tests has got to take a long time. It
doesn't seem to on my machine (but its a real fast machine). Does
anyone use anything but the extension? If not, it might make more
sense to just have a list of (extension, mode) pairs.
Sigh, I found a good use for the full name. See my comments about
mail in mode-re above.
========================================================================
== C Mode ==
========================================================================
Package: cmode.mut
How loaded:
Autoloaded when a buffer with extension ".c" or ".h" created or when a
file is read in with "-*-c-*-" in the first line.
Modes:
Major: C
Minor: none or comment
Description:
Electric C mode. A collection of routines I've found useful when
editing C code. It is turned on when ever you edit a .c or .h file.
Helps with comments, backspacing over tabs, { and a few others.
Electric C mode is designed to help keep your C code formatted "as
you code". You don't have to remember anything special - as you type,
what you type is looked at and may trigger certain actions. This is a
minimalist C mode ment to enable you to keep your C code formatted in
a consistent manner. The only extensive help is for comments.
Characters that trigger formatting:
Enter (return): Matches the indent level of the previous line.
"{": When a "{" is pressed, one of the following will happen:
- If the space bar is pressed, "{ }" is generated and the cursor is
put between the braces.
- If Enter is pressed:
And the rest of the line is blank, you will get something like:
if (a) { or if (a)
cursor {
} cursor
}
depending on where the "{" was. The cursor is indented by
the amount specified by "indent-level".
If the rest of the line was not blank, a newline-and-indent is
done and the text after the { is indented.
For example:
if (a) foo(): if a "{ Enter" is done before the foo()
you will get:
if (a) {
foo()
- Otherwise, a "{" is inserted.
Backspace: Behaves like backspacing over spaces even when backspacing
over tabs.
Newline (control-J): Used to give some white space after a variable
declaration block. The cursor is left at the same column as the
start of the declarations.
int j; => int j;
blank line
cursor
"/": Comment assistance.
- If "*" is pressed and the rest of the line is blank and there is
text to the left of the "/", "/* */" is generated and the cursor
is put in the middle of the comment. This is for end of line
comments like: if (a) foobar(); /* comment */
- If "*" is pressed and the entire line is blank, block comment mode
is entered. In this mode, your comment will autowrap at the
comment-wrap-column. When you hit Enter or autowrap, stars are
put in the proper place, whitespace is added to match the previous
comment line. If you press Enter "/", comment mode will
terminate. "*/" or "*" blanks "/" will also terminate comment
mode. If you want to get out of comment mode without using the
above, press M-; or execute "nocomment".
Examples:
/*
* Comment
* Indented a bit
* Next line follows the indent.
*/
/*
** Another comment style
*/
- Otherwise, a "/" is inserted.
Meta-;
If in block comment mode, turn off comment mode.
If the cursor is on a line that is part of a block comment, start up
block comment mode. This is very handy for adding to an existing
block comment.
Meta-J: Format a C block comment.
If you munge a block comment and want to set it right, use this.
This formats all the lines between the dot and mark inclusive.
Put the region around the comment (or the part of the comment you
want to format) and press M-j. The comment is commented in the
format of comment mode.
Notes:
To make sure that line breaks are preserved, insert blank lines at
the breaks. The blank lines will be deleted after the comment
is formatted.
To change the indent level of the block, indent the first line of
the region to where you want.
Control-U Meta-J: Format a C boxed comment.
Same as format block comment except the comment is boxed:
/********************************
* Comment *
********************************/
You can convert between boxed and block comments by just reformatting.
Constants (in cmode.mut) that can be modified to change formatting style:
Enter-key-action
Set this to "newline-and-indent" or "newline". One of these is
called when the enter key is presses.
INDENT-LEVEL
This is the number of spaces to indent a block ie :
{
<block indent>
}
Default is 2.
COMMENT-WRAP-COLUMN
The column to word wrap at when in comment mode. The default is 76.
TAB-SIZE
How many spaces to use when tab is hit. The default is 0 which
means use hard tabs (which look like 8 spaces).
C-STARS
The number of stars to use at the left when in comment mode.
Use " *" if you use this style (1) (the default):
/*
*
*/
Use "**" if you use this style (2):
/*
**
*/
COMET
Match this with C-STARS:
Use " */" for style (1) and "*/" for style (2).
BOXED-COMMENT-SPACE
The number of blank lines before and after text in boxed comment.
Default is 1.
BOXED-COMMENT-TRAILING-BLANKS
Blanks between text and *. Default is 1.
BOXED-COMMENT-EDGE-STARS
You probably want to match this with C-STARS. Use "*" or "**".
System Variables
tab-size
This is set to the constant tab-size. You can change this with
c-mode-hook.
word-wrap
When in comment mode, word-wrap is set to the comment-wrap-column.
When comment mode ends, it is reset to 0.
Buffer Variables
"comment-offset" (number)
Functions:
(c-mode) Not bound
Turn on C mode for the current buffer.
Hooks
(c-mode-hook)
This hook is called (if it exists) after c mode has initialized
itself. With this hook you can override settings or do those few
extra things you wished c mode set up. For example, this is the
perfect place to set the tab-size to what you think it should be.
This is a program you add to your code (typically in myme.mut).
Use this hook if you don't want to modify the constants in
cmode.mut.
Customizing (usually done in c-mode-hook)
(c-mode-etc) (int indent-level comment-wrap-column) (string c-stars comet)
Call this routine to change routine stuff.
Default (done by c-mode) is
(c-mode-etc INDENT-LEVEL COMMENT-WRAP-COLUMN C-STARS COMET)
(c-mode-boxed) (int boxed-comment-space boxed-comment-trailing-blanks)
(string boxed-comment-edge-stars)
Use this to change the boxed comment style.
Default (done by c-mode) is
(c-mode-boxed BOXED-COMMENT-SPACE BOXED-COMMENT-TRAILING-BLANKS
BOXED-COMMENT-EDGE-STARS)
========================================================================
== More Help For C Programming ==
========================================================================
Package: cstuff.mut
How loaded: Manually
Description:
A few routines I didn't feel like integrating into C mode.
Functions:
(end-slide) M-`
Slide all text to the right of the cursor so that the last character
on the line is in column 78. You can use C-u<column> to override
the 78 or just change the constant in cstuff.mut. This is real
handy if have a bunch of one line comments that you want to end in
same column. For example:
switch (foo)
{
case x: /* we do this amazing thing when x */
case y: /* and doodah when y */
Just put the cursor in the white space between before the command
and press "M-`".
(c-header-with-text) Not bound
This is used to generate fancy headers that look like:
/* ********************************************************* */
/* ********************* Fancy Header ********************** */
/* ********************************************************* */
Just answer "Fancy Header" when you are asked for the header text.
========================================================================
== Mutt Mode ==
========================================================================
Package: muttmode.mut
How loaded:
Autoloaded when a buffer with extension ".mut" created or when a file
is read with "-*-mutt-*-" in the first line.
Modes:
Major: Mutt
Minor: none or comment
Description:
Electric Mutt mode.
Functions:
(mutt-mode) Not bound
Turn on Mutt mode for the current buffer.
(deref-key) F-3
Press a key, the name of the function it is bound to is inserted in
the buffer.
(pgm-completer) F-4
Use command completion to choose a Mutt or ME keyword and insert it.
(pgm-completer-in-place) ESC ESC
Complete the word the cursor is on/in. Word is assumed to be the
name of a program or a Mutt or ME keyword.
(pgm-ask-complete) ESC =
Complete the word the cursor is on/in as far as possible and then
ask for the rest of the word. Word is assumed to be the name of a
program or a Mutt or ME keyword.
Typically used when pgm-completer-in-place doesn't complete the
entire word.
(Mutt-mode-{) {
Handle "{" and "{{" according to Mutt rules.
(Mutt-comment-out-block) Not bound
Put ";" in column 1 of all lines in the region.
(Mutt-comment) M-;
(end-Mutt-comment) M-;
Toggle comment mode.
(Mutt-Enter) C-m (enter or return)
Handle enter in comment mode.
(BS-untabify) C-h (backspace)
Just like backspace but turns tabs into spaces when backing up over
them.
(format-Mutt-comment) M-j
Format a region as a Mutt comment.
(Mutt-header-with-text) Not bound
Create a header like:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; Create a Header ;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
========================================================================
== Text Browser, Hyper Link System ==
========================================================================
Package: web.mut
How loaded: Manually or by the ME help system.
Description:
A [very] small hyper-text text browser. Currently set up for ME but
could be expanded.
Functions:
(web-mode) Not bound
Browse the buffer, follow links to other topics. Press "?" for help.
(web-doc) ?
Show the commands available in web mode.
(web-select-item) C-m (enter or return)
Use the word the cursor is on as link to another topic. The link
may or may not exist.
(web-word) Not bound
Ask the user for a link to follow.
(pgm-bound-to) Not bound
Show all the keys a program is bound to.
See also: webindex.mut
========================================================================
== Text Mode ==
========================================================================
Package: textmode.mut
How loaded:
Autoloaded when a buffer with extension ".doc" or ".txt" created or
when a file is read with "-*-text-*-" in the first line.
Modes:
Major: Text
Minor: none
Description:
Text mode. Help with editing documents, etc. Does line centering,
region centering, auto word wrap, format paragraphs, mark paragraphs,
move the cursor about in a paragraph, etc.
Functions:
(text-mode) Not bound
(adjust-block) M-j
Format all lines in a block (lines between dot and mark inclusive).
Uses sysvar (word-wrap) or constant fill-column as the right margin.
(center-line) M-s
Center the text in the line that the cursor is on. With C-U, center
n lines. Uses (word-wrap) or (screen-width) as right margin.
(center-region) Not bound
Center all lines in a block.
(underline-line) Not bound
Underline a line of text. All nonspace characters are underlined
with dashes.
(forward-paragraph) M-e
Attempts to move to the end of a paragraph.
(backward-paragraph) M-a
Attempts to move to the beginning of a paragraph.
(mark-paragraph) M-h
Attempts to make the region include the paragraph the cursor is in.
Put mark at beginning of this paragraph, point at end. If between
paragraphs, mark the next one.
(cut-paragraph) Not bound
Cut to end of paragraph.
(backward-cut-paragraph) Not bound
Cut back to start of paragraph.
Constants that can be set to affect text mode.
FILL-COLUMN
This is used to set the right margin in text mode. Default is 72.
TAB-SIZE
How many spaces to use when tab is hit. The default is 0 which
means use hard tabs (which look like 8 spaces).
System Variables
tab-size
This is set to the constant TAB-SIZE. You can change this with
text-mode-hook.
word-wrap
This is set to the constant FILL-COLUMN. You can change this with
text-mode-hook.
Hooks
(text-mode-hook)
This hook is called (if it exists) after text mode has initialized
itself. With this hook you can override settings or do those few
extra things you wished text mode set up. For example, this is
the perfect place to set the tab-size to what you think it should
be.
This is a program you add to your code (typically in myme.mut).
Use this hook if you don't want to modify the constants in
textmode.mut.
Customizing (usually done in text-mode-hook)
(text-fill-column) [int fill-column]
This is only currently used if word-wrap is 0. It basically sets
the wordwrap fill-column for formatting text.
(text-fill-column) : Returns the current value of fill-column.
(text-fill-column fill-column) : Sets the fill-column to fill-column.
Notes:
You can't call this until text mode is loaded.
I'm not real sure about the use of this. Set it if you set
word-wrap to zero. I'll need to think some more on how this
should work.
========================================================================
== Mail Mode ==
========================================================================
Package: mailmode.mut
How loaded: Auto loaded or via the MEMODE environment variable
Modes:
Major: Text
Minor: Mail
Description:
A minor mode of text-mode.
A [short] set of programs that make it a bit easier to work with
electronic mail or Usenet notes.
Functions:
(mail-mode) Not bound
Turns on mail mode.
Here are two way to get mail-mode turned on automatically when you
edit mail:
set-mode (in alamode.mut) sets this mode if the environment variable
MEMODE is set to "mail". In my .profile, I have:
EDITOR=$HOME/bin/me3
MAILER=mailx
In .kshrc:
alias mail="MEMODE=mail $MAILER"
Thus, whenever I type "mail" and get into the editor, I get ME in
mail-mode.
Another (better) way to do this is to note the name the mailer uses
for temporary files (the ones it uses to hold the mail you are
editing). I use mailx and the form is: "/tmp/Re<digits>". So,
to get mail-mode when editing mail, add
(auto-mode-list TRUE
'Re[0-9]+$' "mail" ;; mailx: "/tmp/Re<digits>"
)
to your startup file (myme.mut).
(mail-format-quote-region) M-` (meta backquote)
Format a region-block (all lines in region) and put a prefix
(default is "> ") in front of each line. With arg (C-u), askes
what to use as a prefix.
This is very handy when want to reply to something that was sent to
you. You can cut out the relevant chunk and have it formatted
nicely. If you are replying to several people in the same
letter, use the arg option - this allows you to prefix everything
Peter says with something like "Peter> " so that everybody
receiving your mail will know who said what. You can change the
default by changing "quoter" in mailmode.mut.
(mail-quote-region) Not bound
Put the prefix in front of every line in the region. No formatting.
Constants:
quoter : The default string that is used when quoting text.
Initially "> ".
========================================================================
== Picture Mode ==
========================================================================
Package: picture.mut
How loaded: Auto loaded in me3.mut
Description:
GNU Emacs Picture mode. This mode is used to edit tables, text
pictures, etc. Well documented in picture.mut or use the GNU Emacs
manual.
I've added a picture function that I find useful: picture-box.
Note: My port is something of a quick hack. I didn't implement
rectangle registers (I put everything into the cut buffer). I don't
use picture mode all that much and so haven't really beat on it.
In my limited testing, everything seems to work but I'm sure there
some things I missed.
Functions:
(edit-picture) Not bound Autoloaded
(picture-box) Not bound
Draw a box around the rectangle region.
========================================================================
== Buffer Menu Mode ==
========================================================================
Package: buf-menu.mut
How loaded: Auto loaded in me3.mut
Description:
GNU Emacs buffer mode. This mode allows you to manipulate buffer in
the list-buffers window.
Functions:
(buffer-menu) C-uC-xC-b Autoloaded
Turns on Buffer Menu mode for the list-buffers buffer.
(Buffer-menu-doc) "?"
Display documentation about buffer menu mode.
========================================================================
== Directory Stack ==
========================================================================
Package: dir.mut
How loaded: Auto loaded in me3.mut.
Description:
Directory stack ala c-shell (UNIX only). The stack size is fixed but
can be easily changed in dir.mut.
Functions:
(cd) Auto Loaded
Change the current directory.
(dirs) Not auto loaded
Show the contents of the directory stack in a popup menu. The top
entry is the current directory, next is the directory you left to
get to the current directory. Press return to move to the current
directory (ie do nothing) or move the ">" cursor to the directory
you want to move to and hit return.
(pwd) Auto Loaded
Show the current directory.
(pu) Auto Loaded
Change the current directory, using the stack to save the changes.
(pu directory) pushes the current directory on the stack and sets
the current directory to directory.
(pu "") swaps the top 2 entries on the stack.
(pu "+n") swaps the top of the stack with the nth stack item. n
starts at zero.
(pu "+") runs (dirs) to give you a popup menu to select a stack
entry from.
(po) Not auto loaded
Discards the top entry on the stack and sets the current directory
to the new top of stack.
========================================================================
== Search [and Replace] Across Files ==
========================================================================
Package: findit.mut
How loaded: Autoloaded in me3.mut
Description:
Uses grep to search for a string in many files. Once all the files
are found, the first file is visited and the string is looked for
with incremental search. You can continue the search, edit or do
anything you want. Once you are finished, use C-xC-n to visit the
next file containing the string.
With arg (C-u), do a search and replace across a bunch of files. In
other aspects, acts the same as search.
Functions:
(findit) Not bound
Search for a string. Use C-u for search and replace.
(showit) C-xC-n
Goto the next file containing the string.
========================================================================
== Gomoku Game ==
========================================================================
Package: gomoku.mut
How loaded: Manually
Description:
GNU Emacs Gomoku is a game played between two players (one of which is
ME) on a rectangular board. Each player, in turn, marks a free
square of its choice. The winner is the first one to mark five
contiguous squares in any direction (horizontally, vertically or
diagonally).
For more info, "use the source, Luke".
Functions:
(gomoku) Not bound
========================================================================
== Hide Buffers ==
========================================================================
Package: hidebuf.mut
How loaded: part of me3.mut
Description:
Implements a "soft" buffer hidden bit. Buffers can be put aside for a
little while and restored later. I use this as a kind of workspace
manager - when I go off on a tangent, I can hide the files I'm working
on and when I've finished, unhide the files and pick up where I left
off. Hiding files gets them out of the way of your current work.
Functions:
(next-buffer) F-2
Find the next unhidden buffer and make it the current one. Next
means alphabetically. With this routine, you can just bang on
function key 2 to move though all the buffers.
(prev-buffer) Not bound
Find the previous unhidden buffer and make it the current one.
(hide-buffer) M-h
Hide the current buffer.
(unhide-buffer) Not bound
Unhide a buffer by name.
(unhide-buffers) Not bound
Unhide all buffers.
========================================================================
== Hook Support ==
========================================================================
Package: hook.mut
How loaded: part of me3.mut.
Description:
Provides support for the hooks that ME calls: create-buffer-hook,
clear-buffer-hook, command-line-hook, free-buffer-hook, idle-hook,
read-file-hook, enter-me-hook, leave-ME-hook, process-hook,
stop-ME-hook.
In addition, it creates hooks of its own for interactive buffers:
Iclear-buffer-hook, Icreate-buffer-hook, Ifree-buffer-hook,
Iread-file-hook.
The interactive hooks are called for buffers that have the Interactive
bit set. See buffer-flags in me3mutt.doc of some more info.
If you program uses a hook, it should register the hook (probably in a
MAIN routine). In this way, many programs can share hooks with a
minimum of fuss.
I don't support two hooks:
- modeline-hook : Needs to be handled differently. See modeline.mut.
- key-pressed-hook : Slows things down too much. Your on your own.
Functions:
(register-hook) Not bound
(register-hook hook-id name-of-routine-to-call)
Get the hook-id out of me.mh. name-of-routine-to-call is string.
Must not be HIDDEN.
(unregister-hook) Not bound
(unregister-hook hook-id name-of-routine-to-call) Not bound
Remove a hook from the hook list. The args are the same as
register-hook. Returns TRUE if the hook was removed, FALSE is the
hook could not be found.
Currently, only IDLE-HOOK is supported.
See also: The hook section of me3mutt.doc
========================================================================
== External Processes ==
========================================================================
These two packages use the compute server. See me3mutt.doc and
comserver.doc for more info on what it does and how to run it.
To run the compute server, use "comserver $HOME/.ME2.socket".
Since the compute server is quite verbose, you will want to run it in
its own window. If that is not possible (or desirable), use this
command: "comserver $HOME/.ME2.socket >/dev/null 2>/dev/null &".
Package: compile.mut
How loaded: compile and grep are autoloaded in me3.mut
Description:
Run a compile, grep or just about any output only process (such as
"ls" or "cc"), collect the output and optionally visit each line in
each file that is flagged.
Output is collected as the compile sends it out - you can still edit
normally. This a "multiprocessing" compile - many things are going
on at once. Note that ME only processes the compile output when
nothing else is happening - if a Mutt program is running or ME is
waiting for you (eg waiting for you to answer a question in the
minibuffer), compile output is queued and will be processed when
things are quiet again. The *Compile* window can be removed from
the screen without affecting things. DON'T delete the *Compile*
buffer (until to compile is done and you don't care about the
output).
Modeled after grep and compile in GNU Emacs.
This stuff only works on machines running unix (at least until
somebody ports the compute server to other OSes).
The compute server must be running. It is what actually runs the
compiles - ME just processes the output. See create-process in
me3mutt.doc for how to run the compute server.
Functions:
(compile) Not bound Autoloaded
Run a command, in a shell and put the output in the *Compile*
buffer. You can run things like make, "cc -o foo foo.c", ls or
just about anything that is output only (can't send input to the
remote processes). Since the command is run in a shell (sh), you
can use things like $HOME, *.c, etc.
Use compile-next-error to step through the errors.
(grep) Not bound Autoloaded
Run grep, collect the output and use compile-next-error to step
through the matches.
(stop-compile) Not bound
Stop the process running in the *Compile* buffer.
(compile-next-error) C-x` (control-X backquote)
Looks in the *Compile* buffer, makes a list of errors (or grep
matches), visits the file(s) with the error(s) and puts the cursor
at the bogus line. Each time you press C-X`, the cursor moves to
the next error. You can edit as much as you like at each error.
You can start using C-X` before the compile is done (it is
possible for the error list to get out of sync if you change a
file before the compiler is done with it but that should be a
minor problem).
Knows how to parse the output of: mc2, grep, HP-UX 8.0 cc, Apollo
cc and hopefully other compilers. I tried to match what GNU Emacs
does but working with regular expressions can be a real pain in
the butt so there might be some bugs in here. Apollo cc is a real
pain.
Doesn't know about ld: If you have loader errors, you won't see
them if you remove the *Compile* window or shrink it so you can't
read all of it. I usually just look at the *Compile* buffer to
make sure all went as expected.
Hooks
process-hook is used to capture the output of the compile or grep.
========================================================================
== Tags ==
========================================================================
Package: tags.mut
How loaded: manually
Description:
Tags are a small database for C functions. Have you ever edited some
C code and come across a function and say to yourself "I wonder
where this function is?", well, tags can help answer that for you.
Tags uses the Unix ctags command.
To start things, create the tags database:
In the current directory: "ctags -xtw files.[ch] >Tags"
In a subtree: "find . -name '*.[ch]' -print | xargs ctags -xtw >Tags"
Keep the tags file in the directory it is created in.
When the tags code is loaded, it will ask you what directory the tags
file is in. If you are not going to be changing directories, you
can use ".". If you might, give the full path name for the
directory (file name completion is on). Remember to only give the
directory name.
Functions:
(goto-tag) M-.
Look up a keyword in the tags data base, visit the file it is
defined in and put the dot at the start of the routine.
If just hit return when asked for the tag, the word after the dot is
used. This is nice for things like:
foobar(fred,sam);
^ dot
Hit M-. <enter> and you will in the file that foobar is defined
in.
(select-tag-file) Not bound
Load the tags database. See above. If you want to change to a new
database, just run this again.
(where-is-tag) Not bound
Shows the file that the tag is defined in. As in goto-tag but just
tells you the file instead of editing it.
========================================================================
== OS Stuff ==
========================================================================
Package: unix.mut
How loaded:
Compiled and then unix.mco is renamed to osstuff.mco. osstuff.mco is
loaded by me3.mut.
Description:
osstuff is a file that is loaded so you have a place to put all your
OS specific code. When you use ME on a variety of machines, this is
very handy.
Functions (unix.mut):
(chmod) Not bound
Runs change mode on the file connected to the current buffer. Real
handy when you check out a file, read it in, edit it and when you
try to save you find out it is read-only. ick. Just run chmod and
enter "a+w" and then save it.
Some stuff to try and figure out the terminal type.
========================================================================
== VT100 Type Terminals ==
========================================================================
Package: xterm.mut
How loaded:
In unix.mut. The environment variable "TERM" is looked at to try and
figure out if this file should be loaded.
Description:
Some terminals support function keys, arrow keys, etc. This file adds
some support for xterm, vt100 and ansi style terminals.
Decodes arrow keys and function keys (those keys that send out "Escape
[ ...").
========================================================================
== HP Terminal Support ==
========================================================================
Package: hpterm.mut
How loaded:
In unix.mut. The environment variable "TERM" is looked at to try and
figure out if this file should be loaded.
Description:
Try and sent up a HP terminal so ME can understand it when you press a
function or arrow key. HP terminals make life difficult for Emacs
because the function keys send out text that is the same as other
Emacs commands. It can be very hard to tell if you pressed down arrow
or M-b (which do two very different things).
In order for this stuff to work, you must be using a version of ME
that knows about HP terminals. You can turn this on in config.h.