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 7F119431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 9 Mar 2012 15:01:03 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\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 SKpXuWLlrQvq for <notmuch@notmuchmail.org>;
\r
16 Fri, 9 Mar 2012 15:01:01 -0800 (PST)
\r
17 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com
\r
18 [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 4AD36431FAE
\r
21 for <notmuch@notmuchmail.org>; Fri, 9 Mar 2012 15:01:01 -0800 (PST)
\r
22 Received: by lahc1 with SMTP id c1so2270700lah.26
\r
23 for <notmuch@notmuchmail.org>; Fri, 09 Mar 2012 15:00:59 -0800 (PST)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=google.com; s=20120113;
\r
26 h=from:to:subject:in-reply-to:references:user-agent:date:message-id
\r
27 :mime-version:content-type:x-gm-message-state;
\r
28 bh=JSrPuOJ0OocCLZ9O/qmQ7nI2ulpRYOOj5+ZuQIsRLq0=;
\r
29 b=M5/Hl4aMnvK5YuMK9mNd1++77jmVvOfc8F3hwqTz1UOR2LKK2uBJxlT3FBbw8z1kdp
\r
30 Ml5vaHUtbNn1on9iXWMQ9H2uHHzQTtOpZhqnPPYaWJ0J+79M4fI8qzTMQHWC48s5YREO
\r
31 oBok4NU5+fmooh4NgPkvJdx5BmwC4ySFkiw/UGsfN83CJQYuTrVvTszZcbHvkaffALBz
\r
32 Z3oaOQivL0PIlWTHEo4O/zDWHbsIStBX3V84i8vUkmz5w5hyqYa7hn8Z8gqc49GZ+lh4
\r
33 +QuZYbgRZ+KXyHSouMLE+wJMdZrCEDxyetvoX5r7+V5HV54Grrh85CPcZosQsQxlgya8
\r
35 Received: by 10.112.36.65 with SMTP id o1mr1499718lbj.32.1331334059581;
\r
36 Fri, 09 Mar 2012 15:00:59 -0800 (PST)
\r
37 Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.
\r
39 by mx.google.com with ESMTPS id a8sm8039538lba.15.2012.03.09.15.00.57
\r
40 (version=SSLv3 cipher=OTHER); Fri, 09 Mar 2012 15:00:58 -0800 (PST)
\r
41 From: Jani Nikula <jani@nikula.org>
\r
42 To: Adam Wolfe Gordon <awg+notmuch@xvx.ca>, notmuch@notmuchmail.org
\r
43 Subject: Re: [PATCH v6 03/10] reply: Require that only one message is returned
\r
44 In-Reply-To: <1329893199-21630-4-git-send-email-awg+notmuch@xvx.ca>
\r
45 References: <1329893199-21630-1-git-send-email-awg+notmuch@xvx.ca>
\r
46 <1329893199-21630-4-git-send-email-awg+notmuch@xvx.ca>
\r
47 User-Agent: Notmuch/0.11.1+295~g780f284 (http://notmuchmail.org) Emacs/23.3.1
\r
49 Date: Sat, 10 Mar 2012 01:00:54 +0200
\r
50 Message-ID: <87fwdh8jmh.fsf@nikula.org>
\r
52 Content-Type: text/plain; charset=us-ascii
\r
54 ALoCoQm1+QFpoc6BcDfyW5VvtsOGLFjAH2uWVne1Jm30EVJVeDsu9/oB1axGIn4EfpA3uiB6590v
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Fri, 09 Mar 2012 23:01:03 -0000
\r
69 On Tue, 21 Feb 2012 23:46:32 -0700, Adam Wolfe Gordon <awg+notmuch@xvx.ca> wrote:
\r
70 > As the semantics of replying to multiple messages have not yet been
\r
71 > defined well, make notmuch reply require that the search given returns
\r
72 > only a single message.
\r
74 Is there any real reason, apart from consistency between
\r
75 --format=default and --format=json, to disable the current multiple
\r
76 message reply? Also "notmuch show" has format specific features and
\r
79 I agree the semantics should be clarified, and eventually multiple
\r
80 message reply should be uniformly supported by all formats, including
\r
81 --format=json, but IMHO this patch should be dropped (and the TODO patch
\r
82 amended accordingly).
\r
89 > notmuch-reply.c | 36 +++++++++++++++++++-----------------
\r
90 > 1 files changed, 19 insertions(+), 17 deletions(-)
\r
92 > diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
93 > index 8e56245..177e6ca 100644
\r
94 > --- a/notmuch-reply.c
\r
95 > +++ b/notmuch-reply.c
\r
96 > @@ -572,30 +572,32 @@ notmuch_reply_format_default(void *ctx,
\r
97 > notmuch_message_t *message;
\r
98 > const notmuch_show_format_t *format = &format_reply;
\r
100 > - for (messages = notmuch_query_search_messages (query);
\r
101 > - notmuch_messages_valid (messages);
\r
102 > - notmuch_messages_move_to_next (messages))
\r
104 > - message = notmuch_messages_get (messages);
\r
105 > + if (notmuch_query_count_messages (query) != 1) {
\r
106 > + fprintf (stderr, "Error: search term did not match precisely one message.\n");
\r
110 > - reply = create_reply_message (ctx, config, message, reply_all);
\r
111 > + messages = notmuch_query_search_messages (query);
\r
112 > + message = notmuch_messages_get (messages);
\r
116 > + reply = create_reply_message (ctx, config, message, reply_all);
\r
118 > - show_reply_headers (reply);
\r
122 > - g_object_unref (G_OBJECT (reply));
\r
124 > + show_reply_headers (reply);
\r
126 > - printf ("On %s, %s wrote:\n",
\r
127 > - notmuch_message_get_header (message, "date"),
\r
128 > - notmuch_message_get_header (message, "from"));
\r
129 > + g_object_unref (G_OBJECT (reply));
\r
132 > - show_message_body (message, format, params);
\r
133 > + printf ("On %s, %s wrote:\n",
\r
134 > + notmuch_message_get_header (message, "date"),
\r
135 > + notmuch_message_get_header (message, "from"));
\r
137 > + show_message_body (message, format, params);
\r
139 > + notmuch_message_destroy (message);
\r
141 > - notmuch_message_destroy (message);
\r
149 > _______________________________________________
\r
150 > notmuch mailing list
\r
151 > notmuch@notmuchmail.org
\r
152 > http://notmuchmail.org/mailman/listinfo/notmuch
\r