[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

15. Searching Through Messages

Earlier, the command F s (mh-search) was introduced which helps you find messages that lie buried in your folders (voir la section Organizing Your Mail with Folders). This chapter covers this command in more detail. Several commands are used to compose the search criteria and to start searching. A couple of them can be found in the ‘Search’ menu.

C-c ?

Display cheat sheet for the MH-E commands (mh-help).

C-c C-c

Find messages using mh-search-program (mh-index-do-search).

C-c C-p

Find messages using pick (mh-pick-do-search).

C-c ?

Display cheat sheet for the MH-E commands (mh-help).

C-c C-f a
C-c C-f C-a

Move to ‘Mail-Reply-To:’ header field (mh-to-field).

C-c C-f b
C-c C-f C-b

Move to ‘Bcc:’ header field (mh-to-field).

C-c C-f c
C-c C-f C-c

Move to ‘Cc:’ header field (mh-to-field).

C-c C-f d
C-c C-f C-d

Move to ‘Dcc:’ header field (mh-to-field).

C-c C-f f
C-c C-f C-f

Move to ‘Fcc:’ header field (mh-to-field).

C-c C-f l
C-c C-f C-l

Move to ‘Mail-Followup-To:’ header field (mh-to-field).

C-c C-f m
C-c C-f C-m

Move to ‘From:’ header field (mh-to-field).

C-c C-f r
C-c C-f C-r

Move to ‘Reply-To:’ header field (mh-to-field).

C-c C-f s
C-c C-f C-s

Move to ‘Subject:’ header field (mh-to-field).

C-c C-f t
C-c C-f C-t

Move to ‘To:’ header field (mh-to-field).

Another few commands are available in the MH-Folder buffer resulting from a search.

<TAB>

Jump to the next folder marker (mh-index-next-folder).

S-<TAB>

Jump to the previous folder marker (mh-index-previous-folder).

v

Visit original folder from where the message at point was found (mh-index-visit-folder).

There is one option from the ‘mh-search’ customization group used in searching.

mh-search-program

Search program that MH-E shall use (default: ‘Auto-detect’).

The following hook is available.

mh-search-mode-hook

Hook run upon entry to mh-search-mode (default: nil).

The following face is available.

mh-search-folder

Folder heading face in MH-Folder buffers created by searches.

The command F s (mh-search-folder) 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.

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








--:**  search-pattern   All L7     (MH-Search)---------------------------
Type C-c C-c to search messages, C-c C-p to use pick, C-c ? for help

Search window

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 C-t (mh-to-field) to help you fill in the blanks. Voir la section Editing the Message.

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 (mh-index-do-search). 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 (mh-pick-do-search).

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> (mh-index-next-folder) and S-<TAB> (mh-index-previous-folder).

In addition, the command v (mh-index-visit-folder) 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 mh-rescan-folder. Voir la section Organizing Your Mail with Folders.

Because this folder is temporary, you'll probably get in the habit of killing it when you're done with F k (mh-kill-folder). Voir la section Organizing Your Mail with Folders.

You can regenerate the results by running F s with a prefix argument.

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"

Voir la section Limiting Display, for an alternative interface to searching.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 27 Octobre 2007 en utilisant texi2html 1.78.