X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=notmuch.el;h=da5a98c73219fe25b52992ad5e4a7c7b25ee2dfc;hb=c4463d4cb482abebdffe725a85fff35a0eba31a1;hp=1f5e681c2631dfa5452e911aa905932bae475ab9;hpb=8418dee2f6cf02f66dff236362f7cc1aadb56d38;p=notmuch diff --git a/notmuch.el b/notmuch.el index 1f5e681c..da5a98c7 100644 --- a/notmuch.el +++ b/notmuch.el @@ -70,6 +70,7 @@ (define-key map (kbd "C-p") 'notmuch-show-previous-line) (define-key map "q" 'kill-this-buffer) (define-key map "r" 'notmuch-show-reply) + (define-key map "s" 'notmuch-search) (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) @@ -282,17 +283,21 @@ buffer." (interactive) (view-file (notmuch-show-get-filename))) +(defmacro with-current-notmuch-show-message (&rest body) + "Evaluate body with current buffer set to the text of current message" + `(save-excursion + (let ((filename (notmuch-show-get-filename))) + (let ((buf (generate-new-buffer (concat "*notmuch-msg-" filename "*")))) + (with-current-buffer buf + (insert-file-contents filename nil nil nil t) + ,@body) + (kill-buffer buf))))) + (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)))) + (with-current-notmuch-show-message + (mm-display-parts (mm-dissect-buffer)))) (defun notmuch-reply (query-string) (switch-to-buffer (generate-new-buffer "notmuch-draft"))