X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.el;h=508ae764f54da45d7fd9919d058f92df89373d9f;hp=34e439422cdb5415eba37638c0ff8f980b2b3cd6;hb=4d35c3544d7bb0143cb1a17cc197cfe271670bf8;hpb=54d79f60a19566493593c0399a27ced0f0aa72e2 diff --git a/notmuch.el b/notmuch.el index 34e43942..508ae764 100644 --- a/notmuch.el +++ b/notmuch.el @@ -41,6 +41,7 @@ (define-key map (kbd "C-n") 'notmuch-show-next-line) (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-show-toggle-signatures-visible) (define-key map "w" 'notmuch-show-view-raw-message) (define-key map "x" 'kill-this-buffer) @@ -221,6 +222,19 @@ buffer." (interactive) (view-file (notmuch-show-get-filename))) +(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))) + (switch-to-buffer (generate-new-buffer "notmuch-draft")) + (call-process "notmuch" nil t nil "reply" message-id) + (goto-char (point-min)) + (if (re-search-forward "^$" nil t) + (progn + (insert "--text follows this line--") + (forward-line))) + (message-mode))) + (defun notmuch-show-pipe-message (command) "Pipe the contents of the current message to the given command.