[PATCH] emacs-hello: Do not calculate the count of the messages in hidden sections
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 18 Feb 2012 22:12:29 +0000 (23:12 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:39 +0000 (09:44 -0800)
53/52dff127639beda21700835bdf74ed38d7518c [new file with mode: 0644]

diff --git a/53/52dff127639beda21700835bdf74ed38d7518c b/53/52dff127639beda21700835bdf74ed38d7518c
new file mode 100644 (file)
index 0000000..ddc2912
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9BE83431FC0\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 14:13:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Rb7Y3vQtQ+nF for <notmuch@notmuchmail.org>;\r
+       Sat, 18 Feb 2012 14:13:06 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 26F19431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Feb 2012 14:13:06 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 4393019F3418;\r
+       Sat, 18 Feb 2012 23:13:05 +0100 (CET)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id pFWiD1gcsbSi; Sat, 18 Feb 2012 23:13:04 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 2F44D19F340C;\r
+       Sat, 18 Feb 2012 23:13:04 +0100 (CET)\r
+Received: from steelpick.2x.cz (unknown [213.29.198.144])\r
+       (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id 19E8B660968;\r
+       Sat, 18 Feb 2012 23:13:04 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.77)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1RysWZ-0001aD-6E; Sat, 18 Feb 2012 23:12:59 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs-hello: Do not calculate the count of the messages in\r
+       hidden sections\r
+Date: Sat, 18 Feb 2012 23:12:29 +0100\r
+Message-Id: <1329603149-6047-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.7.3\r
+In-Reply-To: <874nunokr5.fsf@steelpick.2x.cz>\r
+References: <874nunokr5.fsf@steelpick.2x.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 18 Feb 2012 22:13:06 -0000\r
+\r
+The result is that hello screen shows much faster when some sections are\r
+hidden.\r
+---\r
+ emacs/notmuch-hello.el |   20 ++++++++++----------\r
+ 1 files changed, 10 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
+index aad373d..e9caade 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -695,16 +695,16 @@ Supports the following entries in OPTIONS as a plist:\r
+                               (notmuch-hello-update))\r
+                    "hide"))\r
+     (widget-insert "\n")\r
+-    (let (target-pos\r
+-        (searches (apply 'notmuch-hello-query-counts query-alist options)))\r
+-      (when (and (not is-hidden)\r
+-             (or (not (plist-get options :hide-if-empty))\r
+-                searches))\r
+-      (widget-insert "\n")\r
+-      (setq target-pos\r
+-            (notmuch-hello-insert-buttons searches))\r
+-      (indent-rigidly start (point) notmuch-hello-indent)\r
+-      target-pos))))\r
++    (let (target-pos)\r
++      (when (not is-hidden)\r
++      (let ((searches (apply 'notmuch-hello-query-counts query-alist options)))\r
++        (when (or (not (plist-get options :hide-if-empty))\r
++                  searches)\r
++          (widget-insert "\n")\r
++          (setq target-pos\r
++                (notmuch-hello-insert-buttons searches))\r
++          (indent-rigidly start (point) notmuch-hello-indent))))\r
++      target-pos)))\r
+ \r
+ (defun notmuch-hello-insert-tags-section (&optional title &rest options)\r
+   "Insert a section displaying all tags with message counts.\r
+-- \r
+1.7.7.3\r
+\r