unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 0/2] make tree use notmuch-tag-format-tags
@ 2013-12-19 19:12 Mark Walters
  2013-12-19 19:12 ` [PATCH 1/2] emacs: tree remove comma separator tags Mark Walters
  2013-12-19 19:12 ` [PATCH 2/2] emacs: tree: use tag-format-tags Mark Walters
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Walters @ 2013-12-19 19:12 UTC (permalink / raw)
  To: notmuch

My experiments with unread handling lead me to consider showing
added/deleted tags explicitly (eg deleted with strike-through and
added with underlining). The series
id:1387065197-15776-1-git-send-email-markwalters1009@gmail.com does
this by hooking into notmuch-tag-format-tags.

Tree view does not use this functionality so did not get this
feature. This pair of patches makes tree use notmuch-tag-format-tags
so it can get all this extra, as well as the existing functionality
that notmuch-tag-format-tags provides (eg star symbols for flagged
messages)

In doing so I discovered that tree separates the tags with ", " not
just " "; this would change when moving to notmuch-tag-format-tags so
do this trivial change first as it does require a large patch (160
lines) to fix all the test expected outputs.

Best wishes

Mark


Mark Walters (2):
  emacs: tree remove comma separator tags
  emacs: tree: use tag-format-tags

 emacs/notmuch-tag.el                               |   17 ++--
 emacs/notmuch-tree.el                              |    8 +-
 .../notmuch-tree-single-thread                     |    8 +-
 test/tree.expected-output/notmuch-tree-tag-inbox   |  104 ++++++++++----------
 .../notmuch-tree-tag-inbox-tagged                  |  104 ++++++++++----------
 .../notmuch-tree-tag-inbox-thread-tagged           |  104 ++++++++++----------
 6 files changed, 173 insertions(+), 172 deletions(-)

-- 
1.7.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH 1/2] emacs: tree: default face for matching/non-matching messages
@ 2014-01-11 21:41 Mark Walters
  2014-01-11 21:49 ` [PATCH 2/2] emacs: tree: use tag-format-tags Mark Walters
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Walters @ 2014-01-11 21:41 UTC (permalink / raw)
  To: notmuch

This adds default faces for matching and non-matching messages. This
makes it easier for a user to do broad customization without having to
customize every field. It also fits more neatly with the next patch
which switches to using notmuch-tag-format-tags for tag formatting.

We set the field specific face customization to nil for all the fields
which use the message default face to make it clear to a user which
fields customizations are being used.
---
 emacs/notmuch-tree.el |   36 ++++++++++++++++++++++++++----------
 1 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 0ce7fa8..16f2862 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -70,8 +70,14 @@ Note the author string should not contain
   :group 'notmuch-tree)
 
 ;; Faces for messages that match the query.
-(defface notmuch-tree-match-date-face
+(defface notmuch-tree-match-face
   '((t :inherit default))
+  "Default face used in tree mode face for matching messages"
+  :group 'notmuch-tree
+  :group 'notmuch-faces)
+
+(defface notmuch-tree-match-date-face
+  nil
   "Face used in tree mode for the date in messages matching the query."
   :group 'notmuch-tree
   :group 'notmuch-faces)
@@ -90,13 +96,13 @@ Note the author string should not contain
   :group 'notmuch-faces)
 
 (defface notmuch-tree-match-subject-face
-  '((t :inherit default))
+  nil
   "Face used in tree mode for the subject in messages matching the query."
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
 (defface notmuch-tree-match-tree-face
-  '((t :inherit default))
+  nil
   "Face used in tree mode for the thread tree block graphics in messages matching the query."
   :group 'notmuch-tree
   :group 'notmuch-faces)
@@ -115,32 +121,38 @@ Note the author string should not contain
   :group 'notmuch-faces)
 
 ;; Faces for messages that do not match the query.
-(defface notmuch-tree-no-match-date-face
+(defface notmuch-tree-no-match-face
   '((t (:foreground "gray")))
+  "Default face used in tree mode face for non-matching messages"
+  :group 'notmuch-tree
+  :group 'notmuch-faces)
+
+(defface notmuch-tree-no-match-date-face
+  nil
   "Face used in tree mode for non-matching dates."
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
 (defface notmuch-tree-no-match-subject-face
-  '((t (:foreground "gray")))
+  nil
   "Face used in tree mode for non-matching subjects."
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
 (defface notmuch-tree-no-match-tree-face
-  '((t (:foreground "gray")))
+  nil
   "Face used in tree mode for the thread tree block graphics in messages matching the query."
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
 (defface notmuch-tree-no-match-author-face
-  '((t (:foreground "gray")))
+  nil
   "Face used in tree mode for the date in messages matching the query."
   :group 'notmuch-tree
   :group 'notmuch-faces)
 
 (defface notmuch-tree-no-match-tag-face
-  '((t (:foreground "gray")))
+  nil
   "Face used in tree mode face for non-matching tags."
   :group 'notmuch-tree
   :group 'notmuch-faces)
@@ -699,10 +711,14 @@ unchanged ADDRESS if parsing fails."
 
 (defun notmuch-tree-format-field-list (field-list msg)
   "Format fields of MSG according to FIELD-LIST and return string"
-  (let (result-string)
+  (let ((face (if (plist-get msg :match)
+		  'notmuch-tree-match-face
+		'notmuch-tree-no-match-face))
+	(result-string))
     (dolist (spec field-list result-string)
       (let ((field-string (notmuch-tree-format-field (car spec) (cdr spec) msg)))
-	(setq result-string (concat result-string field-string))))))
+	(setq result-string (concat result-string field-string))))
+    (notmuch-combine-face-text-property-string result-string face t)))
 
 (defun notmuch-tree-insert-msg (msg)
   "Insert the message MSG according to notmuch-tree-result-format"
-- 
1.7.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-13 18:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-19 19:12 [PATCH 0/2] make tree use notmuch-tag-format-tags Mark Walters
2013-12-19 19:12 ` [PATCH 1/2] emacs: tree remove comma separator tags Mark Walters
2014-01-11 20:41   ` Tomi Ollila
2014-01-13 18:38   ` David Bremner
2013-12-19 19:12 ` [PATCH 2/2] emacs: tree: use tag-format-tags Mark Walters
  -- strict thread matches above, loose matches on Subject: below --
2014-01-11 21:41 [PATCH 1/2] emacs: tree: default face for matching/non-matching messages Mark Walters
2014-01-11 21:49 ` [PATCH 2/2] emacs: tree: use tag-format-tags Mark Walters

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).