head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2006.05.29.14.31.25; author jpeek; state Exp; branches; next 1.3; 1.3 date 2006.05.28.04.27.15; author jpeek; state Exp; branches; next 1.2; 1.2 date 2006.05.26.23.59.01; author jpeek; state Exp; branches; next 1.1; 1.1 date 2006.05.26.22.12.08; author jpeek; state Exp; branches; next ; desc @mh-e_50.html page from mh-e section of "MH & nmh: Email for Users & Programmers" @ 1.4 log @Removed 'html/' from end of http://mh-e.sourceforge.net/manual/html/ URLs @ text @
This section of MH & nmh: Email for Users & Programmers is now the MH-E Manual. It's moved to http://mh-e.sourceforge.net/manual/.
If you aren't taken to the new site in 15 seconds, please click on the link above.
You may also want to visit:
You may wish to start off by adding the following useful key bindings to your `.emacs' file:
(global-set-key "\C-xm" 'mh-smail) (global-set-key "\C-x4m" 'mh-smail-other-window)
In addition, several variables are useful when sending mail or replying to mail. They are summarized in the following table.
mh-comp-formfile
mh-repl-formfile
mh-letter-mode-hook
nil
).
mh-compose-letter-function
nil
).
mh-reply-default-reply-to
nil
).
mh-forward-subject-format
mh-redist-full-contents
send
requires entire message (default: nil
).
mh-new-draft-cleaned-headers
Since mh-e does not use comp
to create the initial draft, you
need to set mh-comp-formfile
to the name of your components file
if it isn't `components'. This is the name of the file that
contains the form for composing messages. If it does not contain an
absolute pathname, mh-e searches for the file first in your MH directory
and then in the system MH library directory (such as
`/usr/local/lib/mh'). Replies, on the other hand, are built using
repl
. You can change the location of the field file from the
default of `replcomps' by modifying mh-repl-formfile
.
Two hooks are provided to run commands on your freshly created draft.
The first hook, mh-letter-mode-hook
, allows you to do some
processing before editing a letter. For example, you may wish to modify
the header after repl
has done its work, or you may have a
complicated `components' file and need to tell mh-e where the
cursor should go. Here's an example of how you would use this hook--all
of the other hooks are set in this fashion as well.
Prepare draft for editing via mh-letter-mode-hook
(defvar letter-mode-init-done nil
"Non-nil
when one-time mh-e settings have made.")
(defun my-mh-letter-mode-hook ()
"Hook to prepare letter for editing."
(if (not letter-mode-init-done) ; only need to bind the keys once
(progn
(local-set-key "\C-ctb" 'add-enriched-text)
(local-set-key "\C-cti" 'add-enriched-text)
(local-set-key "\C-ctf" 'add-enriched-text)
(local-set-key "\C-cts" 'add-enriched-text)
(local-set-key "\C-ctB" 'add-enriched-text)
(local-set-key "\C-ctu" 'add-enriched-text)
(local-set-key "\C-ctc" 'add-enriched-text)
(setq letter-mode-init-done t)))
(setq fill-prefix " ") ; I find indented text easier to read
(save-excursion
(goto-char (point-max)) ; go to end of message to
(mh-insert-signature))) ; insert signature
(add-hook 'mh-letter-mode-hook 'my-mh-letter-mode-hook)
The function, add-enriched-text
is defined in the example in
section Editing Multimedia Messages.
The second hook, a function really, is
mh-compose-letter-function
. Like mh-letter-mode-hook
, it
is called just before editing a new message; however, it is the last
function called before you edit your message. The consequence of this
is that you can write a function to write and send the message for you.
This function is passed three arguments: the contents of the `To:',
`Subject:', and `cc:' header fields.
Go to the first, previous, next, last section, table of contents.