]> git.notmuchmail.org Git - notmuch/commitdiff
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)
committerDavid Bremner <bremner@debian.org>
Sat, 10 Mar 2012 14:10:27 +0000 (10:10 -0400)
The result is that hello screen shows much faster when some sections are
hidden.

emacs/notmuch-hello.el

index aad373d6fbbae7d1d52fc9bd3e1180833ea1fe4d..e9caade5d4c1e6ad5fe2f6d76c63182d527c9212 100644 (file)
@@ -695,16 +695,16 @@ Supports the following entries in OPTIONS as a plist:
                                (notmuch-hello-update))
                     "hide"))
     (widget-insert "\n")
                                (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.
 
 (defun notmuch-hello-insert-tags-section (&optional title &rest options)
   "Insert a section displaying all tags with message counts.