Function: mh-modify

mh-modify is an autoloaded, interactive and byte-compiled function defined in mh-folder.el.gz.

Signature

(mh-modify &optional MESSAGE)

Documentation

Edit message.

There are times when you need to edit a message. For example, you may need to fix a broken Content-Type header field. You can do this with this command. It displays the raw message in an editable buffer. When you are done editing, save and kill the buffer as you would any other.

From a program, edit MESSAGE; nil means edit current message.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-folder.el.gz
;;;###mh-autoload
(defun mh-modify (&optional message)
  "Edit message.

There are times when you need to edit a message. For example, you
may need to fix a broken Content-Type header field. You can do
this with this command. It displays the raw message in an
editable buffer. When you are done editing, save and kill the
buffer as you would any other.

From a program, edit MESSAGE; nil means edit current message."
  (interactive)
  (let* ((message (or message (mh-get-msg-num t)))
         (msg-filename (mh-msg-filename message))
         edit-buffer)
    (when (not (file-exists-p msg-filename))
      (error "Message %d does not exist" message))

    ;; Invalidate the show buffer if it is showing the same message that is
    ;; to be edited.
    (when (and (buffer-live-p (get-buffer mh-show-buffer))
               (equal (with-current-buffer mh-show-buffer
                        buffer-file-name)
                      msg-filename))
      (mh-invalidate-show-buffer))

    ;; Edit message
    (find-file msg-filename)
    (setq edit-buffer (current-buffer))

    ;; Set buffer properties
    (mh-letter-mode)
    (use-local-map text-mode-map)

    ;; Just show the edit buffer...
    (delete-other-windows)
    (switch-to-buffer edit-buffer)))