Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A764F431FAE for ; Thu, 3 Dec 2009 00:47:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vpMB-IJzXCpE for ; Thu, 3 Dec 2009 00:47:15 -0800 (PST) Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [122.248.162.6]) by olra.theworths.org (Postfix) with ESMTP id F03D3431FBF for ; Thu, 3 Dec 2009 00:47:14 -0800 (PST) Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by e28smtp06.in.ibm.com (8.14.3/8.13.1) with ESMTP id nB38lDLP032182 for ; Thu, 3 Dec 2009 14:17:13 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nB38lDQx2797748 for ; Thu, 3 Dec 2009 14:17:13 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nB38lCop022263 for ; Thu, 3 Dec 2009 14:17:12 +0530 Received: from localhost.localdomain ([9.77.193.32]) by d28av01.in.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nB38kmwB021218; Thu, 3 Dec 2009 14:17:03 +0530 From: "Aneesh Kumar K.V" To: cworth@cworth.org, aneesh.kumar@linux.vnet.ibm.com Date: Thu, 3 Dec 2009 14:16:45 +0530 Message-Id: <1259830005-3439-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.5.2.74.g610f9 In-Reply-To: <1259830005-3439-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1259830005-3439-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Cc: "Aneesh Kumar K.V" , notmuch@notmuchmail.org Subject: [notmuch] [PATCH 2/2] notmuch.el: Add support for reply-to sender X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 08:47:15 -0000 From: Aneesh Kumar K.V Add key binding to do a reply-to sender. This is mapped to 'R' Signed-off-by: Aneesh Kumar K.V --- notmuch.el | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/notmuch.el b/notmuch.el index bd8a6ce..c067e63 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) @@ -367,12 +368,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.5.2.74.g610f9