mh-search

mh-search is an interactive autoloaded Lisp function in `mh-search.el'.


(mh-search FOLDER SEARCH-REGEXP &optional REDO-SEARCH-FLAG WINDOW-CONFIG)

Search your MH mail.

This command helps you find messages in your entire corpus of
mail. You can search for messages to or from a particular person
or about a particular subject. In fact, you can also search for
messages containing selected strings in any arbitrary header
field or any string found within the messages.

Out of the box, MH-E uses "pick" to find messages. With a
little extra effort, you can set an indexing program which
rewards you with extremely quick results. The drawback is that
sometimes the index does not contain the words you're looking
for. You can still use "pick" in these situations.

You are prompted for the FOLDER to search. This can be "all" to
search all folders. Note that the search works recursively on the
listed folder.

Next, an MH-Search buffer appears where you can enter search
criteria SEARCH-REGEXP.

From:
To:
Cc:
Date:
Subject:
--------

Edit this template by entering your search criteria in an
appropriate header field that is already there, or create a new
field yourself. If the string you're looking for could be
anywhere in a message, then place the string underneath the row
of dashes.

As an example, let's say that we want to find messages from
Ginnean about horseback riding in the Kosciusko National
Park (Australia) during January, 1994. Normally we would start
with a broad search and narrow it down if necessary to produce a
manageable amount of data, but we'll cut to the chase and create
a fairly restrictive set of criteria as follows:

From: ginnean
To:
Cc:
Date: Jan 1994
Subject:
--------
horse
kosciusko

As with MH-Letter mode, MH-Search provides commands like
C-c C-f t to help you fill in the blanks.

If you find that you do the same thing over and over when editing
the search template, you may wish to bind some shortcuts to keys.
This can be done with the variable `mh-search-mode-hook', which is
called when F s is run on a new pattern.

To perform the search, type C-c C-c.

Sometimes you're searching for text that is either not indexed,
or hasn't been indexed yet. In this case you can override the
default method with the pick method by running the command
C-c C-p.

The messages that are found are put in a temporary sub-folder of
"+mhe-index" and are displayed in an MH-Folder buffer. This
buffer is special because it displays messages from multiple
folders; each set of messages from a given folder has a heading
with the folder name.

The appearance of the heading can be modified by customizing the
face `mh-search-folder'. You can jump back and forth between the
headings using the commands TAB and
C-M-i.

In addition, the command v can be used to
visit the folder of the message at point. Initially, only the
messages that matched the search criteria are displayed in the
folder. While the temporary buffer has its own set of message
numbers, the actual messages numbers are shown in the visited
folder. Thus, the command v is useful to
find the actual message number of an interesting message, or to
view surrounding messages with the command F r.

Because this folder is temporary, you'll probably get in the
habit of killing it when you're done with F k.

You can regenerate the results by running this command with a
prefix argument REDO-SEARCH-FLAG.

Note: This command uses an "X-MHE-Checksum:" header field to
cache the MD5 checksum of a message. This means that if an
incoming message already contains an "X-MHE-Checksum:" field,
that message might not be found by this command. The following
"procmail" recipe avoids this problem by renaming the existing
header field:

:0 wf
| formail -R "X-MHE-Checksum" "X-Old-MHE-Checksum"

Configuring Indexed Searches

The command F s runs the command defined by the option
`mh-search-program'. The default value is "Auto-detect" which
means that MH-E will automatically choose one of "swish++",
"swish-e", "mairix", "namazu", "pick" and "grep" in
that order. If, for example, you have both "swish++" and
"mairix" installed and you want to use "mairix", then you can
set this option to "mairix".

The documentation for the following commands describe how to set
up the various indexing programs to use with MH-E.

- `mh-swish++-execute-search'
- `mh-swish-execute-search'
- `mh-mairix-execute-search'
- `mh-namazu-execute-search'
- `mh-pick-execute-search'
- `mh-grep-execute-search'

In a program, if FOLDER is "+" or nil, then mail in all folders
are searched. Optional argument WINDOW-CONFIG stores the window
configuration that will be restored after the user quits the
folder containing the index search results.