aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar David Edmondson <dme@dme.org>2010-11-15 14:21:53 +0000
committerGravatar Carl Worth <cworth@cworth.org>2010-11-16 11:16:59 -0800
commit75d616c6caa0e0ac51c34371ebee7574dbea2952 (patch)
tree418bedd7bd99275ff9156caf697c988627422ea2 /emacs
parentb88e6abccd91fcce00409633aeddbccdc57f32b7 (diff)
emacs: Use `view-mode' when examining raw messages.
Explained-by: Carl Worth: This gives convenient keybindings for navigating the file and for quitting from the buffer, (since, with a raw message file the user will generally want to just view the message, not edit it).
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index d8773e65..3a60d430 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -935,11 +935,13 @@ any effects from previous calls to
(defun notmuch-show-view-raw-message ()
"View the file holding the current message."
(interactive)
- (let ((id (notmuch-show-get-message-id)))
- (let ((buf (get-buffer-create (concat "*notmuch-raw-" id "*"))))
- (switch-to-buffer buf)
- (save-excursion
- (call-process notmuch-command nil t nil "show" "--format=raw" id)))))
+ (let* ((id (notmuch-show-get-message-id))
+ (buf (get-buffer-create (concat "*notmuch-raw-" id "*"))))
+ (call-process notmuch-command nil buf nil "show" "--format=raw" id)
+ (switch-to-buffer buf)
+ (goto-char (point-min))
+ (set-buffer-modified-p nil)
+ (view-buffer buf 'kill-buffer-if-not-modified)))
(defun notmuch-show-pipe-message (entire-thread command)
"Pipe the contents of the current message (or thread) to the given command.