emacs-hello: Do not calculate the count of the messages in hidden sections

The result is that hello screen shows much faster when some sections are
hidden.
This commit is contained in:
Michal Sojka 2012-02-18 23:12:29 +01:00 committed by David Bremner
parent 4b3af0e444
commit 4a0740920d

View file

@ -695,16 +695,16 @@ Supports the following entries in OPTIONS as a plist:
(notmuch-hello-update)) (notmuch-hello-update))
"hide")) "hide"))
(widget-insert "\n") (widget-insert "\n")
(let (target-pos (let (target-pos)
(searches (apply 'notmuch-hello-query-counts query-alist options))) (when (not is-hidden)
(when (and (not is-hidden) (let ((searches (apply 'notmuch-hello-query-counts query-alist options)))
(or (not (plist-get options :hide-if-empty)) (when (or (not (plist-get options :hide-if-empty))
searches)) searches)
(widget-insert "\n") (widget-insert "\n")
(setq target-pos (setq target-pos
(notmuch-hello-insert-buttons searches)) (notmuch-hello-insert-buttons searches))
(indent-rigidly start (point) notmuch-hello-indent) (indent-rigidly start (point) notmuch-hello-indent))))
target-pos)))) target-pos)))
(defun notmuch-hello-insert-tags-section (&optional title &rest options) (defun notmuch-hello-insert-tags-section (&optional title &rest options)
"Insert a section displaying all tags with message counts. "Insert a section displaying all tags with message counts.