X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-hello.el;h=5d601acf4da0aca87677005d7158a458075fb6fc;hb=ca5ae54cb1aa91dc2c3ba9372d70d6fa080851d8;hp=09bc6b7203f27f7efe0952c8c93cc255f3a7e311;hpb=7fa6306cae69ed56c15f0a233c2c3318a5573372;p=notmuch diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 09bc6b72..5d601acf 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -57,6 +57,11 @@ :type 'boolean :group 'notmuch) +(defcustom notmuch-hello-show-tags nil + "Should all tags be shown in the notmuch-hello view?" + :type 'boolean + :group 'notmuch) + (defface notmuch-hello-logo-background '((((class color) (background dark)) @@ -163,14 +168,13 @@ diagonal." ;; (not elem) indicates an empty slot in the matrix. (when elem (widget-insert (format "%6s " (notmuch-folder-count (cdr elem)))) - (if (string= (car elem) target) - (progn - (setq found-target-pos (point-marker)))) + (if (string= (format "%s " (car elem)) target) + (setq found-target-pos (point-marker))) (widget-create 'push-button :notify #'notmuch-hello-widget-search :notmuch-search-terms (cdr elem) - (car elem)) - (insert (make-string (- widest (length (car elem))) ? ))) + (format "%s " (car elem))) + (insert (make-string (1- (- widest (length (car elem)))) ? ))) (setq count (1+ count)) (if (eq (% count tags-per-line) 0) (widget-insert "\n")))) @@ -339,12 +343,26 @@ diagonal." (indent-rigidly start (point) notmuch-hello-indent))) (when alltags-alist - (widget-insert "\nAll tags:\n\n") - (let ((start (point))) - (setq found-target-pos (notmuch-hello-insert-tags alltags-alist widest target)) - (if (not final-target-pos) - (setq final-target-pos found-target-pos)) - (indent-rigidly start (point) notmuch-hello-indent)))) + (if notmuch-hello-show-tags + (progn + (widget-insert "\nAll tags: ") + (widget-create 'push-button + :notify (lambda (widget &rest ignore) + (setq notmuch-hello-show-tags nil) + (notmuch-hello-update)) + "hide") + (widget-insert "\n\n") + (let ((start (point))) + (setq found-target-pos (notmuch-hello-insert-tags alltags-alist widest target)) + (if (not final-target-pos) + (setq final-target-pos found-target-pos)) + (indent-rigidly start (point) notmuch-hello-indent))) + (widget-insert "\n") + (widget-create 'push-button + :notify (lambda (widget &rest ignore) + (setq notmuch-hello-show-tags t) + (notmuch-hello-update)) + "Show all tags")))) (let ((start (point))) (widget-insert "\n\n")