[PATCH 06/10] cli: Introduce "notmuch address" command
[notmuch-archives.git] / 77 / 00e9d669f02fb5a542af04a3d00d879a0ef1c8
1 Return-Path: <sojkam1@fel.cvut.cz>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 9B65D431FC1\r
6         for <notmuch@notmuchmail.org>; Thu,  3 Jun 2010 23:38:08 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id exRwSez3qCl3 for <notmuch@notmuchmail.org>;\r
16         Thu,  3 Jun 2010 23:37:52 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id CE0A44196F0\r
19         for <notmuch@notmuchmail.org>; Thu,  3 Jun 2010 23:37:51 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id 33BF119F33AB;\r
22         Fri,  4 Jun 2010 08:37:51 +0200 (CEST)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id tbpWisIMg7XS; Fri,  4 Jun 2010 08:37:49 +0200 (CEST)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id B0DCB19F33A4;\r
30         Fri,  4 Jun 2010 08:37:49 +0200 (CEST)\r
31 Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id 9C152106001;\r
34         Fri,  4 Jun 2010 08:37:49 +0200 (CEST)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.71)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1OKQXN-0004Su-EU; Fri, 04 Jun 2010 08:37:49 +0200\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [PATCH RFC] notmuch-hello: What's in your inbox\r
41 Date: Fri,  4 Jun 2010 08:37:29 +0200\r
42 Message-Id: <1275633449-17134-1-git-send-email-sojkam1@fel.cvut.cz>\r
43 X-Mailer: git-send-email 1.7.1.3.g75e44\r
44 In-Reply-To: <87wrufjocx.fsf@steelpick.2x.cz>\r
45 References: <87wrufjocx.fsf@steelpick.2x.cz>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Fri, 04 Jun 2010 06:38:09 -0000\r
59 \r
60 Hello,\r
61 \r
62 I found myself very often adding something like 'tag:inbox and ...' to\r
63 the saved searches. I want my messages to be tagged by mailing list so\r
64 whenever I subscribe to a new mailing list I have to update both the\r
65 tagging script and saved searches. This work duplication doesn't seem\r
66 ideal for me so here is a patch, which shows a section "What's in your\r
67 inbox" in notmuch-hello screen. This section contains all tags of\r
68 messages that are tagged by "inbox".\r
69 \r
70 It would be nice to have some configuration for the "What's in your\r
71 inbox" section - for example to specify which tags are not interesting\r
72 for me (e.g. unread).\r
73 \r
74 I'm not sure whether the patch applies to recent dme's notmuch-hello\r
75 updates. If not, I'll rebase it as soon as these patches appear in\r
76 master.\r
77 \r
78 Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>\r
79 \r
80 ---\r
81  emacs/notmuch-hello.el |   39 +++++++++++++++++++++++++++++++++++++--\r
82  1 files changed, 37 insertions(+), 2 deletions(-)\r
83 \r
84 diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el\r
85 index 6a1c56e..e61f37a 100644\r
86 --- a/emacs/notmuch-hello.el\r
87 +++ b/emacs/notmuch-hello.el\r
88 @@ -55,6 +55,11 @@\r
89    :type 'boolean\r
90    :group 'notmuch)\r
91  \r
92 +(defcustom notmuch-show-inbox-tags-list nil\r
93 +  "Should all tags in your inbox be shown in the notmuch-hello view?"\r
94 +  :type 'boolean\r
95 +  :group 'notmuch)\r
96 +\r
97  (defface notmuch-hello-logo-background\r
98    '((((class color)\r
99        (background dark))\r
100 @@ -289,7 +294,36 @@ diagonal."\r
101                                 (mapcar '(lambda (tag) (cons tag (concat "tag:" tag)))\r
102                                         (process-lines notmuch-command "search-tags"))))\r
103              (alltags-widest (notmuch-hello-longest-label alltags-alist))\r
104 -            (widest (max saved-widest alltags-widest)))\r
105 +            (inboxtags-alist (if notmuch-show-inbox-tags-list\r
106 +                                 (mapcar '(lambda (tag) (cons tag (concat "tag:inbox and tag:" tag)))\r
107 +                                         (process-lines notmuch-command "search-tags" "tag:inbox"))))\r
108 +            (inboxtags-widest (notmuch-hello-longest-label inboxtags-alist))\r
109 +            (widest (max saved-widest alltags-widest inboxtags-widest)))\r
110 +\r
111 +\r
112 +       (when inboxtags-alist\r
113 +         (widget-insert "What's in your inbox: ")\r
114 +         (widget-create 'push-button\r
115 +                        :notify (lambda (widget &rest ignore)\r
116 +                                  (setq notmuch-show-inbox-tags-list nil)\r
117 +                                  (notmuch-hello-update))\r
118 +                        "hide")\r
119 +         (widget-insert "\n\n")\r
120 +         (setq final-target-pos (point-marker))\r
121 +         (let ((start (point)))\r
122 +           (setq found-target-pos (notmuch-hello-insert-tags inboxtags-alist widest target))\r
123 +           (if (not final-target-pos)\r
124 +               (setq final-target-pos found-target-pos))\r
125 +           (indent-rigidly start (point) notmuch-hello-indent)))\r
126 +\r
127 +       (when (not notmuch-show-inbox-tags-list)\r
128 +         (widget-create 'push-button\r
129 +                        :notify (lambda (widget &rest ignore)\r
130 +                                  (setq notmuch-show-inbox-tags-list t)\r
131 +                                  (notmuch-hello-update))\r
132 +                        "Show tags in your inbox")\r
133 +         (widget-insert "\n"))\r
134 +       (widget-insert "\n")\r
135  \r
136         (when saved-alist\r
137           (widget-insert "Saved searches: ")\r
138 @@ -297,8 +331,9 @@ diagonal."\r
139                          :notify (lambda (&rest ignore)\r
140                                    (customize-variable 'notmuch-saved-searches))\r
141                          "edit")\r
142 +         (if (not final-target-pos)\r
143 +             (setq final-target-pos (point-marker)))\r
144           (widget-insert "\n\n")\r
145 -         (setq final-target-pos (point-marker))\r
146           (let ((start (point)))\r
147             (setq found-target-pos (notmuch-hello-insert-tags saved-alist widest target))\r
148             (if found-target-pos\r
149 -- \r
150 tg: (1d528f8..) t/emacs-what-is-in-your-inbox (depends on: master)\r