aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-19 00:21:24 +0100
committerGravatar Carl Worth <cworth@cworth.org>2009-11-19 00:21:24 +0100
commit83a2ed3c2f301bf63a37cc091431db20321704e1 (patch)
tree864934ace1d57b9f8ca3ce16ecc547faedb9b12f /notmuch.el
parentf52528a344aee5111f6356f50678dfd54d5d80f6 (diff)
notmuch.el: Add a reply binding ('r') to search mode to reply to a whole thread.
This is basically right, (I get a message buffer with all the mails quoted), but somehow notmuch reply is reversing the messages. That's a nuisance.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/notmuch.el b/notmuch.el
index 296f5d66..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.
@@ -708,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)
@@ -824,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.