+(defun notmuch-show-view-all-mime-parts ()
+ "Use external viewers (according to mailcap) to view all MIME-encoded parts."
+ (interactive)
+ (save-excursion
+ (let ((filename (notmuch-show-get-filename)))
+ (switch-to-buffer (generate-new-buffer (concat "*notmuch-mime-"
+ filename
+ "*")))
+ (insert-file-contents filename nil nil nil t)
+ (mm-display-parts (mm-dissect-buffer))
+ (kill-this-buffer))))
+
+(defun notmuch-reply (query-string)
+ (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+ (call-process notmuch-command nil t nil "reply" query-string)
+ (goto-char (point-min))
+ (if (re-search-forward "^$" nil t)
+ (progn
+ (insert "--text follows this line--")
+ (forward-line)))
+ (message-mode))
+
+(defun notmuch-show-reply ()
+ "Begin composing a reply to the current message in a new buffer."
+ (interactive)
+ (let ((message-id (notmuch-show-get-message-id)))
+ (notmuch-reply message-id)))
+
+(defun notmuch-show-pipe-message (command)
+ "Pipe the contents of the current message to the given command.
+
+The given command will be executed with the raw contents of the
+current email message as stdin. Anything printed by the command
+to stdout or stderr will appear in the *Messages* buffer."
+ (interactive "sPipe message to command: ")
+ (apply 'start-process-shell-command "notmuch-pipe-command" "*notmuch-pipe*" (split-string (concat command " < " (notmuch-show-get-filename)))))
+