[PATCH v3 2/4] emacs: add support for replying just to the sender
authorJani Nikula <jani@nikula.org>
Tue, 10 Jan 2012 19:54:02 +0000 (21:54 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:52 +0000 (09:41 -0800)
a9/02ecff790abc728ab18379f260310ea86e3fc0 [new file with mode: 0644]

diff --git a/a9/02ecff790abc728ab18379f260310ea86e3fc0 b/a9/02ecff790abc728ab18379f260310ea86e3fc0
new file mode 100644 (file)
index 0000000..4f3cde0
--- /dev/null
@@ -0,0 +1,166 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 13030429E33\r
+       for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 11:54:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id rS-kRyKq8m-l for <notmuch@notmuchmail.org>;\r
+       Tue, 10 Jan 2012 11:54:30 -0800 (PST)\r
+Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
+ [74.125.83.53])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 757D1429E35   for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 11:54:24 -0800\r
+ (PST)\r
+Received: by mail-ee0-f53.google.com with SMTP id e51so593109eek.26\r
+       for <notmuch@notmuchmail.org>; Tue, 10 Jan 2012 11:54:24 -0800 (PST)\r
+Received: by 10.14.10.206 with SMTP id 54mr6742652eev.117.1326225264022;\r
+       Tue, 10 Jan 2012 11:54:24 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
+       [80.220.92.23])\r
+       by mx.google.com with ESMTPS id 19sm132089096eew.7.2012.01.10.11.54.21\r
+       (version=SSLv3 cipher=OTHER); Tue, 10 Jan 2012 11:54:22 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 2/4] emacs: add support for replying just to the sender\r
+Date: Tue, 10 Jan 2012 21:54:02 +0200\r
+Message-Id:\r
+ <069a0cddd4e848314fb64da861b3bf5b4f053f14.1326224339.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1326224339.git.jani@nikula.org>\r
+References: <cover.1326224339.git.jani@nikula.org>\r
+In-Reply-To: <cover.1326224339.git.jani@nikula.org>\r
+References: <cover.1325794371.git.jani@nikula.org>\r
+       <cover.1326224339.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 10 Jan 2012 19:54:32 -0000\r
+\r
+Provide reply to sender counterparts to the search and show reply\r
+functions. Add key binding 'R' to reply to sender, while keeping 'r' as\r
+reply to all, both in search and show views.\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ emacs/notmuch-mua.el  |    9 ++++++---\r
+ emacs/notmuch-show.el |   10 ++++++++--\r
+ emacs/notmuch.el      |    9 ++++++++-\r
+ 3 files changed, 22 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 32e2e30..d8ab822 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -71,12 +71,15 @@ list."\r
+           (push header message-hidden-headers)))\r
+       notmuch-mua-hidden-headers))\r
\r
+-(defun notmuch-mua-reply (query-string &optional sender)\r
++(defun notmuch-mua-reply (query-string &optional sender reply-all)\r
+   (let (headers\r
+       body\r
+       (args '("reply")))\r
+     (if notmuch-show-process-crypto\r
+       (setq args (append args '("--decrypt"))))\r
++    (if reply-all\r
++      (setq args (append args '("--reply-to=all")))\r
++      (setq args (append args '("--reply-to=sender"))))\r
+     (setq args (append args (list query-string)))\r
+     ;; This make assumptions about the output of `notmuch reply', but\r
+     ;; really only that the headers come first followed by a blank\r
+@@ -218,13 +221,13 @@ the From: address first."\r
+       (notmuch-mua-forward-message))\r
+     (notmuch-mua-forward-message)))\r
\r
+-(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender)\r
++(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all)\r
+   "Invoke the notmuch reply window."\r
+   (interactive "P")\r
+   (let ((sender\r
+        (when prompt-for-sender\r
+          (notmuch-mua-prompt-for-sender))))\r
+-    (notmuch-mua-reply query-string sender)))\r
++    (notmuch-mua-reply query-string sender reply-all)))\r
\r
+ (defun notmuch-mua-send-and-exit (&optional arg)\r
+   (interactive "P")\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 5502efd..96eea19 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -933,6 +933,7 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
+       (define-key map "m" 'notmuch-mua-new-mail)\r
+       (define-key map "f" 'notmuch-show-forward-message)\r
+       (define-key map "r" 'notmuch-show-reply)\r
++      (define-key map "R" 'notmuch-show-reply-sender)\r
+       (define-key map "|" 'notmuch-show-pipe-message)\r
+       (define-key map "w" 'notmuch-show-save-attachments)\r
+       (define-key map "V" 'notmuch-show-view-raw-message)\r
+@@ -1237,9 +1238,14 @@ any effects from previous calls to\r
+       (notmuch-show-previous-message)))))\r
\r
+ (defun notmuch-show-reply (&optional prompt-for-sender)\r
+-  "Reply to the current message."\r
++  "Reply to the sender and all recipients of the current message."\r
+   (interactive "P")\r
+-  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))\r
++  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender t))\r
++\r
++(defun notmuch-show-reply-sender (&optional prompt-for-sender)\r
++  "Reply to the sender of the current message."\r
++  (interactive "P")\r
++  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender nil))\r
\r
+ (defun notmuch-show-forward-message (&optional prompt-for-sender)\r
+   "Forward the current message."\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 1e61775..9ac2888 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -214,6 +214,7 @@ For a mouse binding, return nil."\r
+     (define-key map "p" 'notmuch-search-previous-thread)\r
+     (define-key map "n" 'notmuch-search-next-thread)\r
+     (define-key map "r" 'notmuch-search-reply-to-thread)\r
++    (define-key map "R" 'notmuch-search-reply-to-thread-sender)\r
+     (define-key map "m" 'notmuch-mua-new-mail)\r
+     (define-key map "s" 'notmuch-search)\r
+     (define-key map "o" 'notmuch-search-toggle-order)\r
+@@ -448,10 +449,16 @@ Complete list of currently available key bindings:\r
+       (message "End of search results."))))\r
\r
+ (defun notmuch-search-reply-to-thread (&optional prompt-for-sender)\r
++  "Begin composing a reply-all to the entire current thread in a new buffer."\r
++  (interactive "P")\r
++  (let ((message-id (notmuch-search-find-thread-id)))\r
++    (notmuch-mua-new-reply message-id prompt-for-sender t)))\r
++\r
++(defun notmuch-search-reply-to-thread-sender (&optional prompt-for-sender)\r
+   "Begin composing a reply to the entire current thread in a new buffer."\r
+   (interactive "P")\r
+   (let ((message-id (notmuch-search-find-thread-id)))\r
+-    (notmuch-mua-new-reply message-id prompt-for-sender)))\r
++    (notmuch-mua-new-reply message-id prompt-for-sender nil)))\r
\r
+ (defun notmuch-call-notmuch-process (&rest args)\r
+   "Synchronously invoke \"notmuch\" with the given list of arguments.\r
+-- \r
+1.7.5.4\r
+\r