Previous: Citing Mail, Up: Mail Mode


35.4.4 Mail Mode Miscellany

C-c C-t
Move to the beginning of the message body text (mail-text).
C-c C-w
Insert a signature at the end of the message text (mail-signature).
C-c C-i file <RET>
Insert the contents of file at the end of the message text (mail-attach-file).
M-x ispell-message
Perform spelling correction on the message text, but not on citations from other messages, or the message headers.

C-c C-t (mail-text) moves point to just after the header separator line—that is, to the beginning of the message body text.

C-c C-w (mail-signature) adds a standard piece of text (your mail signature) at the end of the message to say more about who you are. For example, it may contain telephone numbers, or your physical location. The text comes from the variable mail-signature. It can be a fixed string, or a Lisp expression that returns a string. If it is t or nil, the function inserts the contents of the file mail-signature-file. By default, this is the file ~/.signature in your home directory.

If the variable mail-signature has a non-nil value, starting a mail automatically inserts your signature. Otherwise, you must explicitly use the command mail-signature. If you want to omit your signature from a particular message, just delete it from the buffer before you send the message.

Convention says that the start of your signature should be marked by a line whose contents are ‘-- ’. If your signature comes from a file, this prefix is added for you, but in all other cases you must add it yourself. The remainder of your signature should be no more than four lines.

You can do spelling correction on the message text you have written with the command M-x ispell-message. If you have yanked an incoming message into the outgoing draft, this command skips what was yanked, but it checks the text that you yourself inserted. (It looks for indentation or mail-yank-prefix to distinguish the cited lines from your input.) See Spelling.

To include a file in the outgoing message, you can use C-x i, the usual command to insert a file in the current buffer. But it is often more convenient to use a special command, C-c C-i (mail-attach-file). This command inserts the file contents at the end of the buffer, after your signature (if any), with a delimiter line that includes the file name. Note that this is not a MIME attachment.

Turning on Mail mode (which C-x m does automatically) runs the normal hooks text-mode-hook and mail-mode-hook. Initializing a new outgoing message runs the normal hook mail-setup-hook; if you want to add special fields to your mail header or make other changes to the appearance of the mail buffer, use that hook. See Hooks.

The main difference between these hooks is just when they are invoked. Whenever you type M-x mail, mail-mode-hook runs as soon as the ‘*mail*’ buffer is created. Then the mail-setup function inserts the default contents of the buffer. After these default contents are inserted, mail-setup-hook runs.

If you use M-x mail to continue an existing composition, mail-mode-hook runs immediately after switching to the ‘*mail*’ buffer. If the buffer is unmodified, or if you decide to erase it and start again, mail-setup-hook runs after the default contents are inserted.