[PATCH 4/4] emacs: add support for replying just to the sender of messages and threads
authorJani Nikula <jani@nikula.org>
Thu, 5 Jan 2012 20:25:15 +0000 (22:25 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:41:38 +0000 (09:41 -0800)
a8/0d0773c24276d83ad3db0c738d33a5b148a2dc [new file with mode: 0644]

diff --git a/a8/0d0773c24276d83ad3db0c738d33a5b148a2dc b/a8/0d0773c24276d83ad3db0c738d33a5b148a2dc
new file mode 100644 (file)
index 0000000..2e5b897
--- /dev/null
@@ -0,0 +1,168 @@
+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 68A34421183\r
+       for <notmuch@notmuchmail.org>; Thu,  5 Jan 2012 12:25:41 -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 oI5+DEaeO+gE for <notmuch@notmuchmail.org>;\r
+       Thu,  5 Jan 2012 12:25:40 -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
+ 23581421175   for <notmuch@notmuchmail.org>; Thu,  5 Jan 2012 12:25:34 -0800\r
+ (PST)\r
+Received: by mail-ee0-f53.google.com with SMTP id d41so756745eek.26\r
+       for <notmuch@notmuchmail.org>; Thu, 05 Jan 2012 12:25:33 -0800 (PST)\r
+Received: by 10.14.52.2 with SMTP id d2mr1281096eec.60.1325795133746;\r
+       Thu, 05 Jan 2012 12:25:33 -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 u53sm190165042eeu.6.2012.01.05.12.25.31\r
+       (version=SSLv3 cipher=OTHER); Thu, 05 Jan 2012 12:25:32 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org,\r
+       david@tethera.net\r
+Subject: [PATCH 4/4] emacs: add support for replying just to the sender of\r
+       messages and threads\r
+Date: Thu,  5 Jan 2012 22:25:15 +0200\r
+Message-Id:\r
+ <f50a031e41491e7f267834031a4f1b3e304831b0.1325794371.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <cover.1325794371.git.jani@nikula.org>\r
+References: <cover.1325794371.git.jani@nikula.org>\r
+In-Reply-To: <cover.1325794371.git.jani@nikula.org>\r
+References: <cover.1325794371.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: Thu, 05 Jan 2012 20:25:41 -0000\r
+\r
+Make the search and show reply functions reply just to the sender, and\r
+provide reply-all counterparts to reply to all. Add key binding 'R' to\r
+reply to sender, while keeping 'r' as reply-to-all, both in search and show\r
+views.\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ emacs/notmuch-mua.el  |    8 +++++---\r
+ emacs/notmuch-show.el |   12 +++++++++---\r
+ emacs/notmuch.el      |   11 +++++++++--\r
+ 3 files changed, 23 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 7114e48..3cdf360 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -71,12 +71,14 @@ 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 reply-all sender)\r
+   (let (headers\r
+       body\r
+       (args '("reply")))\r
+     (if notmuch-show-process-crypto\r
+       (setq args (append args '("--decrypt"))))\r
++    (unless reply-all\r
++      (setq args (append args '("--no-reply-all"))))\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 +219,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 reply-all prompt-for-sender)\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 reply-all sender)))\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..6f812d8 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -932,7 +932,8 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
+       (define-key map "s" 'notmuch-search)\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-all)\r
++      (define-key map "R" 'notmuch-show-reply)\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 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) nil prompt-for-sender))\r
++\r
++(defun notmuch-show-reply-all (&optional prompt-for-sender)\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) t prompt-for-sender))\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..bd1fd4f 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -206,7 +206,8 @@ For a mouse binding, return nil."\r
+     (define-key map ">" 'notmuch-search-last-thread)\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-all-to-thread)\r
++    (define-key map "R" 'notmuch-search-reply-to-thread)\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
+@@ -444,7 +445,13 @@ Complete list of currently available key bindings:\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 nil prompt-for-sender)))\r
++\r
++(defun notmuch-search-reply-all-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 t prompt-for-sender)))\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