[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 48 / 822279a089ce5db2ecf4e2dbcaacf8114ab193
1 Return-Path: <markwalters1009@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 5C7B9431FBC\r
6         for <notmuch@notmuchmail.org>; Tue, 15 Jan 2013 15:24:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.201\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id NM3jYqrmEPFH for <notmuch@notmuchmail.org>;\r
18         Tue, 15 Jan 2013 15:24:11 -0800 (PST)\r
19 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com\r
20         [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id B0E17431FAE\r
23         for <notmuch@notmuchmail.org>; Tue, 15 Jan 2013 15:24:11 -0800 (PST)\r
24 Received: by mail-wi0-f178.google.com with SMTP id hn3so687148wib.11\r
25         for <notmuch@notmuchmail.org>; Tue, 15 Jan 2013 15:24:09 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references; bh=2fS2ELl3uvqs/i0b+xLLBZAm4YQmyFSvmKAiY5TJZps=;\r
29         b=uGg64Y4hyl3XBmRlAhCfk7DmY2WWoiSU3evww04gAcUxQDXfptAFwzImFRNCAc5Tkb\r
30         igTjnD2LZDFlNhAL/zwatUftLAxHyR5ZO6HP7xDezlK+sb+tL5jUyNJyfevxCObuGZHN\r
31         JqiCAbo0/4aXJlE4mIJZoey99SQj5lbu/IvksE3wjqDCtlAaUFFCG6/ZrE2BCDsh+RwL\r
32         TipbgJOyMr58niR92yLrcTq6qhjqRBjzPFNjGI5u1IIFb8N9G7r8sYSb0cBOqu0pYsJx\r
33         cCQ8EnOsuq1hQCyGIM7SUZ0vagEPK4FAFnYMuIDq1wgXky+uP39ZyzuPnbIbEOgxaJNc\r
34         4E3g==\r
35 X-Received: by 10.180.78.226 with SMTP id e2mr6459679wix.1.1358292249118;\r
36         Tue, 15 Jan 2013 15:24:09 -0800 (PST)\r
37 Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
38         by mx.google.com with ESMTPS id t17sm6071706wiv.6.2013.01.15.15.24.07\r
39         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
40         Tue, 15 Jan 2013 15:24:08 -0800 (PST)\r
41 From: Mark Walters <markwalters1009@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH] emacs: hello: use batch count\r
44 Date: Tue, 15 Jan 2013 23:24:07 +0000\r
45 Message-Id: <1358292247-2059-1-git-send-email-markwalters1009@gmail.com>\r
46 X-Mailer: git-send-email 1.7.9.1\r
47 In-Reply-To: <cover.1358273133.git.jani@nikula.org>\r
48 References: <cover.1358273133.git.jani@nikula.org>\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Tue, 15 Jan 2013 23:24:12 -0000\r
62 \r
63 This modifies notmuch hello to use the new count --batch\r
64 functionality. It should give exactly the same results as before but\r
65 under many conditions it should be much faster. In particular it is\r
66 much faster for remote use.\r
67 \r
68 The code is a little ugly as it has to do some working out of the\r
69 query when asking the query and some when dealing with the result.\r
70 However, the code path is exactly the same in both local and remote\r
71 use.\r
72 ---\r
73 \r
74 It's a little ugly but seems to work and does give a useful speedup.\r
75 \r
76 Best wishes\r
77 \r
78 Mark\r
79 \r
80  emacs/notmuch-hello.el |   52 +++++++++++++++++++++++++++++------------------\r
81  1 files changed, 32 insertions(+), 20 deletions(-)\r
82 \r
83 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
84 index 6db62a0..2244892 100644\r
85 --- a/emacs/notmuch-hello.el\r
86 +++ b/emacs/notmuch-hello.el\r
87 @@ -381,26 +381,38 @@ The result is the list of elements of the form (NAME QUERY COUNT).\r
88  The values :show-empty-searches, :filter and :filter-count from\r
89  options will be handled as specified for\r
90  `notmuch-hello-insert-searches'."\r
91 -  (notmuch-remove-if-not\r
92 -   #'identity\r
93 -   (mapcar\r
94 -    (lambda (elem)\r
95 -      (let* ((name (car elem))\r
96 -            (query-and-count (if (consp (cdr elem))\r
97 -                                 ;; do we have a different query for the message count?\r
98 -                                 (cons (second elem) (third elem))\r
99 -                               (cons (cdr elem) (cdr elem))))\r
100 -            (message-count\r
101 -             (string-to-number\r
102 -              (notmuch-saved-search-count\r
103 -               (notmuch-hello-filtered-query (cdr query-and-count)\r
104 -                                             (or (plist-get options :filter-count)\r
105 -                                                (plist-get options :filter)))))))\r
106 -       (and (or (plist-get options :show-empty-searches) (> message-count 0))\r
107 -            (list name (notmuch-hello-filtered-query\r
108 -                        (car query-and-count) (plist-get options :filter))\r
109 -                  message-count))))\r
110 -    query-alist)))\r
111 +  (with-temp-buffer\r
112 +    (dolist (elem query-alist nil)\r
113 +      (let ((count-query (if (consp (cdr elem))\r
114 +                            ;; do we have a different query for the message count?\r
115 +                            (third elem)\r
116 +                          (cdr elem))))\r
117 +       (insert\r
118 +        (notmuch-hello-filtered-query count-query\r
119 +                                      (or (plist-get options :filter-count)\r
120 +                                          (plist-get options :filter)))\r
121 +        "\n")))\r
122 +\r
123 +    (call-process-region (point-min) (point-max) notmuch-command\r
124 +                        t t nil "count" "--batch")\r
125 +    (goto-char (point-min))\r
126 +\r
127 +    (notmuch-remove-if-not\r
128 +     #'identity\r
129 +     (mapcar\r
130 +      (lambda (elem)\r
131 +       (let ((name (car elem))\r
132 +             (search-query (if (consp (cdr elem))\r
133 +                                ;; do we have a different query for the message count?\r
134 +                                (second elem)\r
135 +                             (cdr elem)))\r
136 +             (message-count (prog1 (read (current-buffer))\r
137 +                               (forward-line 1))))\r
138 +         (and (or (plist-get options :show-empty-searches) (> message-count 0))\r
139 +              (list name (notmuch-hello-filtered-query\r
140 +                          search-query (plist-get options :filter))\r
141 +                    message-count))))\r
142 +      query-alist))))\r
143  \r
144  (defun notmuch-hello-insert-buttons (searches)\r
145    "Insert buttons for SEARCHES.\r
146 -- \r
147 1.7.9.1\r
148 \r