Over a month ago, SL Baur <steve(a)vmailer.xemacs.org> wrote:
mh-e in XEmacs is Chuck's baby. These changes are O.K. with me,
but I
gave up on mh-e long, long ago.
[ Chuck's been sent a separate message regarding this. ]
It would be most useful if the glimpse code is as modular as
possible
so it can be used with Gnus nnml. That's pretty much the last feature
in exmh not in Gnus I miss.
Well, I made the glimpse code "modular", but the interface is one
straight from hell: while the main search function has only three
required parameters, there are fourteen (!) optional ones. Yuk. This
is one time I wish elisp had keywords in function parameters (note: I am
not, *not*, *NOT* advocating that we replace elisp with CL).
Anyhow, a copy of my mangled mh-e is now available from the NMH web
page (see the link, "extended mh-e", near the bottom):
http://www.math.gatech.edu/nmh/
I didn't find the time to clean it up much, but I did write a long
README file. It's appended to the end of this message.
Side note: there's a typo in the README that says certain features work
only with GNU Emacs. It's the other way around: certain features work
only with XEmacs. ;-(
Consider this package to be experimental. It's not to go into
XEmacs until I get some feedback. Also, I may (or may not) do some code
cleanup, as a lot of code was written a long time ago, before defadvice
was widely available.
-- Darryl Okahata
Internet: darrylo(a)sr.hp.com
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion, or policy of Hewlett-Packard, or of the
little green men that have been following him all day.
===============================================================================
Unofficial mh-e 5.0.2.1
Wed Jul 22, 1998
IMPORTANT: This is an unofficial release of mh-e 5.0.2. In particular,
it is not sanctioned by the mh-e maintainer. It would be nice if these
changes could be merged back into the official version, but the
maintainer has been (justifiably) unable to do so, because I've been
unable to find the time to get the legal paperwork done. As a result,
I'm releasing what I currently have, in the hope that someone finds this
useful. (Side note: at the request of the mh-e maintainer, I've
prefixed new functions with "y-mh-" instead of "mh-".)
Changes in this release include:
* Significant performance improvements by intelligent caching of folder
contents (scans).
* Automatic generation of folder names when refiling messages, based
upon email addresses. For example, messages from "jdoe(a)foo.bar.com"
get a default folder name of "jdoe". Optional elisp functions can be
written to return default folder names, if the existing features are
insufficient. [ Other people have written similar features for mh-e,
but I believe my version has been around the longest, although poorly
publicized. ]
* Automatic alias completion, based upon MH aliases, sendmail aliases,
and /etc/passwd. When entering email addresses at the "To:" prompt,
the TAB key can be used to do email address completion. [ Other
people have written similar features for mh-e, but I believe my
version has been around the longest, although poorly publicized. ]
* (Optional) Automatic email address harvesting, for automatic email
alias generation. Whenever a message is viewed, the sender's
name/address can be automatically added to an internal database. The
name/address is then available for alias completion. Harvesting can
be done upon all folders, selected folders, or all folders but
specified ones. Inspired by exmh (but, for some inexplicable reason,
exmh doesn't make the address easily accessible for use in specifying
"To:" & "cc:" addresses).
NOTE: this particular feature only works with XEmacs. It will not
work with GNU Emacs.
[ Note: I'm obsoleting this capability, in favor of BBDB (see
http://pw2.netcom.com/~simmonmt/bbdb/index.html). In particular,
BBDB works with both XEmacs and GNU Emacs. Future releases (if any)
will probably keep this code, but no new development will be done.
BBDB does not yet work well with this package, but this will be
fixed. ]
* (Optional) Glimpse interface to index and search mail folders. The
database scheme used is compatible with that used by exmh, so both
exmh and this version of mh-e can share the same glimpse database.
* Update mode line to turn off the "new mail" icon after doing an
"inc".
* Optional ability to visit new MH folders in new frames. Visiting an
existing, but iconified, MH folder causes the frame to be
un-iconified.
* Optional ability to quit mh-e by iconifying the mh-e frame, instead of
killing the mh-e buffers.
* Enhanced signature file processing. An optional elisp function can be
specified to return a signature. This is useful for writing a
function that scans the draft to determine an appropriate signature.
* A crude pull-down menu has been added to mh-folder buffers. It's a
work-in-progress, and it really needs to be cleaned up. Nonetheless,
it's still quite useful.
INSTALLATION
This version should work fine with the latest versions of both
XEmacs and GNU Emacs. However, the automatic address harvesting feature
will only work under GNU Emacs (which is one reason why this feature is
being obsoleted in favor of BBDB).
Installation instructions:
* Extract these files into a convenient directory (it's strongly
recommended that you put these files into a directory of their own,
and not overwrite any existing files). Then, in your ~/.emacs, add
this directory to the beginning of `load-path', like:
(setq load-path (cons "/some/path/mh-e" load-path))
(assuming that you put these files into the directory
"/some/path/mh-e".)
* If you are using XEmacs and want to enable the automatic address
harvesting feature, add the following line to your ~/.emacs:
(require 'mh-address)
(See, "Automatic Address Harvesting", below, for more instructions.)
* If you have glimpse, you can enable glimpse support by adding the
line:
(require 'glimpse-mh-e)
(See, "Glimpse Interface", below, for more instructions.)
* See the section on "Other Notes", below, for miscellaneous
information.
* Restart Emacs and use mh-e normally.
AUTOMATIC ADDRESS HARVESTING
Whenever you read a message, it's possible for mh-e to
automatically harvest the sender's name and email address and add it to
a database. When composing a message, you then have easy access to this
database (e.g., for address completion). Hooks also exist to limit
harvesting.
Addresses used for harvesting are taken from the "Reply-To:"
header; if that doesn't exist, then "From:" is used. Hopefully, a name
will be found along with the email address, as in the cases of:
John Doe <jdoe(a)foo.bar.com>
jdoe(a)foo.bar.com (John Doe)
If a name is found, that name is used to create an email alias, and the
address is accessed via this alias name. If a name is not found, an
alias name is constructed from the address. Here are some examples:
Address Alias
----------------------------------------------------------------------
"John Doe" <jdoe(a)foo.bar.com> John_Doe
"JOHN DOE" <jdoe(a)foo.bar.com> John_Doe
"JOHN DOE" <jdoe(a)foo.bar.com> John_Doe
"DOE, JOHN" <jdoe(a)foo.bar.com> Doe_John
JOHNDOE <jdoe(a)foo.bar.com> Johndoe
jdoe(a)foo.bar.com (John Doe) John_Doe
jdoe(a)foo.bar.com (Doe, John) Doe_John
jdoe(a)foo.bar.com Jdoe
Note that harvested addresses are accessed by the alias.
The optional address harvesting feature, which only works in
XEmacs, is enabled by adding the following line to ~/.emacs:
(require 'mh-address)
By default, harvested addresses are stored in the file,
".mh-e-address-book", in the MH mail directory. As most people have
~/Mail as their MH mail directory, harvested addresses will be stored
in:
~/Mail/.mh-e-address-book
Harvested addresses are saved when you quit a folder.
Comments:
* You can exclude all messages in certain folders from being used for
address harvesting via the variable,
`y-mh-scan-address-folders-exclude'. See the variable documentation
for details.
* You can limit address harvesting to selected folders via the variable,
`y-mh-scan-address-folders-include'.
* You can exclude certain addresses from being added to the database via
the variable, `y-mh-suppress-address'.
* You can exclude addresses by name via the variable,
`y-mh-suppress-names'. This works only for those messages whose
sender has a name with their email address, like:
John Doe <jdoe(a)foo.bar.com>
jdoe(a)foo.bar.com (John Doe)
GLIMPSE INTERFACE
[ Tested only with glimpse 3.6. Unknown if 4.X works. ]
The optional glimpse interface is enabled by adding the following
line to your ~/.emacs file:
(require 'glimpse-mh-e)
The glimpse database is compatible with that used by exmh, which is
where the inspiration for this originated. You can then use the
following functions to search your MH folders (unfortunately, they're
not yet bound to any key sequences):
glimpse-mh-search
glimpse-mh-search-verbose
The function, `glimpse-mh-search-verbose' is like, `glimpse-mh-search',
except that `glimpse-mh-search-verbose' will also ask you if you want to
match whole words (always "yes", for `glimpse-mh-search') and the number
of allowed errors per word (always zero, for `glimpse-mh-search').
IMPORTANT: Note that there is no user interface for indexing file
folders. Before you can use glimpse to search your MH folders, you must
first create a glimpse database. Note that you may need lots of disk
space, as the glimpse indices can be as large as 10% or more of the
folder sizes. For convenient, some scripts are included to assist with
creating the glimpse databases:
indexer
This is a Bourne shell script that can be used to create
the glimpse database. The list of folders to index is
taken from the ".folders" file in the MH mail directory
(in other words, typically "~/Mail/.folders"). This
file will be created if it doesn't exist. You can run
this script from any directory.
Note that the MH "folders" command is not used to
generate the list of folders; this is done because some
people have more than the (default) maximum 300 folders
(in MH 6.8), and not everyone uses nmh. To force the
rebuilding of the ".folders" file, use the command
"indexer -F".
This script will always rebuild the glimpse index for a
given folder, even though the folder contents may not
have changed. As a result, this script can be slow.
indexer.pl
This is a perl 4 script (for maximum compatiblity) that
does everything that the Bourne shell script does, plus
much more. If you can use this script, use it instead
of the Bourne shell one.
This script will, unlike the Bourne shell one, only
index those folders that have changed. It will also
output status lines for each folder similar to those
output by the exmh glimpse indexer.
Like the Bourne shell script, this folder creates and
uses a ".folders" file.
To force the rebuilding of the ".folders" file, use the
"-F" option. Note that this will also force the
rebuilding of all glimpse indices, regardless of whether
or not a folder has changed.
The glimpse databases will be placed in a ".glimpse" directory in the MH
mail directory (in other words, typically "~/Mail/.glimpse"); note that
a separate directory will be created below this point for each folder.
Comments:
* You must (manually) build a glimpse database (using one of the
supplied scripts, for example) before you can do a glimpse search.
* As searching is done, the search progress is displayed in the modeline
(the current folder being searched is displayed in the modeline). If
you have lots of small folders, the amount of time it takes to update
the modeline may become the limiting factor in the search time. You
can control how the search progress is displayed via the variable,
`glimpse-mh-display-search-progress'.
* See the variable, `glimpse-mh-search-limits', for the default limits
on the number of displayed matches.
* Under XEmacs, in the glimpse results buffer, you can use button-2 on
the mouse to select a message for display. Clicking on a message name
(it'll highlight as you move the mouse over it) will cause the folder
and message to be displayed. Alternatively, you can move the cursor
over the message name and press [Return].
OTHER NOTES
The 'TAB' key is used to do alias completion whenever you are
prompted for an address. For the case where you have multiple
possible completions, but the address you've entered so far is the one
you want to use, press C-u before TAB; this will cause the alias for the
current address to be used, regardless of whether or not additional
expansions are possible.
Here is a list of some useful configuration variables. Note that
this list is not complete. Hopefully, their purpose can be inferred
from their name. See the variable documentation for details:
y-mh-quit-by-iconifying
y-mh-visit-new-folder-in-new-frame
y-mh-signature-func
y-mh-always-flush-changes
A variable controlling automatic default folder name when refiling:
y-mh-auto-folder-alist
Some variables controlling alias expansion:
y-mh-read-aliases-from-passwd
y-mh-alias-fully-expand-aliase
y-mh-use-system-aliases
Use the optional 'tm' package to handle MIME (tm is not included in
this release). It works well with this one. However, note that alias
completion will not work when forwarding messages, if tm is used.
KNOWN PROBLEMS
* Messages are always marked read-only. The original mh-e 5.0.2 allowed
you to edit and save messages.
* Pressing "e" or "x" (mh-execute-commands) in an mh-folder buffer
that
has no pending changes will make the message under the cursor be the
current message, but the previously current message will not be
unmarked (this will be seen when you pack/rescan the folder).
* Texinfo documentation has not been updated. This file is all there
is.
* If you use 'tm', alias expansion does not work when forwarding a
message. However, expansions will again work once you enter the draft
buffer.