From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id DDEAE431FD0 for ; Thu, 13 Oct 2011 07:09:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 355vwpw8HKI2 for ; Thu, 13 Oct 2011 07:09:32 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 4036D431FB6 for ; Thu, 13 Oct 2011 07:09:32 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id D5AAD3CFE71; Thu, 13 Oct 2011 16:09:30 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id P0n5IItpboi5; Thu, 13 Oct 2011 16:09:26 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id B912519F331D; Thu, 13 Oct 2011 16:09:24 +0200 (CEST) Received: from steelpick.2x.cz (unknown [141.76.49.12]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 92827FA00F; Thu, 13 Oct 2011 16:09:23 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.76) (envelope-from ) id 1RELyN-0006Tk-2X; Thu, 13 Oct 2011 16:09:23 +0200 From: Michal Sojka To: Daniel Schoepe , notmuch@notmuchmail.org Subject: [PATCH] emacs-hello: Do not calculate the count of the messages in In-Reply-To: <1318253982-23588-1-git-send-email-daniel@schoepe.org> References: <87ippzysmv.fsf@steelpick.2x.cz> <1318253982-23588-1-git-send-email-daniel@schoepe.org> User-Agent: Notmuch/0.8-40-g6eb7026 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 13 Oct 2011 16:09:23 +0200 Message-ID: <87fwixasq4.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2011 14:09:33 -0000 On Mon, 10 Oct 2011, Daniel Schoepe wrote: > Fixed that and rebased against master. Hi Daniel, I've an improvement for your patches. Recently, I decided to speed up notmuch hello startup times and I found that hiding a section does not eliminate the execution of "notmuch count" commands for buttons in the hidden section. The following patch (applies on top of v5) should fix it. Now I can enjoy blazingly fast notmuch startup, because I have only one section shown. :-) Another improvement could be the addition of [hide] button for saved searches sections. Cheers, -Michal --8<---------------cut here---------------start------------->8--- The result is that hello screen shows much faster when some sections are hidden. --- emacs/notmuch-hello.el | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 1f51281..9dcd0f9 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -653,16 +653,16 @@ Supports the following entries in OPTIONS as a plist: (notmuch-hello-update)) "hide")) (widget-insert "\n") - (let (target-pos - (searches (apply 'notmuch-hello-query-counts query-alist options))) - (when (and (not is-hidden) - (or (not (plist-get options :hide-if-empty)) - searches)) - (widget-insert "\n") - (setq target-pos - (notmuch-hello-insert-buttons searches)) - (indent-rigidly start (point) notmuch-hello-indent) - target-pos)))) + (let (target-pos) + (when (not is-hidden) + (let ((searches (apply 'notmuch-hello-query-counts query-alist options))) + (when (or (not (plist-get options :hide-if-empty)) + searches) + (widget-insert "\n") + (setq target-pos + (notmuch-hello-insert-buttons searches)) + (indent-rigidly start (point) notmuch-hello-indent)))) + target-pos))) (defun notmuch-hello-insert-tags-section (&optional title &rest options) "Insert a section displaying all tags and message counts for each. -- 1.7.5.4 --8<---------------cut here---------------end--------------->8---