mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
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).
This commit is contained in:
parent
b88e6abccd
commit
75d616c6ca
1 changed files with 7 additions and 5 deletions
|
@ -935,11 +935,13 @@ any effects from previous calls to
|
||||||
(defun notmuch-show-view-raw-message ()
|
(defun notmuch-show-view-raw-message ()
|
||||||
"View the file holding the current message."
|
"View the file holding the current message."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((id (notmuch-show-get-message-id)))
|
(let* ((id (notmuch-show-get-message-id))
|
||||||
(let ((buf (get-buffer-create (concat "*notmuch-raw-" id "*"))))
|
(buf (get-buffer-create (concat "*notmuch-raw-" id "*"))))
|
||||||
(switch-to-buffer buf)
|
(call-process notmuch-command nil buf nil "show" "--format=raw" id)
|
||||||
(save-excursion
|
(switch-to-buffer buf)
|
||||||
(call-process notmuch-command nil t nil "show" "--format=raw" id)))))
|
(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)
|
(defun notmuch-show-pipe-message (entire-thread command)
|
||||||
"Pipe the contents of the current message (or thread) to the given command.
|
"Pipe the contents of the current message (or thread) to the given command.
|
||||||
|
|
Loading…
Reference in a new issue