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 9B65D431FC1 for ; Thu, 3 Jun 2010 23:38:08 -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 exRwSez3qCl3 for ; Thu, 3 Jun 2010 23:37:52 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id CE0A44196F0 for ; Thu, 3 Jun 2010 23:37:51 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 33BF119F33AB; Fri, 4 Jun 2010 08:37:51 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id tbpWisIMg7XS; Fri, 4 Jun 2010 08:37:49 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id B0DCB19F33A4; Fri, 4 Jun 2010 08:37:49 +0200 (CEST) Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 9C152106001; Fri, 4 Jun 2010 08:37:49 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.71) (envelope-from ) id 1OKQXN-0004Su-EU; Fri, 04 Jun 2010 08:37:49 +0200 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH RFC] notmuch-hello: What's in your inbox Date: Fri, 4 Jun 2010 08:37:29 +0200 Message-Id: <1275633449-17134-1-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1.3.g75e44 In-Reply-To: <87wrufjocx.fsf@steelpick.2x.cz> References: <87wrufjocx.fsf@steelpick.2x.cz> 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: Fri, 04 Jun 2010 06:38:09 -0000 Hello, I found myself very often adding something like 'tag:inbox and ...' to the saved searches. I want my messages to be tagged by mailing list so whenever I subscribe to a new mailing list I have to update both the tagging script and saved searches. This work duplication doesn't seem ideal for me so here is a patch, which shows a section "What's in your inbox" in notmuch-hello screen. This section contains all tags of messages that are tagged by "inbox". It would be nice to have some configuration for the "What's in your inbox" section - for example to specify which tags are not interesting for me (e.g. unread). I'm not sure whether the patch applies to recent dme's notmuch-hello updates. If not, I'll rebase it as soon as these patches appear in master. Signed-off-by: Michal Sojka --- emacs/notmuch-hello.el | 39 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 37 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 6a1c56e..e61f37a 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -55,6 +55,11 @@ :type 'boolean :group 'notmuch) +(defcustom notmuch-show-inbox-tags-list nil + "Should all tags in your inbox be shown in the notmuch-hello view?" + :type 'boolean + :group 'notmuch) + (defface notmuch-hello-logo-background '((((class color) (background dark)) @@ -289,7 +294,36 @@ diagonal." (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))) + (inboxtags-alist (if notmuch-show-inbox-tags-list + (mapcar '(lambda (tag) (cons tag (concat "tag:inbox and tag:" tag))) + (process-lines notmuch-command "search-tags" "tag:inbox")))) + (inboxtags-widest (notmuch-hello-longest-label inboxtags-alist)) + (widest (max saved-widest alltags-widest inboxtags-widest))) + + + (when inboxtags-alist + (widget-insert "What's in your inbox: ") + (widget-create 'push-button + :notify (lambda (widget &rest ignore) + (setq notmuch-show-inbox-tags-list nil) + (notmuch-hello-update)) + "hide") + (widget-insert "\n\n") + (setq final-target-pos (point-marker)) + (let ((start (point))) + (setq found-target-pos (notmuch-hello-insert-tags inboxtags-alist widest target)) + (if (not final-target-pos) + (setq final-target-pos found-target-pos)) + (indent-rigidly start (point) notmuch-hello-indent))) + + (when (not notmuch-show-inbox-tags-list) + (widget-create 'push-button + :notify (lambda (widget &rest ignore) + (setq notmuch-show-inbox-tags-list t) + (notmuch-hello-update)) + "Show tags in your inbox") + (widget-insert "\n")) + (widget-insert "\n") (when saved-alist (widget-insert "Saved searches: ") @@ -297,8 +331,9 @@ diagonal." :notify (lambda (&rest ignore) (customize-variable 'notmuch-saved-searches)) "edit") + (if (not final-target-pos) + (setq final-target-pos (point-marker))) (widget-insert "\n\n") - (setq final-target-pos (point-marker)) (let ((start (point))) (setq found-target-pos (notmuch-hello-insert-tags saved-alist widest target)) (if found-target-pos -- tg: (1d528f8..) t/emacs-what-is-in-your-inbox (depends on: master)