Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 73 / f6010f300bb191630607b156ae94a3c52c4832
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 AEB49429E5D\r
6         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 05:11:41 -0700 (PDT)\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 FelIe38QyDgs for <notmuch@notmuchmail.org>;\r
17         Sat, 17 Aug 2013 05:11:36 -0700 (PDT)\r
18 Received: from mail-bk0-f45.google.com (mail-bk0-f45.google.com\r
19         [209.85.214.45]) (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 F0E1C431E82\r
22         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 05:11:35 -0700 (PDT)\r
23 Received: by mail-bk0-f45.google.com with SMTP id mx11so913478bkb.18\r
24         for <notmuch@notmuchmail.org>; Sat, 17 Aug 2013 05:11:34 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=google.com; s=20120113;\r
27         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
28         :references:in-reply-to:references;\r
29         bh=MmYw4TKA8Xbd3O7DA8EMUslE6/k1CJwzGMT8Xl+cCVk=;\r
30         b=jgkTvEAc90fq8yGQ40OGN2nY0Y4H0aeTWplMqE+/MAiOcPG3J0WF1E6NkFgN5yJcl5\r
31         blnNm04IcnejzWJTqf1ESbokq0XiOU1eEqfzo5YK02K9ThurwaS+ozIlSEOOpm4sAjOm\r
32         2i7DXUYtWpuMEk3JIUB1NC4MpcwF0y3Uydvg41o3Tt7pAlRlRR/v75t22GCiKAQCmp/n\r
33         nziAncJEDh36iLQMXfiog+1LR3xYhhLakojy5EZRBn0xv3CWDmVXUBPzhhveQbpl8btz\r
34         KaYNXSN1Z+uS7b5LQg18OsJfLNfwfgQ//iQR0GIW2qrpgAGraivGbQscvvcvd4f2DZfF\r
35         7Z1g==\r
36 X-Gm-Message-State:\r
37  ALoCoQnpaZcOBN9tzENBgQ5nebTUG2SE6cuxwmG1MucHRNopeXvamBfdBSksh/3+TY/YT5nQaowu\r
38 X-Received: by 10.205.10.132 with SMTP id pa4mr3931980bkb.15.1376741493407;\r
39         Sat, 17 Aug 2013 05:11:33 -0700 (PDT)\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
41         [88.195.111.91])\r
42         by mx.google.com with ESMTPSA id h5sm249685bkg.8.1969.12.31.16.00.00\r
43         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
44         Sat, 17 Aug 2013 05:11:32 -0700 (PDT)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH v3 1/8] cli: add --duplicate=N option to notmuch search\r
48 Date: Sat, 17 Aug 2013 15:11:26 +0300\r
49 Message-Id:\r
50  <bbe225e1cc50211258f85a8533a83093337bde3f.1376741447.git.jani@nikula.org>\r
51 X-Mailer: git-send-email 1.7.10.4\r
52 In-Reply-To: <cover.1376741447.git.jani@nikula.org>\r
53 References: <cover.1376741447.git.jani@nikula.org>\r
54 In-Reply-To: <cover.1376741447.git.jani@nikula.org>\r
55 References: <cover.1376741447.git.jani@nikula.org>\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Sat, 17 Aug 2013 12:11:41 -0000\r
69 \r
70 Effective with --output=files, output the Nth filename associated with\r
71 each message matching the query (N is 1-based). If N is greater than\r
72 the number of files associated with the message, don't print anything.\r
73 \r
74 ---\r
75 \r
76 v3: fix commit message, no other changes\r
77 ---\r
78  notmuch-search.c |   18 ++++++++++++------\r
79  1 file changed, 12 insertions(+), 6 deletions(-)\r
80 \r
81 diff --git a/notmuch-search.c b/notmuch-search.c\r
82 index a96f07d..d9d39ec 100644\r
83 --- a/notmuch-search.c\r
84 +++ b/notmuch-search.c\r
85 @@ -177,7 +177,8 @@ do_search_messages (sprinter_t *format,\r
86                     notmuch_query_t *query,\r
87                     output_t output,\r
88                     int offset,\r
89 -                   int limit)\r
90 +                   int limit,\r
91 +                   int dupe)\r
92  {\r
93      notmuch_message_t *message;\r
94      notmuch_messages_t *messages;\r
95 @@ -206,14 +207,17 @@ do_search_messages (sprinter_t *format,\r
96         message = notmuch_messages_get (messages);\r
97  \r
98         if (output == OUTPUT_FILES) {\r
99 +           int j;\r
100             filenames = notmuch_message_get_filenames (message);\r
101  \r
102 -           for (;\r
103 +           for (j = 1;\r
104                  notmuch_filenames_valid (filenames);\r
105 -                notmuch_filenames_move_to_next (filenames))\r
106 +                notmuch_filenames_move_to_next (filenames), j++)\r
107             {\r
108 -               format->string (format, notmuch_filenames_get (filenames));\r
109 -               format->separator (format);\r
110 +               if (dupe < 0 || dupe == j) {\r
111 +                   format->string (format, notmuch_filenames_get (filenames));\r
112 +                   format->separator (format);\r
113 +               }\r
114             }\r
115             \r
116             notmuch_filenames_destroy( filenames );\r
117 @@ -296,6 +300,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
118      int offset = 0;\r
119      int limit = -1; /* unlimited */\r
120      notmuch_exclude_t exclude = NOTMUCH_EXCLUDE_TRUE;\r
121 +    int dupe = -1;\r
122      unsigned int i;\r
123  \r
124      enum {\r
125 @@ -332,6 +337,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
126                                    { 0, 0 } } },\r
127         { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },\r
128         { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0  },\r
129 +       { NOTMUCH_OPT_INT, &dupe, "duplicate", 'D', 0  },\r
130         { 0, 0, 0, 0, 0 }\r
131      };\r
132  \r
133 @@ -414,7 +420,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
134         break;\r
135      case OUTPUT_MESSAGES:\r
136      case OUTPUT_FILES:\r
137 -       ret = do_search_messages (format, query, output, offset, limit);\r
138 +       ret = do_search_messages (format, query, output, offset, limit, dupe);\r
139         break;\r
140      case OUTPUT_TAGS:\r
141         ret = do_search_tags (notmuch, format, query);\r
142 -- \r
143 1.7.10.4\r
144 \r