aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-hello.el
diff options
context:
space:
mode:
authorGravatar David Edmondson <dme@dme.org>2010-04-27 11:04:36 +0100
committerGravatar Carl Worth <cworth@cworth.org>2010-04-27 08:19:39 -0700
commit18d41192d2cf0c71045c2f6420eb2311553f58b4 (patch)
treee32e78c2fad7b308da310d12ce652537b946f2eb /emacs/notmuch-hello.el
parent107f58d517e733c53e9d669457db34622337931d (diff)
emacs: If 'all tags' is not shown, don't use it when calculating widths.
If the 'all tags' section of the hello buffer will not be shown, don't consider those tags when determining the number of saved searches that can be displayed on a single line.
Diffstat (limited to 'emacs/notmuch-hello.el')
-rw-r--r--emacs/notmuch-hello.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index 50d89110..1b59ef19 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -284,8 +284,9 @@ diagonal."
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)))
- (process-lines notmuch-command "search-tags")))
+ (alltags-alist (if notmuch-show-all-tags-list
+ (mapcar '(lambda (tag) (cons tag (concat "tag:" tag)))
+ (process-lines notmuch-command "search-tags"))))
(alltags-widest (notmuch-hello-longest-label alltags-alist))
(widest (max saved-widest alltags-widest)))
@@ -360,26 +361,27 @@ diagonal."
(indent-rigidly start (point) notmuch-hello-indent)))
(when alltags-alist
- (if notmuch-show-all-tags-list
- (progn
- (widget-insert "\nAll tags: ")
- (widget-create 'push-button
- :notify (lambda (widget &rest ignore)
- (setq notmuch-show-all-tags-list 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-insert "\nAll tags: ")
+ (widget-create 'push-button
+ :notify (lambda (widget &rest ignore)
+ (setq notmuch-show-all-tags-list 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")
+
+ (if (not notmuch-show-all-tags-list)
(widget-create 'push-button
:notify (lambda (widget &rest ignore)
(setq notmuch-show-all-tags-list t)
(notmuch-hello-update))
- "Show all tags"))))
+ "Show all tags")))
(let ((start (point)))
(widget-insert "\n\n")