# Selecting Multiple Messages
by Brent Welch

There are several message operations that can operate on multiple messages, including `Forward` and `Delete,` which are described in the Sections Forwarding Messages and Deleting Messages. exmh supports two different ways to select multiple messages. You can use the mouse to select multiple messages, or you can select messages based on their content.

## Using the Mouse

To select multiple messages with the mouse, position the cursor at one end of a range in the table of contents, press and hold the first mouse button, and drag the cursor to the other end of the range. This selects a contiguous range of messages. You can add more messages to an existing selection by holding down the Shift key as you drag the mouse. You can add an individual message by holding down the Shift key as you click on the message. exmh lets you create a noncontiguous selection this way. If you Shift-click on a message that is already selected, then it becomes unselected. If you need to select a lot of messages, simply drag the mouse off the top or bottom of the window. The display scrolls automatically and the selection is extended.

## Searching with Pick

The MH pick program can find messages based on their content, which is a powerful way to look through lots of mail. pick understands message header fields and date formats, and it lets you build up complex Boolean search expressions. exmh provides an interface to pick, and it selects the messages in the table of contents based on the results of the pick command.

Click the `Pick` button in the group of folder operation buttons. The dialog shown in The Figure below appears. Position this window where you want by using your window manager; exmh will remember its location for you.

Figure: The Pick dialog

The dialog contains entries for the `Subject:`, `From:`, `To:`, and `Cc:` header fields. If you leave any of these blank, the field is ignored. In the example figure, the subject is filled in with "windowing," so pick will search for all messages with the word "windowing" in their `Subject:` field.

The `Before` and `After` fields are date fields. You can find all messages before or after a given date by using these fields. Specify dates using the `mm/dd/yy` (month/date/year) format. Be sure to include the year. Dates can also be keywords like "today", "yesterday", "tomorrow", or any day of the week ("Sunday", "Monday", and so on).

The `Search` field is used to search over the body of your messages. This search method runs more slowly because pick must read through all of your messages, not just their headers.

If you fill in more than one field, pick finds messages that match all the criteria. In other words, it does the logical and of the search criteria. If you want to search for this or that, then click the Or button in the dialog. This adds another set of fields to the dialog, and pick will search for everthing that matches the first set or matches the second set.

The messages found by pick are selected in the table of contents. By default, the previous selection is cleared. If you choose the `Add to sel` checkbutton first, then the existing selection is preserved and the messages found by pick are added to the selection.

Once you have selected a set of messages, either by pick or with the mouse, you can shrink the table of contents so it only contains the selected messages. Click the `New FTOC` button in the `Pick` interface to do this. The advantage of doing this is that `Next` and `Prev` move you through this limited table of contents so you can easily browse the selected messages. The drawback of `New FTOC` is that a subsequent pick only finds messages in the reduced table of contents, not the whole folder. You have to select `Rescan folder` from the folder `More...` menu to restore the complete table of contents.

## Fast Search

Because pick can be slow, exmh also implements fast searching over the current folder listing and current message body. If you click the `Find` button in the folder buttons, a small search dialog appears. Click the `FTOC` radio button to search over the table of contents, or click the `Msg` radio button to search over the message body. The search is case insensitive, which means that lowercase letters in the search pattern match uppercase letters, too. Uppercase letters in the pattern only match uppercase.

The fast search over the table of contents is quite limited in comparison to pick. It finds only things that are displayed in the window, and it selects only one message at a time. However, it is generally faster than pick.