Re: Hi all
[notmuch-archives.git] / a8 / 0d0773c24276d83ad3db0c738d33a5b148a2dc
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 68A34421183\r
6         for <notmuch@notmuchmail.org>; Thu,  5 Jan 2012 12:25:41 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id oI5+DEaeO+gE for <notmuch@notmuchmail.org>;\r
17         Thu,  5 Jan 2012 12:25:40 -0800 (PST)\r
18 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com\r
19  [74.125.83.53])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
20  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
21  23581421175    for <notmuch@notmuchmail.org>; Thu,  5 Jan 2012 12:25:34 -0800\r
22  (PST)\r
23 Received: by mail-ee0-f53.google.com with SMTP id d41so756745eek.26\r
24         for <notmuch@notmuchmail.org>; Thu, 05 Jan 2012 12:25:33 -0800 (PST)\r
25 Received: by 10.14.52.2 with SMTP id d2mr1281096eec.60.1325795133746;\r
26         Thu, 05 Jan 2012 12:25:33 -0800 (PST)\r
27 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
28         [80.220.92.23])\r
29         by mx.google.com with ESMTPS id u53sm190165042eeu.6.2012.01.05.12.25.31\r
30         (version=SSLv3 cipher=OTHER); Thu, 05 Jan 2012 12:25:32 -0800 (PST)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org,\r
33         david@tethera.net\r
34 Subject: [PATCH 4/4] emacs: add support for replying just to the sender of\r
35         messages and threads\r
36 Date: Thu,  5 Jan 2012 22:25:15 +0200\r
37 Message-Id:\r
38  <f50a031e41491e7f267834031a4f1b3e304831b0.1325794371.git.jani@nikula.org>\r
39 X-Mailer: git-send-email 1.7.5.4\r
40 In-Reply-To: <cover.1325794371.git.jani@nikula.org>\r
41 References: <cover.1325794371.git.jani@nikula.org>\r
42 In-Reply-To: <cover.1325794371.git.jani@nikula.org>\r
43 References: <cover.1325794371.git.jani@nikula.org>\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Thu, 05 Jan 2012 20:25:41 -0000\r
57 \r
58 Make the search and show reply functions reply just to the sender, and\r
59 provide reply-all counterparts to reply to all. Add key binding 'R' to\r
60 reply to sender, while keeping 'r' as reply-to-all, both in search and show\r
61 views.\r
62 \r
63 Signed-off-by: Jani Nikula <jani@nikula.org>\r
64 ---\r
65  emacs/notmuch-mua.el  |    8 +++++---\r
66  emacs/notmuch-show.el |   12 +++++++++---\r
67  emacs/notmuch.el      |   11 +++++++++--\r
68  3 files changed, 23 insertions(+), 8 deletions(-)\r
69 \r
70 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
71 index 7114e48..3cdf360 100644\r
72 --- a/emacs/notmuch-mua.el\r
73 +++ b/emacs/notmuch-mua.el\r
74 @@ -71,12 +71,14 @@ list."\r
75             (push header message-hidden-headers)))\r
76         notmuch-mua-hidden-headers))\r
77  \r
78 -(defun notmuch-mua-reply (query-string &optional sender)\r
79 +(defun notmuch-mua-reply (query-string &optional reply-all sender)\r
80    (let (headers\r
81         body\r
82         (args '("reply")))\r
83      (if notmuch-show-process-crypto\r
84         (setq args (append args '("--decrypt"))))\r
85 +    (unless reply-all\r
86 +      (setq args (append args '("--no-reply-all"))))\r
87      (setq args (append args (list query-string)))\r
88      ;; This make assumptions about the output of `notmuch reply', but\r
89      ;; really only that the headers come first followed by a blank\r
90 @@ -217,13 +219,13 @@ the From: address first."\r
91         (notmuch-mua-forward-message))\r
92      (notmuch-mua-forward-message)))\r
93  \r
94 -(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender)\r
95 +(defun notmuch-mua-new-reply (query-string &optional reply-all prompt-for-sender)\r
96    "Invoke the notmuch reply window."\r
97    (interactive "P")\r
98    (let ((sender\r
99          (when prompt-for-sender\r
100            (notmuch-mua-prompt-for-sender))))\r
101 -    (notmuch-mua-reply query-string sender)))\r
102 +    (notmuch-mua-reply query-string reply-all sender)))\r
103  \r
104  (defun notmuch-mua-send-and-exit (&optional arg)\r
105    (interactive "P")\r
106 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
107 index 5502efd..6f812d8 100644\r
108 --- a/emacs/notmuch-show.el\r
109 +++ b/emacs/notmuch-show.el\r
110 @@ -932,7 +932,8 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
111         (define-key map "s" 'notmuch-search)\r
112         (define-key map "m" 'notmuch-mua-new-mail)\r
113         (define-key map "f" 'notmuch-show-forward-message)\r
114 -       (define-key map "r" 'notmuch-show-reply)\r
115 +       (define-key map "r" 'notmuch-show-reply-all)\r
116 +       (define-key map "R" 'notmuch-show-reply)\r
117         (define-key map "|" 'notmuch-show-pipe-message)\r
118         (define-key map "w" 'notmuch-show-save-attachments)\r
119         (define-key map "V" 'notmuch-show-view-raw-message)\r
120 @@ -1237,9 +1238,14 @@ any effects from previous calls to\r
121        (notmuch-show-previous-message)))))\r
122  \r
123  (defun notmuch-show-reply (&optional prompt-for-sender)\r
124 -  "Reply to the current message."\r
125 +  "Reply to the sender of the current message."\r
126    (interactive "P")\r
127 -  (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender))\r
128 +  (notmuch-mua-new-reply (notmuch-show-get-message-id) nil prompt-for-sender))\r
129 +\r
130 +(defun notmuch-show-reply-all (&optional prompt-for-sender)\r
131 +  "Reply to the sender and all recipients of the current message."\r
132 +  (interactive "P")\r
133 +  (notmuch-mua-new-reply (notmuch-show-get-message-id) t prompt-for-sender))\r
134  \r
135  (defun notmuch-show-forward-message (&optional prompt-for-sender)\r
136    "Forward the current message."\r
137 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
138 index fde2377..bd1fd4f 100644\r
139 --- a/emacs/notmuch.el\r
140 +++ b/emacs/notmuch.el\r
141 @@ -206,7 +206,8 @@ For a mouse binding, return nil."\r
142      (define-key map ">" 'notmuch-search-last-thread)\r
143      (define-key map "p" 'notmuch-search-previous-thread)\r
144      (define-key map "n" 'notmuch-search-next-thread)\r
145 -    (define-key map "r" 'notmuch-search-reply-to-thread)\r
146 +    (define-key map "r" 'notmuch-search-reply-all-to-thread)\r
147 +    (define-key map "R" 'notmuch-search-reply-to-thread)\r
148      (define-key map "m" 'notmuch-mua-new-mail)\r
149      (define-key map "s" 'notmuch-search)\r
150      (define-key map "o" 'notmuch-search-toggle-order)\r
151 @@ -444,7 +445,13 @@ Complete list of currently available key bindings:\r
152    "Begin composing a reply to the entire current thread in a new buffer."\r
153    (interactive "P")\r
154    (let ((message-id (notmuch-search-find-thread-id)))\r
155 -    (notmuch-mua-new-reply message-id prompt-for-sender)))\r
156 +    (notmuch-mua-new-reply message-id nil prompt-for-sender)))\r
157 +\r
158 +(defun notmuch-search-reply-all-to-thread (&optional prompt-for-sender)\r
159 +  "Begin composing a reply-all to the entire current thread in a new buffer."\r
160 +  (interactive "P")\r
161 +  (let ((message-id (notmuch-search-find-thread-id)))\r
162 +    (notmuch-mua-new-reply message-id t prompt-for-sender)))\r
163  \r
164  (defun notmuch-call-notmuch-process (&rest args)\r
165    "Synchronously invoke \"notmuch\" with the given list of arguments.\r
166 -- \r
167 1.7.5.4\r
168 \r