Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / c8 / 2d133699c14603d0b19b44ca4c0ab420d60a5b
1 Return-Path: <bremner@tesseract.cs.unb.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 arlo.cworth.org (Postfix) with ESMTP id 639416DE00C9\r
6  for <notmuch@notmuchmail.org>; Wed, 29 Jun 2016 13:34:38 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.005\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5\r
12  tests=[AWL=-0.006, HEADER_FROM_DIFFERENT_DOMAINS=0.001]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id dYtzWPiOuhjI for <notmuch@notmuchmail.org>;\r
17  Wed, 29 Jun 2016 13:34:30 -0700 (PDT)\r
18 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
19  by arlo.cworth.org (Postfix) with ESMTPS id 99F566DE00BF\r
20  for <notmuch@notmuchmail.org>; Wed, 29 Jun 2016 13:34:30 -0700 (PDT)\r
21 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
22  (envelope-from <bremner@tesseract.cs.unb.ca>)\r
23  id 1bIMBV-0007VG-Tx; Wed, 29 Jun 2016 16:34:09 -0400\r
24 Received: (nullmailer pid 2609 invoked by uid 1000);\r
25  Wed, 29 Jun 2016 20:34:24 -0000\r
26 From: David Bremner <david@tethera.net>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [RFC PATCH] cli/search: interpret no search terms as synonym for '*'\r
29 Date: Wed, 29 Jun 2016 22:34:06 +0200\r
30 Message-Id: <1467232446-2442-1-git-send-email-david@tethera.net>\r
31 X-Mailer: git-send-email 2.8.1\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.20\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36  <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
38  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
43  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Wed, 29 Jun 2016 20:34:38 -0000\r
45 \r
46 This is a bit less typing (and escaping), especially for the\r
47 --output=tags case.\r
48 ---\r
49 \r
50 I started merrily on other commands, but I'm not so sure. For example\r
51 "git annex metadata" has the feature of interpreting missing file name\r
52 as all files and I find it super irritating in general because I keep\r
53 adding tags to all files. Hence RFC.\r
54 \r
55  notmuch-search.c | 7 ++-----\r
56  1 file changed, 2 insertions(+), 5 deletions(-)\r
57 \r
58 diff --git a/notmuch-search.c b/notmuch-search.c\r
59 index 8c65d5a..a7e397c 100644\r
60 --- a/notmuch-search.c\r
61 +++ b/notmuch-search.c\r
62 @@ -625,7 +625,8 @@ do_search_tags (const search_context_t *ctx)\r
63       * specified? */\r
64  \r
65      /* Special-case query of "*" for better performance. */\r
66 -    if (strcmp (notmuch_query_get_query_string (query), "*") == 0) {\r
67 +    if (strcmp (notmuch_query_get_query_string (query), "*") == 0 ||\r
68 +       strlen (notmuch_query_get_query_string (query)) == 0) {\r
69         tags = notmuch_database_get_all_tags (notmuch);\r
70      } else {\r
71         notmuch_status_t status;\r
72 @@ -711,10 +712,6 @@ _notmuch_search_prepare (search_context_t *ctx, notmuch_config_t *config, int ar\r
73         fprintf (stderr, "Out of memory.\n");\r
74         return EXIT_FAILURE;\r
75      }\r
76 -    if (*query_str == '\0') {\r
77 -       fprintf (stderr, "Error: notmuch search requires at least one search term.\n");\r
78 -       return EXIT_FAILURE;\r
79 -    }\r
80  \r
81      ctx->query = notmuch_query_create (ctx->notmuch, query_str);\r
82      if (ctx->query == NULL) {\r
83 -- \r
84 2.8.1\r
85 \r