Function: mh-insert-letter

mh-insert-letter is an interactive and byte-compiled function defined in mh-letter.el.gz.

Signature

(mh-insert-letter FOLDER MESSAGE VERBATIM)

Documentation

Insert a message.

This command prompts you for the FOLDER and MESSAGE number, which defaults to the current message in that folder. It then inserts the message, indented by mh-ins-buf-prefix ("> ") unless mh-yank-behavior is set to one of the supercite flavors in which case supercite is used to format the message. Certain undesirable header fields (see mh-invisible-header-fields-compiled) are removed before insertion.

If given a prefix argument VERBATIM, the header is left intact, the message is not indented, and "> " is not inserted before each line. This command leaves the mark before the letter and point after it.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-letter.el.gz
(defun mh-insert-letter (folder message verbatim)
  "Insert a message.

This command prompts you for the FOLDER and MESSAGE number, which
defaults to the current message in that folder. It then inserts
the message, indented by `mh-ins-buf-prefix' (\"> \") unless
`mh-yank-behavior' is set to one of the supercite flavors in
which case supercite is used to format the message. Certain
undesirable header fields (see
`mh-invisible-header-fields-compiled') are removed before
insertion.

If given a prefix argument VERBATIM, the header is left intact, the
message is not indented, and \"> \" is not inserted before each line.
This command leaves the mark before the letter and point after it."
  (interactive
   (let* ((folder
           (mh-prompt-for-folder "Message from" mh-sent-from-folder nil))
          (default
            (if (equal folder mh-sent-from-folder)
                (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur")))
              (nth 0 (mh-translate-range folder "cur"))))
          (message
           (read-string (format-prompt "Message number" default)
                        nil nil
                        (if (numberp default)
                            (int-to-string default)
                          default))))
     (list folder message current-prefix-arg)))
  (if (equal message "")
      (error "No message number given"))
  (save-restriction
    (narrow-to-region (point) (point))
    (let ((start (point-min)))
      (insert-file-contents
       (expand-file-name message (mh-expand-file-name folder)))
      (when (not verbatim)
        (mh-clean-msg-header start mh-invisible-header-fields-compiled nil)
        (goto-char (point-max))         ;Needed for sc-cite-original
        (push-mark)                     ;Needed for sc-cite-original
        (goto-char (point-min))         ;Needed for sc-cite-original
        (mh-insert-prefix-string mh-ins-buf-prefix)))))