[notmuch] [PATCH -V2 2/2] notmuch.el: Add support for reply-to sender

Aneesh Kumar K.V aneesh.kumar at linux.vnet.ibm.com
Sat Jan 23 02:05:05 PST 2010


From: Aneesh Kumar K.V <aneesh.kumar at gmail.com>

Add key binding to do a reply-to sender. This
is mapped to 'R'

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at gmail.com>
---
 notmuch.el |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 97914f2..5589350 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -62,7 +62,8 @@
     (define-key map "s" 'notmuch-search)
     (define-key map "m" 'message-mail)
     (define-key map "f" 'notmuch-show-forward-current)
-    (define-key map "r" 'notmuch-show-reply)
+    (define-key map "r" 'notmuch-show-reply-all)
+    (define-key map "R" 'notmuch-show-reply)
     (define-key map "|" 'notmuch-show-pipe-message)
     (define-key map "w" 'notmuch-show-save-attachments)
     (define-key map "V" 'notmuch-show-view-raw-message)
@@ -363,12 +364,31 @@ buffer."
 	(forward-line)))
   (message-mode))
 
-(defun notmuch-show-reply ()
+(defun notmuch-show-reply-all ()
   "Begin composing a reply to the current message in a new buffer."
   (interactive)
   (let ((message-id (notmuch-show-get-message-id)))
     (notmuch-reply message-id)))
 
+
+(defun notmuch-format-reply (format-string query-string)
+  (switch-to-buffer (generate-new-buffer "notmuch-draft"))
+  (call-process notmuch-command nil t nil "reply"
+		(concat "--format=" format-string) query-string)
+  (message-insert-signature)
+  (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)))
+    (notmuch-format-reply "sender-only" message-id)))
+
 (defun notmuch-show-forward-current ()
   "Forward the current message."
   (interactive)
-- 
1.6.6.1.394.gdedc0



More information about the notmuch mailing list