]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: notmuch-hello: Make viewing of all tags conditional.
authorCarl Worth <cworth@cworth.org>
Tue, 27 Apr 2010 03:06:50 +0000 (20:06 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 27 Apr 2010 03:08:30 +0000 (20:08 -0700)
And off by default. There's a notmuch-hello-show-tags option in
customize to toggle the default setting, as well as buttons to
persistently toggle the visibility for the current session.

I have enough tags in my database that it's quite a bit faster for
notmuch-hello to come up without showing the tags.

emacs/notmuch-hello.el

index 09bc6b7203f27f7efe0952c8c93cc255f3a7e311..936d5466cad153c8462122b551ac353157d16c1e 100644 (file)
   :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))
@@ -339,12 +344,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")