[PATCH v2 4/6] emacs: add support for replying just to the sender
authorJani Nikula <jani@nikula.org>
Sun, 8 Jan 2012 21:48:33 +0000 (23:48 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:46 +0000 (09:41 -0800)
13/14f24ddc45ca482c03394c63000d082fdb3332 [new file with mode: 0644]

diff --git a/13/14f24ddc45ca482c03394c63000d082fdb3332 b/13/14f24ddc45ca482c03394c63000d082fdb3332
new file mode 100644 (file)
index 0000000..afa8d82
--- /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 7DAC34150E1\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Jan 2012 13:49:04 -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 JOTWjJnKH2Sm for <notmuch@notmuchmail.org>;\r
+       Sun,  8 Jan 2012 13:49:03 -0800 (PST)\r
+Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
+       [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 90E054150EC\r
+       for <notmuch@notmuchmail.org>; Sun,  8 Jan 2012 13:49:00 -0800 (PST)\r
+Received: by eaai1 with SMTP id i1so2292905eaa.26\r
+       for <notmuch@notmuchmail.org>; Sun, 08 Jan 2012 13:48:59 -0800 (PST)\r
+Received: by 10.213.19.143 with SMTP id a15mr2783611ebb.32.1326059338883;\r
+       Sun, 08 Jan 2012 13:48:58 -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 a60sm282267043eeb.4.2012.01.08.13.48.56\r
+       (version=SSLv3 cipher=OTHER); Sun, 08 Jan 2012 13:48:57 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 4/6] emacs: add support for replying just to the sender\r
+Date: Sun,  8 Jan 2012 23:48:33 +0200\r
+Message-Id:\r
+ <f4d62e178fc18ea05f6c49669851596efe4f25a0.1326058946.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1326058946.git.jani@nikula.org>\r
+References: <cover.1326058946.git.jani@nikula.org>\r
+In-Reply-To: <cover.1326058946.git.jani@nikula.org>\r
+References: <cover.1325794371.git.jani@nikula.org>\r
+       <cover.1326058946.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: Sun, 08 Jan 2012 21:49:05 -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 7114e48..5b15255 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
+@@ -217,13 +220,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 fde2377..5974d6b 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -207,6 +207,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
+@@ -441,10 +442,16 @@ Complete list of currently available key bindings:\r
+       (error "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