Re: [PATCH] notmuch-emacs-mua: more options, some fixes
[notmuch-archives.git] / 33 / 0ae9adcd8f2ebb705cdec428f24809ed9b74e1
1 Return-Path: <bgamari.foss@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 4C375431FAE\r
6         for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:55 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \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 Vl2KMM2EP8Qm for <notmuch@notmuchmail.org>;\r
17         Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
18 Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com\r
19         [209.85.220.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 8A9AA431FBF\r
22         for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
23 Received: by mail-vc0-f181.google.com with SMTP id fl17so5583555vcb.26\r
24         for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
27         bh=az9Qwv40Z2OqKEgdkXyvezeHVtvJ8Qnzwp2JAfrcJ9U=;\r
28         b=mHGdxyopN8xF7p0yJGpxNMVHKc6LCu4QPUVMVQu9aBMPqxYNJ2SlEEOkUXUI+NgZWK\r
29         HAHiNlZ5rCI8Mtm0KD5fGyvUHHPOMOPwY1nFzTu6ZZLGltstoD7QJpEgsjWH5FooEpvC\r
30         E0LdkB7F5r3qj8SWrLBP9DtIvByBTxhOU8aVTWYlZresvG+F9yU8PBPE2a4aDY1KxJXU\r
31         1M7LcjJObjaxru6oj3baGX0IPhIqn2MLBNP2kwvz/E5Nzj/bGGDnrYmyckSoXvbWCKaD\r
32         pmzlxD95FrseiDmSduusUTXcUKIBk4TSGE6dKpKsXBuX6kcZKNcUzdwn0Qmxz5SpY9TI\r
33         N3ZQ==\r
34 Received: by 10.220.204.197 with SMTP id fn5mr10480519vcb.71.1345476714281;\r
35         Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
36 Received: from localhost.localdomain\r
37         (pool-108-8-230-85.spfdma.east.verizon.net. [108.8.230.85])\r
38         by mx.google.com with ESMTPS id g10sm5430786vdk.2.2012.08.20.08.31.53\r
39         (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 08:31:53 -0700 (PDT)\r
40 From: Ben Gamari <bgamari.foss@gmail.com>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH 2/3] Produce status messages during compacting\r
43 Date: Mon, 20 Aug 2012 11:31:43 -0400\r
44 Message-Id: <1345476704-17091-3-git-send-email-bgamari.foss@gmail.com>\r
45 X-Mailer: git-send-email 1.7.9.5\r
46 In-Reply-To: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com>\r
47 References: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com>\r
48 X-BeenThere: notmuch@notmuchmail.org\r
49 X-Mailman-Version: 2.1.13\r
50 Precedence: list\r
51 List-Id: "Use and development of the notmuch mail system."\r
52         <notmuch.notmuchmail.org>\r
53 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
55 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
56 List-Post: <mailto:notmuch@notmuchmail.org>\r
57 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
58 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
60 X-List-Received-Date: Mon, 20 Aug 2012 15:31:55 -0000\r
61 \r
62 ---\r
63  lib/database.cc |   15 ++++++++++++++-\r
64  1 file changed, 14 insertions(+), 1 deletion(-)\r
65 \r
66 diff --git a/lib/database.cc b/lib/database.cc\r
67 index 6e83a61..49aa36d 100644\r
68 --- a/lib/database.cc\r
69 +++ b/lib/database.cc\r
70 @@ -780,11 +780,24 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
71      notmuch->value_range_processor = NULL;\r
72  }\r
73  \r
74 +class NotmuchCompactor : public Xapian::Compactor\r
75 +{\r
76 +public:\r
77 +    virtual void\r
78 +    set_status (const std::string &table, const std::string &status)\r
79 +    {\r
80 +       if (status.length() == 0)\r
81 +           fprintf (stderr, "compacting table %s:\n", table.c_str());\r
82 +       else\r
83 +           fprintf (stderr, "     %s\n", status.c_str());\r
84 +    }\r
85 +};\r
86 +\r
87  void\r
88  notmuch_database_close_compact (notmuch_database_t *notmuch)\r
89  {\r
90      void *local = talloc_new (NULL);\r
91 -    Xapian::Compactor compactor;\r
92 +    NotmuchCompactor compactor;\r
93      char *notmuch_path, *xapian_path, *compact_xapian_path, *old_xapian_path;\r
94  \r
95  #if HAVE_XAPIAN_COMPACT\r
96 -- \r
97 1.7.9.5\r
98 \r