1 Return-Path: <awg@lagos.xvx.ca>
\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 4C1A6431FCF
\r
6 for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 22:46:46 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id rE43QEJXpuzf for <notmuch@notmuchmail.org>;
\r
16 Tue, 21 Feb 2012 22:46:45 -0800 (PST)
\r
17 Received: from smtp-out-04.shaw.ca (smtp-out-04.shaw.ca [64.59.134.12])
\r
18 by olra.theworths.org (Postfix) with ESMTP id A50BB431FAE
\r
19 for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 22:46:45 -0800 (PST)
\r
20 Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd5ml1no-ssvc.prod.shaw.ca)
\r
22 by pd5mo1no-svcs.prod.shaw.ca with ESMTP; 21 Feb 2012 23:46:45 -0700
\r
23 X-Cloudmark-SP-Filtered: true
\r
24 X-Cloudmark-SP-Result: v=1.1 cv=bD0CuDYpMgGTku+nVSbZuKP/9fNjspX1F8zuwcoBWhM=
\r
26 a=9pECzfXRGIEA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17
\r
27 a=QDwvV1CsnJkeiAAkpzgA:9 a=UXqUYI6nDuMlVyhDXWAA:7
\r
28 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
\r
29 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])
\r
30 by pd5ml1no-dmz.prod.shaw.ca with ESMTP; 21 Feb 2012 23:46:45 -0700
\r
31 Received: by lagos.xvx.ca (Postfix, from userid 1000)
\r
32 id 90E058095C4D; Tue, 21 Feb 2012 23:46:44 -0700 (MST)
\r
33 From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>
\r
34 To: notmuch@notmuchmail.org
\r
35 Subject: [PATCH v6 03/10] reply: Require that only one message is returned
\r
36 Date: Tue, 21 Feb 2012 23:46:32 -0700
\r
37 Message-Id: <1329893199-21630-4-git-send-email-awg+notmuch@xvx.ca>
\r
38 X-Mailer: git-send-email 1.7.5.4
\r
39 In-Reply-To: <1329893199-21630-1-git-send-email-awg+notmuch@xvx.ca>
\r
40 References: <1329893199-21630-1-git-send-email-awg+notmuch@xvx.ca>
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 22 Feb 2012 06:46:46 -0000
\r
55 As the semantics of replying to multiple messages have not yet been
\r
56 defined well, make notmuch reply require that the search given returns
\r
57 only a single message.
\r
59 notmuch-reply.c | 36 +++++++++++++++++++-----------------
\r
60 1 files changed, 19 insertions(+), 17 deletions(-)
\r
62 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
63 index 8e56245..177e6ca 100644
\r
64 --- a/notmuch-reply.c
\r
65 +++ b/notmuch-reply.c
\r
66 @@ -572,30 +572,32 @@ notmuch_reply_format_default(void *ctx,
\r
67 notmuch_message_t *message;
\r
68 const notmuch_show_format_t *format = &format_reply;
\r
70 - for (messages = notmuch_query_search_messages (query);
\r
71 - notmuch_messages_valid (messages);
\r
72 - notmuch_messages_move_to_next (messages))
\r
74 - message = notmuch_messages_get (messages);
\r
75 + if (notmuch_query_count_messages (query) != 1) {
\r
76 + fprintf (stderr, "Error: search term did not match precisely one message.\n");
\r
80 - reply = create_reply_message (ctx, config, message, reply_all);
\r
81 + messages = notmuch_query_search_messages (query);
\r
82 + message = notmuch_messages_get (messages);
\r
86 + reply = create_reply_message (ctx, config, message, reply_all);
\r
88 - show_reply_headers (reply);
\r
92 - g_object_unref (G_OBJECT (reply));
\r
94 + show_reply_headers (reply);
\r
96 - printf ("On %s, %s wrote:\n",
\r
97 - notmuch_message_get_header (message, "date"),
\r
98 - notmuch_message_get_header (message, "from"));
\r
99 + g_object_unref (G_OBJECT (reply));
\r
102 - show_message_body (message, format, params);
\r
103 + printf ("On %s, %s wrote:\n",
\r
104 + notmuch_message_get_header (message, "date"),
\r
105 + notmuch_message_get_header (message, "from"));
\r
107 + show_message_body (message, format, params);
\r
109 + notmuch_message_destroy (message);
\r
111 - notmuch_message_destroy (message);
\r