29.11. Summaries

A summary is a buffer containing one line per message to give you an overview of the mail in an Rmail file. Each line shows the message number, the sender, the labels, and the subject. Almost all Rmail commands are valid in the summary buffer also; these apply to the message described by the current line of the summary. Moving point in the summary buffer selects messages as you move to their summary lines.

A summary buffer applies to a single Rmail file only; if you are editing multiple Rmail files, each one can have its own summary buffer. The summary buffer name is made by appending -summary to the Rmail buffer's name. Normally only one summary buffer is displayed at a time.

29.11.1. Making Summaries

Here are the commands to create a summary for the current Rmail file. Once the Rmail file has a summary buffer, changes in the Rmail file (such as deleting or expunging messages, and getting new mail) automatically update the summary.

h, C-M-h

Summarize all messages (rmail-summary).

l labels RET, C-M-l labels RET

Summarize messages that have one or more of the specified labels (rmail-summary-by-labels).

C-M-r rcpts RET

Summarize messages that have one or more of the specified recipients (rmail-summary-by-recipients).

C-M-t topic RET

Summarize messages that have a match for the specified regexp topic in their subjects (rmail-summary-by-topic).

The h or C-M-h (rmail-summary) command fills the summary buffer for the current Rmail file with a summary of all the messages in the file. It then displays and selects the summary buffer in another window.

C-M-l labels RET (rmail-summary-by-labels) makes a partial summary mentioning only the messages that have one or more of the labels labels. labels should contain label names separated by commas.

C-M-r rcpts RET (rmail-summary-by-recipients) makes a partial summary mentioning only the messages that have one or more of the recipients rcpts. rcpts should contain mailing addresses separated by commas.

C-M-t topic RET (rmail-summary-by-topic) makes a partial summary mentioning only the messages whose subjects have a match for the regular expression topic.

Note that there is only one summary buffer for any Rmail file; making one kind of summary discards any previously made summary.

The variable rmail-summary-window-size says how many lines to use for the summary window. The variable rmail-summary-line-count-flag controls whether the summary line for a message should include the line count of the message.

29.11.2. Editing in Summaries

You can use the Rmail summary buffer to do almost anything you can do in the Rmail buffer itself. In fact, once you have a summary buffer, there's no need to switch back to the Rmail buffer.

You can select and display various messages in the Rmail buffer, from the summary buffer, just by moving point in the summary buffer to different lines. It doesn't matter what Emacs command you use to move point; whichever line point is on at the end of the command, that message is selected in the Rmail buffer.

Almost all Rmail commands work in the summary buffer as well as in the Rmail buffer. Thus, d in the summary buffer deletes the current message, u undeletes, and x expunges. o and C-o output the current message to a file; r starts a reply to it. You can scroll the current message while remaining in the summary buffer using SPC and DEL.

The Rmail commands to move between messages also work in the summary buffer, but with a twist: they move through the set of messages included in the summary. They also ensure the Rmail buffer appears on the screen (unlike cursor motion commands, which update the contents of the Rmail buffer but don't display it in a window unless it already appears). Here is a list of these commands:

n

Move to next line, skipping lines saying `deleted', and select its message.

p

Move to previous line, skipping lines saying `deleted', and select its message.

M-n

Move to next line and select its message.

M-p

Move to previous line and select its message.

>

Move to the last line, and select its message.

<

Move to the first line, and select its message.

M-s pattern RET

Search through messages for pattern starting with the current message; select the message found, and move point in the summary buffer to that message's line.

Deletion, undeletion, and getting new mail, and even selection of a different message all update the summary buffer when you do them in the Rmail buffer. If the variable rmail-redisplay-summary is non-nil, these actions also bring the summary buffer back onto the screen.

When you are finished using the summary, type Q (rmail-summary-wipe) to delete the summary buffer's window. You can also exit Rmail while in the summary: q (rmail-summary-quit) deletes the summary window, then exits from Rmail by saving the Rmail file and switching to another buffer.