[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11. More Ways to Handle Messages

You can use af to handle messages in more sophisticated ways than by simply displaying them; You can save messages to folders, print a hardcopy of them, pipe them into commands, and more.

Most commands that deal with a single message also have similar commands which deal with a set of messages, selected either by using the mark and region (see section 12. The Mark and the Region), or with tags (see section 13. Tags). These similar commands will be covered later.

11.1 Saving Messages  Saving a message to a folder.
11.2 Printing Messages  Printing a hardcopy of a message.
11.3 Piping Messages  Passing messages to a shell command.
11.4 Other Message-Handling Commands  Other message-handling commands.
11.5 Running Shell Commands from Af  Executing shell commands from within af.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.1 Saving Messages

Af allows you to save messages by copying them to folders. One way to save a message to a folder is to use M-+ (save-message). Af will prompt you for the folder name, offering a default based on the sender's mail address (see section 18. Folder Handling). The message will be appended to the folder you specify, so any messages already in the folder will be left unchanged.

When the message is saved to a folder, the original copy is not deleted. an `S' will appear in the system tags of the message, so that you know you have saved it.

M-+ can take a numeric argument, in which case it only saves the body of the message, not the headers. Obviously the file containing a saved copy of the message body shouldn't be read with af; it isn't a mail folder. Saving the body of a message can be useful when the body is input for some other program (such as a patch file).

When you save message bodies, any MIME encoding is removed from the body parts. Partial messages are rebuilt before they are saved. Af will only save a rebuilt message once, no matter how many parts of the message are included in the messages to save. This is convenient when you are saving a set of message bodies.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.2 Printing Messages

Af allows you to print a hardcopy of a message to a spooler. The program to use to print hard copies of mail is defined by the print-command variable for textual body parts, or the mime-printer variable for non-textual body parts.

To print a hardcopy of a message, use C-p (print-message). Af will usually prompt you to confirm that you want a hardcopy of the message; this feature can be turned off by setting the variable confirm-print to false. After you print the message, a `P' will appear in the system tags of the message, to remind you that you have printed it.

Normally, the mail headers listed in the headers-not-displayed variable will not be printed when you print a message. A positive numeric argument makes af print all the message's headers, while a negative argument makes af skip all headers, and only print the body of the message.

When you print messages, any MIME encoding is removed from the body parts. Partial messages are rebuilt before they are printed. Af will only print a rebuilt message once, no matter how many parts of the message are included in the messages to print. This is convenient when you are printing a set of message bodies.

If you print a non-text message, af will use an external program to print any non-text body parts. For this reason, non-textual body parts may not appear in the correct sequence with textual body parts. If you print a non-text body part, and af doesn't know how to handle it, it will assume that you know what you are doing, and print it anyway. The results may well be less than ideal if you print an image or audio body part.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.3 Piping Messages

Af allows you to pipe a message into the standard input of a system command. To do this use M-| (pipe-message). Af will prompt for the command to pipe the message into, and then execute the command. Any output from the command will be displayed on the screen. Once the command has completed, af will wait for you to press a key before continuing; giving you a chance to read any output from the command.

Normally, the mail headers listed in the headers-not-displayed variable will not be piped into the command. A positive numeric argument makes af pass all the message's headers to the command. A negative argument makes af skip all headers, and only pass the body of the message to the command.

When you pipe messages into a command, any MIME encoding is removed from the body parts. Partial messages are rebuilt before they are piped into the command. Af will only pipe a rebuilt message once, no matter how many parts of the message are included in the messages to pipe. This is convenient when you are piping a set of messages into a command


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.4 Other Message-Handling Commands

C-x j
Create a new buffer containing the body parts of the current message. (open-body-parts).
C-x 4 j
Create a new buffer in the other window containing the body parts of the current message. (open-body-parts-other window).
C-x C-e
Edit the text of the current message.

If a message contains one or more body parts, or an encapsulated message, then af can create a buffer containing each body part as a separate message. Similarly, af can rebuild the original message from a single part if all the parts are present in the current buffer. Or if the message is an old, pre-MIME, mail digest, then af is still capable of extracting the parts of the message.

To extract or rebuild the parts of a message body use C-x j (open-body-parts) or C-x 4 j (open-body-parts-other-window). This will create a new buffer containing the extracted or rebuilt messages, and switch to that buffer. The buffer will not be visiting any folder, and so will not be saved to a folder when you exit af.

The new buffer will be in Body Parts minor mode, which means that the body-part-line-format variable will be used to display each message in the buffer, rather than the header-line-format. This allows you to show different details for body parts to those you show for messages.

Af will allow you to edit a message in a folder with C-x C-e (edit-message). Af will save the message to a temporary file and execute an editor to edit the file. When you finish editing, af will read back the temporary file, and update its internal copy of the message. When you save the buffer, the modified message will be written to the folder.

With an argument, C-x C-e will only pass the body of the message to the editor, and will preserve the message header unchanged.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.5 Running Shell Commands from Af

Af has commands for running inferior shell processes, displaying the result to typeout or letting the inferior process take control of the terminal.

M-! cmd RET
Run the shell command line cmd and display the output to typeout (shell-command-to-typeout).
C-x ! cmd RET
Start an inferior shell to run the command line cmd. The inferior shell will take control of the terminal until it exits. (shell-command)
M-x shell
Run an inferior shell interactively under af. The inferior shell will take control of the terminal until it exits (shell).


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Malc Arnold on August, 22 2002 using texi2html