X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch.el;h=706e9f3299f60e57b33b630f5f65fd73f7d180ed;hp=59a5851bbcc4a95228b79340db78248ae4712ece;hb=0c0a401f706a2a6babffbc72b3ec17b87c173711;hpb=86f7ee24d6d0b15775b6f63f3bf88639e5be6e03 diff --git a/notmuch.el b/notmuch.el index 59a5851b..706e9f32 100644 --- a/notmuch.el +++ b/notmuch.el @@ -249,18 +249,21 @@ buffer." (mm-display-parts (mm-dissect-buffer)) (kill-this-buffer)))) +(defun notmuch-reply (query-string) + (switch-to-buffer (generate-new-buffer "notmuch-draft")) + (call-process "notmuch" nil t nil "reply" query-string) + (goto-char (point-min)) + (if (re-search-forward "^$" nil t) + (progn + (insert "--text follows this line--") + (forward-line))) + (message-mode)) + (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))) + (notmuch-reply message-id))) (defun notmuch-show-pipe-message (command) "Pipe the contents of the current message to the given command. @@ -651,6 +654,14 @@ view, (remove the \"inbox\" tag from each), with :options '(goto-address) :group 'notmuch) +; Make show mode a bit prettier, highlighting URLs and using word wrap + +(defun notmuch-show-pretty-hook () + (goto-address-mode 1) + (visual-line-mode)) + +(add-hook 'notmuch-show-hook 'notmuch-show-pretty-hook) + (defun notmuch-show (thread-id &optional parent-buffer) "Run \"notmuch show\" with the given thread ID and display results. @@ -700,6 +711,7 @@ thread from that buffer can be show when done with this one)." (define-key map "o" 'notmuch-search-toggle-order) (define-key map "p" 'previous-line) (define-key map "q" 'kill-this-buffer) + (define-key map "r" 'notmuch-search-reply-to-thread) (define-key map "s" 'notmuch-search) (define-key map "t" 'notmuch-search-filter-by-tag) (define-key map "x" 'kill-this-buffer) @@ -816,6 +828,12 @@ global search. (notmuch-show thread-id (current-buffer)) (error "End of search results")))) +(defun notmuch-search-reply-to-thread () + "Begin composing a reply to the entire current thread in a new buffer." + (interactive) + (let ((message-id (notmuch-search-find-thread-id))) + (notmuch-reply message-id))) + (defun notmuch-call-notmuch-process (&rest args) "Synchronously invoke \"notmuch\" with the given list of arguments. @@ -954,4 +972,6 @@ current search results AND that are tagged with the given tag." (interactive) (notmuch-search "tag:inbox" t)) +(setq mail-user-agent 'message-user-agent) + (provide 'notmuch)