unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: cworth@cworth.org
Cc: "Aneesh Kumar K.V" <aneesh.kumar@gmail.com>, notmuch@notmuchmail.org
Subject: [PATCH -V2 2/2] notmuch.el: Add support for reply-to sender
Date: Sat, 23 Jan 2010 15:35:05 +0530	[thread overview]
Message-ID: <1264241105-5983-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1264241105-5983-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

From: Aneesh Kumar K.V <aneesh.kumar@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@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

  reply	other threads:[~2010-01-23 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-23 10:05 [PATCH -V2 1/2] notmuch-reply: Add support for replying only to sender Aneesh Kumar K.V
2010-01-23 10:05 ` Aneesh Kumar K.V [this message]
2010-04-06  7:11 ` Sebastian Spaeth
2010-04-06  7:12   ` [PATCH " Sebastian Spaeth
2010-04-06  7:12     ` [PATCH 2/2] notmuch.el: Add support for reply-to sender Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1264241105-5983-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=aneesh.kumar@gmail.com \
    --cc=cworth@cworth.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).