diff options
author | Carl Worth <cworth@cworth.org> | 2010-04-26 22:40:31 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-26 22:40:31 -0700 |
commit | fa5279113b8bc2d6f58d672867f980ef8f02a118 (patch) | |
tree | ea5b8098bda0160a27415b46223ded414205fc91 | |
parent | f1f7e71e0347672e0658362c513e49c05b0f4161 (diff) |
emacs: Fix notmuch-hello to use its own function for counting search results.
Previously, this was calling into a notmuch-folder-count
function. Only, everything related to notmuch-folder is about to go
away, so lets have notmuch-hello define its own function
(notmuch-saved-search-count) for this purpose.
-rw-r--r-- | emacs/notmuch-hello.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index bbeb5de..db2da9f 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -142,6 +142,9 @@ diagonal." notmuch-search-oldest-first nil nil #'notmuch-hello-search-continuation)) +(defun notmuch-saved-search-count (search) + (car (process-lines notmuch-command "count" search))) + (defun notmuch-hello-insert-tags (tag-alist widest target) (let* ((tags-per-line (max 1 (/ (- (window-width) notmuch-hello-indent) @@ -160,7 +163,7 @@ diagonal." do (progn ;; (not elem) indicates an empty slot in the matrix. (when elem - (widget-insert (format "%6s " (notmuch-folder-count (cdr elem)))) + (widget-insert (format "%6s " (notmuch-saved-search-count (cdr elem)))) (if (string= (format "%s " (car elem)) target) (setq found-target-pos (point-marker))) (widget-create 'push-button @@ -268,7 +271,7 @@ diagonal." (if notmuch-show-empty-saved-searches notmuch-saved-searches (loop for elem in notmuch-saved-searches - if (> (string-to-number (notmuch-folder-count (cdr elem))) 0) + if (> (string-to-number (notmuch-saved-search-count (cdr elem))) 0) collect elem))) (saved-widest (notmuch-hello-longest-label saved-alist)) (alltags-alist (mapcar '(lambda (tag) (cons tag (concat "tag:" tag))) |