From b6d2c91f69869a38dcbabc636c30887733e0436d Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 18 Feb 2012 23:12:29 +0100 Subject: [PATCH] [PATCH] emacs-hello: Do not calculate the count of the messages in hidden sections --- 53/52dff127639beda21700835bdf74ed38d7518c | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 53/52dff127639beda21700835bdf74ed38d7518c diff --git a/53/52dff127639beda21700835bdf74ed38d7518c b/53/52dff127639beda21700835bdf74ed38d7518c new file mode 100644 index 000000000..ddc291202 --- /dev/null +++ b/53/52dff127639beda21700835bdf74ed38d7518c @@ -0,0 +1,100 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 9BE83431FC0 + for ; Sat, 18 Feb 2012 14:13:06 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 Rb7Y3vQtQ+nF for ; + Sat, 18 Feb 2012 14:13:06 -0800 (PST) +Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) + by olra.theworths.org (Postfix) with ESMTP id 26F19431FAE + for ; Sat, 18 Feb 2012 14:13:06 -0800 (PST) +Received: from localhost (unknown [192.168.200.4]) + by max.feld.cvut.cz (Postfix) with ESMTP id 4393019F3418; + Sat, 18 Feb 2012 23:13:05 +0100 (CET) +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 pFWiD1gcsbSi; Sat, 18 Feb 2012 23:13:04 +0100 (CET) +Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) + by max.feld.cvut.cz (Postfix) with ESMTP id 2F44D19F340C; + Sat, 18 Feb 2012 23:13:04 +0100 (CET) +Received: from steelpick.2x.cz (unknown [213.29.198.144]) + (Authenticated sender: sojkam1) + by imap.feld.cvut.cz (Postfix) with ESMTPSA id 19E8B660968; + Sat, 18 Feb 2012 23:13:04 +0100 (CET) +Received: from wsh by steelpick.2x.cz with local (Exim 4.77) + (envelope-from ) + id 1RysWZ-0001aD-6E; Sat, 18 Feb 2012 23:12:59 +0100 +From: Michal Sojka +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs-hello: Do not calculate the count of the messages in + hidden sections +Date: Sat, 18 Feb 2012 23:12:29 +0100 +Message-Id: <1329603149-6047-1-git-send-email-sojkam1@fel.cvut.cz> +X-Mailer: git-send-email 1.7.7.3 +In-Reply-To: <874nunokr5.fsf@steelpick.2x.cz> +References: <874nunokr5.fsf@steelpick.2x.cz> +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: Sat, 18 Feb 2012 22:13:06 -0000 + +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 aad373d..e9caade 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -695,16 +695,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 with message counts. +-- +1.7.7.3 + -- 2.26.2