* [PATCH 0/2] Add a fake 'Tags' header
@ 2012-01-26 18:16 David Edmondson
2012-01-26 18:16 ` [PATCH 1/2] emacs: Add a fake Tags: header during display David Edmondson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: David Edmondson @ 2012-01-26 18:16 UTC (permalink / raw)
To: notmuch
From a discussion in #notmuch, add a fake 'Tags' header when
displaying messages and ensure that it's kept up to date.
David Edmondson (2):
emacs: Add a fake Tags: header during display.
test: Update tests for new 'Tags' header.
emacs/notmuch-show.el | 24 +++++++++++++++----
test/emacs | 3 ++
.../notmuch-show-thread-maildir-storage | 7 +++++
...hread-maildir-storage-with-fourfold-indentation | 7 +++++
...show-thread-maildir-storage-without-indentation | 7 +++++
5 files changed, 43 insertions(+), 5 deletions(-)
--
1.7.8.3
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] emacs: Add a fake Tags: header during display.
2012-01-26 18:16 [PATCH 0/2] Add a fake 'Tags' header David Edmondson
@ 2012-01-26 18:16 ` David Edmondson
2012-01-26 18:16 ` [PATCH 2/2] test: Update tests for new 'Tags' header David Edmondson
2012-01-28 12:16 ` [PATCH 0/2] Add a fake " David Bremner
2 siblings, 0 replies; 5+ messages in thread
From: David Edmondson @ 2012-01-26 18:16 UTC (permalink / raw)
To: notmuch
If `truncate-lines' is `nil' in `notmuch-show-mode' the tags can be
lost from the right edge of the window. Create a fake 'Tags' header to
display them with the other headers.
Enable it by default by adding it to `notmuch-message-headers' and
keep it up to date during tagging operations.
---
emacs/notmuch-show.el | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c37479a..a975a29 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -41,7 +41,7 @@
(declare-function notmuch-select-tag-with-completion "notmuch" (prompt &rest search-terms))
(declare-function notmuch-search-show-thread "notmuch" nil)
-(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
+(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date" "Tags")
"Headers that should be shown in a message, in this order.
For an open message, all of these headers will be made visible
@@ -255,6 +255,8 @@ operation on the contents of the current buffer."
'message-header-subject)
((looking-at "[Ff]rom:")
'message-header-from)
+ ((looking-at "Tags:")
+ 'notmuch-tag-face)
(t
'message-header-other))))
@@ -277,13 +279,21 @@ operation on the contents of the current buffer."
(defun notmuch-show-update-tags (tags)
"Update the displayed tags of the current message."
(save-excursion
- (goto-char (notmuch-show-message-top))
- (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
- (let ((inhibit-read-only t))
+ ;; Update the header line.
+ (let ((inhibit-read-only t))
+ (goto-char (notmuch-show-message-top))
+ (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t)
(replace-match (concat "("
(propertize (mapconcat 'identity tags " ")
'face 'notmuch-tag-face)
- ")"))))))
+ ")")))
+ ;; Update the header, if present.
+ (when (member "Tags" notmuch-message-headers)
+ (goto-char (notmuch-show-message-top))
+ (if (re-search-forward"^ *Tags: \\(.*\\)$" (notmuch-show-message-bottom) t)
+ (replace-match (propertize (mapconcat 'identity tags " ")
+ 'face 'notmuch-tag-face)
+ nil t nil 1))))))
(defun notmuch-show-clean-address (address)
"Try to clean a single email ADDRESS for display. Return
@@ -789,6 +799,10 @@ current buffer, if possible."
(message-invis-spec (notmuch-show-make-symbol "message"))
(bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
+ ;; Add a fake 'Tags' header which can be used in
+ ;; `notmuch-show-insert-headers'.
+ (plist-put headers :Tags (mapconcat #'identity (plist-get msg :tags) " "))
+
;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
;; removing items from `buffer-invisibility-spec' (which is what
;; `notmuch-show-headers-visible' and
--
1.7.8.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] test: Update tests for new 'Tags' header.
2012-01-26 18:16 [PATCH 0/2] Add a fake 'Tags' header David Edmondson
2012-01-26 18:16 ` [PATCH 1/2] emacs: Add a fake Tags: header during display David Edmondson
@ 2012-01-26 18:16 ` David Edmondson
2012-01-28 12:16 ` [PATCH 0/2] Add a fake " David Bremner
2 siblings, 0 replies; 5+ messages in thread
From: David Edmondson @ 2012-01-26 18:16 UTC (permalink / raw)
To: notmuch
---
test/emacs | 3 +++
.../notmuch-show-thread-maildir-storage | 7 +++++++
...hread-maildir-storage-with-fourfold-indentation | 7 +++++++
...show-thread-maildir-storage-without-indentation | 7 +++++++
4 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/test/emacs b/test/emacs
index f150d95..eda5438 100755
--- a/test/emacs
+++ b/test/emacs
@@ -82,6 +82,7 @@ cat <<EOF >EXPECTED
Subject: message-with-invalid-from
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:57 +0000
+Tags: inbox
This is just a test message (#1)
EOF
@@ -332,6 +333,7 @@ echo "Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
Subject: The problem with top-posting
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:57 +0000
+Tags: inbox
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
@@ -341,6 +343,7 @@ Top Poster <top@poster.com> (2001-01-05) (inbox unread)
Subject: Re: The problem with top-posting
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:57 +0000
+Tags: inbox unread
Thanks for the advice! I will be sure to put it to good use.
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
index cdbfa1d..3e7d3fb 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
@@ -2,6 +2,7 @@ Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 14:00:54 -0500
+Tags: inbox signed
[ multipart/mixed ]
[ multipart/signed ]
@@ -42,6 +43,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: Re: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 01:02:38 +0600
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -74,6 +76,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
To: Mikhail Gusarov <dottedmag@dottedmag.net>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 15:33:01 -0500
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -105,6 +108,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:50:48 +0600
+ Tags: inbox unread
Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu
did gyre and gimble:
@@ -133,6 +137,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 13:24:13 -0800
+ Tags: inbox unread
On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
@@ -156,6 +161,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
To: Keith Packard <keithp@keithp.com>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 19:50:40 -0500
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -182,6 +188,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:08:10 -0800
+ Tags: inbox unread
On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
index b0bf93e..6245c2e 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
@@ -2,6 +2,7 @@ Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 14:00:54 -0500
+Tags: inbox signed
[ multipart/mixed ]
[ multipart/signed ]
@@ -42,6 +43,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: Re: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 01:02:38 +0600
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -74,6 +76,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
To: Mikhail Gusarov <dottedmag@dottedmag.net>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 15:33:01 -0500
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -105,6 +108,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:50:48 +0600
+ Tags: inbox unread
Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu
did gyre and gimble:
@@ -133,6 +137,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 13:24:13 -0800
+ Tags: inbox unread
On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
@@ -156,6 +161,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
To: Keith Packard <keithp@keithp.com>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 19:50:40 -0500
+ Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -182,6 +188,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:08:10 -0800
+ Tags: inbox unread
On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
index 08de8b5..17214f7 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
@@ -2,6 +2,7 @@ Lars Kellogg-Stedman <lars@seas.harvard.edu> (2009-11-17) (inbox signed)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 14:00:54 -0500
+Tags: inbox signed
[ multipart/mixed ]
[ multipart/signed ]
@@ -42,6 +43,7 @@ Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox signed unread)
Subject: Re: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 01:02:38 +0600
+Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -74,6 +76,7 @@ Subject: Re: [notmuch] Working with Maildir storage?
To: Mikhail Gusarov <dottedmag@dottedmag.net>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 15:33:01 -0500
+Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -105,6 +108,7 @@ Mikhail Gusarov <dottedmag@dottedmag.net> (2009-11-17) (inbox unread)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:50:48 +0600
+Tags: inbox unread
Twas brillig at 15:33:01 17.11.2009 UTC-05 when lars at seas.harvard.edu
did gyre and gimble:
@@ -133,6 +137,7 @@ Keith Packard <keithp@keithp.com> (2009-11-17) (inbox unread)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 13:24:13 -0800
+Tags: inbox unread
On Tue, 17 Nov 2009 15:33:01 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
@@ -156,6 +161,7 @@ Subject: Re: [notmuch] Working with Maildir storage?
To: Keith Packard <keithp@keithp.com>
Cc: notmuch@notmuchmail.org
Date: Tue, 17 Nov 2009 19:50:40 -0500
+Tags: inbox signed unread
[ multipart/mixed ]
[ multipart/signed ]
@@ -182,6 +188,7 @@ Carl Worth <cworth@cworth.org> (2009-11-18) (inbox unread)
Subject: [notmuch] Working with Maildir storage?
To: notmuch@notmuchmail.org
Date: Wed, 18 Nov 2009 02:08:10 -0800
+Tags: inbox unread
On Tue, 17 Nov 2009 14:00:54 -0500, Lars Kellogg-Stedman <lars at
seas.harvard.edu> wrote:
--
1.7.8.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Add a fake 'Tags' header
2012-01-26 18:16 [PATCH 0/2] Add a fake 'Tags' header David Edmondson
2012-01-26 18:16 ` [PATCH 1/2] emacs: Add a fake Tags: header during display David Edmondson
2012-01-26 18:16 ` [PATCH 2/2] test: Update tests for new 'Tags' header David Edmondson
@ 2012-01-28 12:16 ` David Bremner
2012-01-30 9:21 ` David Edmondson
2 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2012-01-28 12:16 UTC (permalink / raw)
To: David Edmondson, notmuch
On Thu, 26 Jan 2012 18:16:27 +0000, David Edmondson <dme@dme.org> wrote:
> From a discussion in #notmuch, add a fake 'Tags' header when
> displaying messages and ensure that it's kept up to date.
Hi David;
Indeed this seems useful when tags are too long for the display width,
but it also seems a bit redundant to display the tags twice, once in the
first line, and then repeated later.
Is there some customization of the first line (author date (tags) ) that
I missed?
d
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] Add a fake 'Tags' header
2012-01-28 12:16 ` [PATCH 0/2] Add a fake " David Bremner
@ 2012-01-30 9:21 ` David Edmondson
0 siblings, 0 replies; 5+ messages in thread
From: David Edmondson @ 2012-01-30 9:21 UTC (permalink / raw)
To: David Bremner, notmuch
[-- Attachment #1: Type: text/plain, Size: 873 bytes --]
On Sat, 28 Jan 2012 08:16:04 -0400, David Bremner <david@tethera.net> wrote:
> On Thu, 26 Jan 2012 18:16:27 +0000, David Edmondson <dme@dme.org> wrote:
> > From a discussion in #notmuch, add a fake 'Tags' header when
> > displaying messages and ensure that it's kept up to date.
>
> Indeed this seems useful when tags are too long for the display width,
> but it also seems a bit redundant to display the tags twice, once in the
> first line, and then repeated later.
I usually have `notmuch-message-headers-visible' set to `t', so I only
see the tags once. (Though I would like to have the blank line even when
the headers are not shown, just haven't got around to it.)
> Is there some customization of the first line (author date (tags) ) that
> I missed?
No, there's no way to configure the contents of the header line. I'll
have a think about it.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-30 9:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-26 18:16 [PATCH 0/2] Add a fake 'Tags' header David Edmondson
2012-01-26 18:16 ` [PATCH 1/2] emacs: Add a fake Tags: header during display David Edmondson
2012-01-26 18:16 ` [PATCH 2/2] test: Update tests for new 'Tags' header David Edmondson
2012-01-28 12:16 ` [PATCH 0/2] Add a fake " David Bremner
2012-01-30 9:21 ` David Edmondson
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).