1 Return-Path: <ma.skies@gmail.com>
\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 16FF6429E26
\r
6 for <notmuch@notmuchmail.org>; Fri, 24 Jun 2011 16:26:59 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, 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 XIzE-ZhFdieX for <notmuch@notmuchmail.org>;
\r
17 Fri, 24 Jun 2011 16:26:58 -0700 (PDT)
\r
18 Received: from mail-iw0-f181.google.com (mail-iw0-f181.google.com
\r
19 [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 771CF429E25
\r
22 for <notmuch@notmuchmail.org>; Fri, 24 Jun 2011 16:26:58 -0700 (PDT)
\r
23 Received: by iwn37 with SMTP id 37so3145830iwn.26
\r
24 for <notmuch@notmuchmail.org>; Fri, 24 Jun 2011 16:26:57 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=domainkey-signature:from:to:subject:user-agent:date:message-id
\r
27 :mime-version:content-type;
\r
28 bh=XleEkWu9mwomieay0zl8/4DmCvvK/oIWbMT9M5ZJo24=;
\r
29 b=qf7WsuIyuvR+KxT9dvzC/q58QWnUtYHP/xHQQyUjDRDTvXraJXClPFBcZ+qUgQMOKh
\r
30 IcQbpXoZybk8WydWv9u9kVFJ6cEvvEWOLOjjOxiCeSIG95hurRuY0x7IXerJi8DI5EDM
\r
31 raRlu1cqFsUlrfEBdXulEmZeJYdUPA5PzOvDM=
\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
33 h=from:to:subject:user-agent:date:message-id:mime-version
\r
35 b=mEfxWfYfGKvn6oeD5thspH+aySLoOQWVbvzzMKwFjZWdXb6oZ7dTfzOwL5s3EWZJJ4
\r
36 Ku0RdEMOGz/XjGh/5qhWoVzs4ShEjyf9ayJQvXfHWUxpqaCTWpwDvprhQSRTpk7eJ6aC
\r
37 kgcJ3w0ZbMBBReryLriKN4pcyIJmj2icNBgKk=
\r
38 Received: by 10.42.147.201 with SMTP id o9mr3959903icv.412.1308958017281;
\r
39 Fri, 24 Jun 2011 16:26:57 -0700 (PDT)
\r
40 Received: from localhost ([74.205.145.146])
\r
41 by mx.google.com with ESMTPS id y1sm3044316ica.4.2011.06.24.16.26.56
\r
42 (version=TLSv1/SSLv3 cipher=OTHER);
\r
43 Fri, 24 Jun 2011 16:26:56 -0700 (PDT)
\r
44 From: Mark Anderson <ma.skies@gmail.com>
\r
45 To: notmuch@notmuchmail.org
\r
46 Subject: [PATCH 2/2] search --output=files: Output all filenames for each
\r
48 User-Agent: Notmuch/0.5-283-gb744eac (http://notmuchmail.org) Emacs/23.2.1
\r
50 Date: Fri, 24 Jun 2011 17:26:55 -0600
\r
51 Message-ID: <878vsqdd4w.fsf@gmail.com>
\r
53 Content-Type: text/plain; charset=us-ascii
\r
54 X-BeenThere: notmuch@notmuchmail.org
\r
55 X-Mailman-Version: 2.1.13
\r
57 List-Id: "Use and development of the notmuch mail system."
\r
58 <notmuch.notmuchmail.org>
\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
62 List-Post: <mailto:notmuch@notmuchmail.org>
\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
66 X-List-Received-Date: Fri, 24 Jun 2011 23:26:59 -0000
\r
69 Messages in the database can have multiple files associated with a
\r
70 single message-id, but until now only one filename for each message
\r
71 has been reported by "notmuch search --output=files"
\r
73 Signed-off-by: Mark Anderson <ma.skies@gmail.com>
\r
76 Perhaps someone can offer a little help making the "separator" code
\r
77 tighter, but this works.
\r
79 notmuch-search.c | 29 ++++++++++++++++++++++-------
\r
80 1 files changed, 22 insertions(+), 7 deletions(-)
\r
82 diff --git a/notmuch-search.c b/notmuch-search.c
\r
83 index 616fe68..faccaf7 100644
\r
84 --- a/notmuch-search.c
\r
85 +++ b/notmuch-search.c
\r
86 @@ -275,6 +275,7 @@ do_search_messages (const search_format_t *format,
\r
88 notmuch_message_t *message;
\r
89 notmuch_messages_t *messages;
\r
90 + notmuch_filenames_t *filenames;
\r
91 int first_message = 1;
\r
93 messages = notmuch_query_search_messages (query);
\r
94 @@ -289,19 +290,33 @@ do_search_messages (const search_format_t *format,
\r
96 message = notmuch_messages_get (messages);
\r
98 - if (! first_message)
\r
99 - fputs (format->item_sep, stdout);
\r
101 if (output == OUTPUT_FILES) {
\r
102 - format->item_id (message, "",
\r
103 - notmuch_message_get_filename (message));
\r
104 + filenames = notmuch_message_get_filenames (message);
\r
107 + notmuch_filenames_valid (filenames);
\r
108 + notmuch_filenames_move_to_next (filenames))
\r
110 + if (! first_message)
\r
111 + fputs (format->item_sep, stdout);
\r
113 + format->item_id (message, "",
\r
114 + notmuch_filenames_get (filenames));
\r
116 + first_message = 0;
\r
119 + notmuch_filenames_destroy( filenames );
\r
121 } else { /* output == OUTPUT_MESSAGES */
\r
122 + if (! first_message)
\r
123 + fputs (format->item_sep, stdout);
\r
125 format->item_id (message, "id:",
\r
126 notmuch_message_get_message_id (message));
\r
127 + first_message = 0;
\r
130 - first_message = 0;
\r
132 notmuch_message_destroy (message);
\r