From: Michal Sojka <sojkam1@fel.cvut.cz>
To: notmuch@notmuchmail.org
Subject: [PATCH RFC] notmuch-hello: What's in your inbox
Date: Fri, 4 Jun 2010 08:37:29 +0200 [thread overview]
Message-ID: <1275633449-17134-1-git-send-email-sojkam1@fel.cvut.cz> (raw)
In-Reply-To: <87wrufjocx.fsf@steelpick.2x.cz>
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 <sojkam1@fel.cvut.cz>
---
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)
next prev parent reply other threads:[~2010-06-04 6:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-03 20:58 [PATCH] Customize saved search order separately from regular search order Keith Packard
2010-05-04 11:02 ` David Edmondson
2010-06-04 0:45 ` Carl Worth
2010-06-04 6:36 ` Michal Sojka
2010-06-04 6:37 ` Michal Sojka [this message]
2010-06-07 13:49 ` David Edmondson
2010-06-07 13:53 ` David Edmondson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1275633449-17134-1-git-send-email-sojkam1@fel.cvut.cz \
--to=sojkam1@fel.cvut.cz \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).