Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 1c / 607b8e174c5ab2fcec5dd13751af8617fcb7fb
1 Return-Path: <sojka@os.inf.tu-dresden.de>\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 DDEAE431FD0\r
6         for <notmuch@notmuchmail.org>; Thu, 13 Oct 2011 07:09:32 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 355vwpw8HKI2 for <notmuch@notmuchmail.org>;\r
16         Thu, 13 Oct 2011 07:09:32 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 4036D431FB6\r
19         for <notmuch@notmuchmail.org>; Thu, 13 Oct 2011 07:09:32 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id D5AAD3CFE71;\r
22         Thu, 13 Oct 2011 16:09:30 +0200 (CEST)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id P0n5IItpboi5; Thu, 13 Oct 2011 16:09:26 +0200 (CEST)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id B912519F331D;\r
30         Thu, 13 Oct 2011 16:09:24 +0200 (CEST)\r
31 Received: from steelpick.2x.cz (unknown [141.76.49.12])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id 92827FA00F;\r
34         Thu, 13 Oct 2011 16:09:23 +0200 (CEST)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.76)\r
36         (envelope-from <sojka@os.inf.tu-dresden.de>)\r
37         id 1RELyN-0006Tk-2X; Thu, 13 Oct 2011 16:09:23 +0200\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: Daniel Schoepe <daniel@schoepe.org>, notmuch@notmuchmail.org\r
40 Subject: [PATCH] emacs-hello: Do not calculate the count of the messages in\r
41 In-Reply-To: <1318253982-23588-1-git-send-email-daniel@schoepe.org>\r
42 References: <87ippzysmv.fsf@steelpick.2x.cz>\r
43         <1318253982-23588-1-git-send-email-daniel@schoepe.org>\r
44 User-Agent: Notmuch/0.8-40-g6eb7026 (http://notmuchmail.org) Emacs/23.3.1\r
45         (x86_64-pc-linux-gnu)\r
46 Date: Thu, 13 Oct 2011 16:09:23 +0200\r
47 Message-ID: <87fwixasq4.fsf@steelpick.2x.cz>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Thu, 13 Oct 2011 14:09:33 -0000\r
63 \r
64 On Mon, 10 Oct 2011, Daniel Schoepe wrote:\r
65 > Fixed that and rebased against master.\r
66 \r
67 Hi Daniel,\r
68 \r
69 I've an improvement for your patches. Recently, I decided to speed up\r
70 notmuch hello startup times and I found that hiding a section does not\r
71 eliminate the execution of "notmuch count" commands for buttons in the\r
72 hidden section. The following patch (applies on top of v5) should fix\r
73 it. Now I can enjoy blazingly fast notmuch startup, because I have only\r
74 one section shown. :-)\r
75 \r
76 Another improvement could be the addition of [hide] button for saved\r
77 searches sections.\r
78 \r
79 Cheers,\r
80 -Michal\r
81 \r
82 --8<---------------cut here---------------start------------->8---\r
83 The result is that hello screen shows much faster when some sections are\r
84 hidden.\r
85 ---\r
86  emacs/notmuch-hello.el |   20 ++++++++++----------\r
87  1 files changed, 10 insertions(+), 10 deletions(-)\r
88 \r
89 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
90 index 1f51281..9dcd0f9 100644\r
91 --- a/emacs/notmuch-hello.el\r
92 +++ b/emacs/notmuch-hello.el\r
93 @@ -653,16 +653,16 @@ Supports the following entries in OPTIONS as a plist:\r
94                                 (notmuch-hello-update))\r
95                      "hide"))\r
96      (widget-insert "\n")\r
97 -    (let (target-pos\r
98 -         (searches (apply 'notmuch-hello-query-counts query-alist options)))\r
99 -      (when (and (not is-hidden)\r
100 -              (or (not (plist-get options :hide-if-empty))\r
101 -                 searches))\r
102 -       (widget-insert "\n")\r
103 -       (setq target-pos\r
104 -             (notmuch-hello-insert-buttons searches))\r
105 -       (indent-rigidly start (point) notmuch-hello-indent)\r
106 -       target-pos))))\r
107 +    (let (target-pos)\r
108 +      (when (not is-hidden)\r
109 +       (let ((searches (apply 'notmuch-hello-query-counts query-alist options)))\r
110 +         (when (or (not (plist-get options :hide-if-empty))\r
111 +                   searches)\r
112 +           (widget-insert "\n")\r
113 +           (setq target-pos\r
114 +                 (notmuch-hello-insert-buttons searches))\r
115 +           (indent-rigidly start (point) notmuch-hello-indent))))\r
116 +      target-pos)))\r
117  \r
118  (defun notmuch-hello-insert-tags-section (&optional title &rest options)\r
119    "Insert a section displaying all tags and message counts for each.\r
120 -- \r
121 1.7.5.4\r
122 \r
123 --8<---------------cut here---------------end--------------->8---\r