Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 9a / 51c64965e0f93fd025481b4d2cd231cc5404a0
1 Return-Path: <bremner@tethera.net>\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 243CE6DE0FB1\r
6  for <notmuch@notmuchmail.org>; Tue, 12 Jan 2016 19:10:27 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.31\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.31 tagged_above=-999 required=5 tests=[AWL=0.241, \r
12  RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id L7FwuLIaFBQK for <notmuch@notmuchmail.org>;\r
16  Tue, 12 Jan 2016 19:10:25 -0800 (PST)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id 87FB36DE020B\r
19  for <notmuch@notmuchmail.org>; Tue, 12 Jan 2016 19:10:23 -0800 (PST)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1aJBp7-0000yT-6E; Tue, 12 Jan 2016 22:10:13 -0500\r
23 Received: (nullmailer pid 23102 invoked by uid 1000);\r
24  Wed, 13 Jan 2016 03:10:18 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [WIP2 3/4] CLI: add print_status_database\r
28 Date: Tue, 12 Jan 2016 23:10:09 -0400\r
29 Message-Id: <1452654610-22864-4-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.6.4\r
31 In-Reply-To: <1452654610-22864-1-git-send-email-david@tethera.net>\r
32 References: <1452654610-22864-1-git-send-email-david@tethera.net>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.20\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37  <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
39  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Wed, 13 Jan 2016 03:10:27 -0000\r
46 \r
47 This could probably be used at quite a few places in the existing code,\r
48 but in the immediate future I plan to use in some new code in\r
49 notmuch-dump\r
50 ---\r
51  notmuch-client.h |  5 +++++\r
52  status.c         | 17 +++++++++++++++++\r
53  2 files changed, 22 insertions(+)\r
54 \r
55 diff --git a/notmuch-client.h b/notmuch-client.h\r
56 index 3bd2903..7c9a1ea 100644\r
57 --- a/notmuch-client.h\r
58 +++ b/notmuch-client.h\r
59 @@ -459,6 +459,11 @@ print_status_query (const char *loc,\r
60                     const notmuch_query_t *query,\r
61                     notmuch_status_t status);\r
62  \r
63 +notmuch_status_t\r
64 +print_status_database (const char *loc,\r
65 +                      const notmuch_database_t *database,\r
66 +                      notmuch_status_t status);\r
67 +\r
68  #include "command-line-arguments.h"\r
69  \r
70  extern char *notmuch_requested_db_uuid;\r
71 diff --git a/status.c b/status.c\r
72 index 8fa81cb..45d3fb4 100644\r
73 --- a/status.c\r
74 +++ b/status.c\r
75 @@ -19,3 +19,20 @@ print_status_query (const char *loc,\r
76      }\r
77      return status;\r
78  }\r
79 +\r
80 +notmuch_status_t\r
81 +print_status_database (const char *loc,\r
82 +                   const notmuch_database_t *notmuch,\r
83 +                   notmuch_status_t status)\r
84 +{\r
85 +    if (status) {\r
86 +       const char *msg;\r
87 +\r
88 +       fprintf (stderr, "%s: %s\n", loc,\r
89 +                notmuch_status_to_string (status));\r
90 +       msg = notmuch_database_status_string (notmuch);\r
91 +       if (msg)\r
92 +           fputs (msg, stderr);\r
93 +    }\r
94 +    return status;\r
95 +}\r
96 -- \r
97 2.6.4\r
98 \r