Function: mh-pipe-msg

mh-pipe-msg is an autoloaded, interactive and byte-compiled function defined in mh-funcs.el.gz.

Signature

(mh-pipe-msg COMMAND INCLUDE-HEADER)

Documentation

Pipe message through shell command COMMAND.

You are prompted for the Unix command through which you wish to run your message. If you give a prefix argument INCLUDE-HEADER to this command, the message header is included in the text passed to the command.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mh-e/mh-funcs.el.gz
;;;###mh-autoload
(defun mh-pipe-msg (command include-header)
  "Pipe message through shell command COMMAND.

You are prompted for the Unix command through which you wish to
run your message. If you give a prefix argument INCLUDE-HEADER to
this command, the message header is included in the text passed
to the command."
  (interactive
   (list (read-string "Shell command on message: ") current-prefix-arg))
  (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t)))
        (message-directory default-directory))
    (with-current-buffer (get-buffer-create mh-temp-buffer)
      (erase-buffer)
      (insert-file-contents msg-file-to-pipe)
      (goto-char (point-min))
      (if (not include-header) (search-forward "\n\n"))
      (let ((default-directory message-directory))
        (shell-command-on-region (point) (point-max) command nil)))))