aboutsummaryrefslogtreecommitdiff
path: root/notmuch.el
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-11-14 08:57:38 -0800
committerCarl Worth <cworth@cworth.org>2009-11-14 08:57:38 -0800
commit322fe4f3fb6a547764715aecb4992f1c77547579 (patch)
tree84dac132d3921a13aa64fb43fa46105485f32e4a /notmuch.el
parent4812cfb368cddbb4265e6d55d8eb2d6b83fde1fe (diff)
notmuch.el: Add support for viewing MIME-encoded parts (with 'v').
Currently just supports viewing all MIME parts in the message. There's not yet support for selecting and viewing individual parts, but that should be easy to add from here, (now that we've found mm-display-parts to do all the heavy lifting).
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/notmuch.el b/notmuch.el
index e70a1fc..7e95f95 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -20,6 +20,7 @@
; Authors: Carl Worth <cworth@cworth.org>
(require 'cl)
+(require 'mm-view)
(defvar notmuch-show-mode-map
(let ((map (make-sparse-keymap)))
@@ -44,6 +45,7 @@
(define-key map "q" 'kill-this-buffer)
(define-key map "r" 'notmuch-show-reply)
(define-key map "s" 'notmuch-show-toggle-signatures-visible)
+ (define-key map "v" 'notmuch-show-view-all-mime-parts)
(define-key map "w" 'notmuch-show-view-raw-message)
(define-key map "x" 'kill-this-buffer)
(define-key map "+" 'notmuch-show-add-tag)
@@ -223,6 +225,18 @@ buffer."
(interactive)
(view-file (notmuch-show-get-filename)))
+(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-show-reply ()
"Begin composing a reply to the current message in a new buffer."
(interactive)