Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 93DB94196F0 for ; Tue, 27 Apr 2010 03:04:44 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8YMvOV9oJ1HT for ; Tue, 27 Apr 2010 03:04:43 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id 90668431FC1 for ; Tue, 27 Apr 2010 03:04:43 -0700 (PDT) Received: by wyj26 with SMTP id 26so1347375wyj.26 for ; Tue, 27 Apr 2010 03:04:42 -0700 (PDT) Received: by 10.216.186.10 with SMTP id v10mr6447984wem.111.1272362682529; Tue, 27 Apr 2010 03:04:42 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id r29sm4356782wbv.9.2010.04.27.03.04.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Apr 2010 03:04:41 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 71F7C59413B; Tue, 27 Apr 2010 11:04:55 +0100 (BST) From: dme@dme.org To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: If 'all tags' is not shown, don't use it when calculating widths. Date: Tue, 27 Apr 2010 11:04:36 +0100 Message-Id: <1272362677-22492-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2010 10:04:44 -0000 From: David Edmondson 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. --- emacs/notmuch-hello.el | 38 ++++++++++++++++++++------------------ 1 files changed, 20 insertions(+), 18 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 50d8911..1b59ef1 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") -- 1.7.0