unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: add default value to notmuch-search-line-faces
@ 2012-01-26 19:21 Jani Nikula
  2012-01-26 19:41 ` Austin Clements
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jani Nikula @ 2012-01-26 19:21 UTC (permalink / raw)
  To: notmuch

Add default value to notmuch-search-line-faces to show "unread"
messages in bold, and "flagged" messages in red, to have some visual
indication of important messages in search results. This should be
helpful for new users.

"unread" tag is quite obvious, and handled specially both in the lib
and emacs ui. "flagged" is synced to maildir F flag in the lib. If one
syncs the maildir to IMAP, this also translates to corresponding IMAP
flag. (This is "starred" in GMail and Android.)

Signed-off-by: Jani Nikula <jani@nikula.org>
---
 emacs/notmuch.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6b2c252..551ea9d 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -662,7 +662,8 @@ This function advances the next thread when finished."
 		  (goto-char (point-min))
 		  (forward-line (1- notmuch-search-target-line))))))))
 
-(defcustom notmuch-search-line-faces nil
+(defcustom notmuch-search-line-faces '(("unread" :weight bold)
+				       ("flagged" :foreground "red"))
   "Tag/face mapping for line highlighting in notmuch-search.
 
 Here is an example of how to color search results based on tags.
-- 
1.7.5.4

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 19:21 [PATCH] emacs: add default value to notmuch-search-line-faces Jani Nikula
@ 2012-01-26 19:41 ` Austin Clements
  2012-01-26 21:58   ` Jani Nikula
  2012-01-26 21:59   ` Jeremy Nickurak
  2012-01-27 10:29 ` Mark Walters
  2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
  2 siblings, 2 replies; 15+ messages in thread
From: Austin Clements @ 2012-01-26 19:41 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

Quoth Jani Nikula on Jan 26 at  9:21 pm:
> Add default value to notmuch-search-line-faces to show "unread"
> messages in bold, and "flagged" messages in red, to have some visual
> indication of important messages in search results. This should be
> helpful for new users.
> 
> "unread" tag is quite obvious, and handled specially both in the lib
> and emacs ui. "flagged" is synced to maildir F flag in the lib. If one
> syncs the maildir to IMAP, this also translates to corresponding IMAP
> flag. (This is "starred" in GMail and Android.)
> 
> Signed-off-by: Jani Nikula <jani@nikula.org>

While I'm sure this can be bikeshod to death, I do have one legitimate
concern (and one illegitimate).

I completely agree with what you said on IRC, though, that setting
this to non-nil is more about making this capability more discoverable
to new users than trying to come up with the perfect faces.

> ---
>  emacs/notmuch.el |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 6b2c252..551ea9d 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -662,7 +662,8 @@ This function advances the next thread when finished."
>  		  (goto-char (point-min))
>  		  (forward-line (1- notmuch-search-target-line))))))))
>  
> -(defcustom notmuch-search-line-faces nil
> +(defcustom notmuch-search-line-faces '(("unread" :weight bold)

As much as I would like this, many terminals don't visually
distinguish between the default face and the default face in bold.

> +				       ("flagged" :foreground "red"))

Red is pretty universally used to indicate danger or a serious
condition, while "flagged" is simply supposed to draw attention.  I
would say blue as a neutral and distinct indicator, but it also has
poor visibility (I used to use blue, but found that when scanning my
mail, I would habitually skip over flagged messages because they were
dark, which was the opposite of what I wanted).  Personally I've
settled on yellow; it's visually distinct enough to be easily
noticeable and bright enough that I don't skip over it, though it
obviously wouldn't work on a light background.

>    "Tag/face mapping for line highlighting in notmuch-search.
>  
>  Here is an example of how to color search results based on tags.

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 19:41 ` Austin Clements
@ 2012-01-26 21:58   ` Jani Nikula
  2012-01-31 13:12     ` Jani Nikula
  2012-01-26 21:59   ` Jeremy Nickurak
  1 sibling, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2012-01-26 21:58 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch

On Thu, 26 Jan 2012 14:41:46 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> Quoth Jani Nikula on Jan 26 at  9:21 pm:
> > Add default value to notmuch-search-line-faces to show "unread"
> > messages in bold, and "flagged" messages in red, to have some visual
> > indication of important messages in search results. This should be
> > helpful for new users.
> > 
> > "unread" tag is quite obvious, and handled specially both in the lib
> > and emacs ui. "flagged" is synced to maildir F flag in the lib. If one
> > syncs the maildir to IMAP, this also translates to corresponding IMAP
> > flag. (This is "starred" in GMail and Android.)
> > 
> > Signed-off-by: Jani Nikula <jani@nikula.org>
> 
> While I'm sure this can be bikeshod to death, I do have one legitimate
> concern (and one illegitimate).
> 
> I completely agree with what you said on IRC, though, that setting
> this to non-nil is more about making this capability more discoverable
> to new users than trying to come up with the perfect faces.

Thanks for repeating that here too before full blown bikeshedding. I'm
just trying to help other people find this option quicker than I and
some others did...

> > ---
> >  emacs/notmuch.el |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> > index 6b2c252..551ea9d 100644
> > --- a/emacs/notmuch.el
> > +++ b/emacs/notmuch.el
> > @@ -662,7 +662,8 @@ This function advances the next thread when finished."
> >  		  (goto-char (point-min))
> >  		  (forward-line (1- notmuch-search-target-line))))))))
> >  
> > -(defcustom notmuch-search-line-faces nil
> > +(defcustom notmuch-search-line-faces '(("unread" :weight bold)
> 
> As much as I would like this, many terminals don't visually
> distinguish between the default face and the default face in bold.

Would it really matter, though? People on such terminals are probably
aware they are missing out on a bunch of visual stuff. But please do
suggest an alternative that could be "composited" with the :foreground
setting below for "unread" and "flagged" threads.

> > +				       ("flagged" :foreground "red"))
> 
> Red is pretty universally used to indicate danger or a serious
> condition, while "flagged" is simply supposed to draw attention.  I
> would say blue as a neutral and distinct indicator, but it also has
> poor visibility (I used to use blue, but found that when scanning my
> mail, I would habitually skip over flagged messages because they were
> dark, which was the opposite of what I wanted).  Personally I've
> settled on yellow; it's visually distinct enough to be easily
> noticeable and bright enough that I don't skip over it, though it
> obviously wouldn't work on a light background.

Can be yellow, I don't really care that much. But isn't a light
background the default for emacs in most distros? If that matters,
*shrug*.


BR,
Jani.

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 19:41 ` Austin Clements
  2012-01-26 21:58   ` Jani Nikula
@ 2012-01-26 21:59   ` Jeremy Nickurak
  2012-01-26 22:17     ` Austin Clements
  1 sibling, 1 reply; 15+ messages in thread
From: Jeremy Nickurak @ 2012-01-26 21:59 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch

On Thu, Jan 26, 2012 at 12:41, Austin Clements <amdragon@mit.edu> wrote:
> As much as I would like this, many terminals don't visually
> distinguish between the default face and the default face in bold.

I've taken a shot at this under xterm, gnome-terminal, and a basic
linux VT. I figure that if something is broken in another terminal
that breaks in one of these, it's somebody-elses-problem :)

Xterm/gnome-terminal support bold just fine. With a Linux VT, emacs
just chooses i slightly lighter color, which is totally usable.

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 21:59   ` Jeremy Nickurak
@ 2012-01-26 22:17     ` Austin Clements
  0 siblings, 0 replies; 15+ messages in thread
From: Austin Clements @ 2012-01-26 22:17 UTC (permalink / raw)
  To: Jeremy Nickurak; +Cc: notmuch

Quoth Jeremy Nickurak on Jan 26 at  2:59 pm:
> On Thu, Jan 26, 2012 at 12:41, Austin Clements <amdragon@mit.edu> wrote:
> > As much as I would like this, many terminals don't visually
> > distinguish between the default face and the default face in bold.
> 
> I've taken a shot at this under xterm, gnome-terminal, and a basic
> linux VT. I figure that if something is broken in another terminal
> that breaks in one of these, it's somebody-elses-problem :)
> 
> Xterm/gnome-terminal support bold just fine. With a Linux VT, emacs
> just chooses i slightly lighter color, which is totally usable.

Cool.  If this works in those, then I'm happy with the bold.  (Upon
further inspection, it's possible that I'm just full of it and the
font I've been using for the past decade or so is simply too small to
have a bold variant.)

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 19:21 [PATCH] emacs: add default value to notmuch-search-line-faces Jani Nikula
  2012-01-26 19:41 ` Austin Clements
@ 2012-01-27 10:29 ` Mark Walters
  2012-01-27 10:37   ` David Edmondson
  2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
  2 siblings, 1 reply; 15+ messages in thread
From: Mark Walters @ 2012-01-27 10:29 UTC (permalink / raw)
  To: Jani Nikula, notmuch


> Add default value to notmuch-search-line-faces to show "unread"
> messages in bold, and "flagged" messages in red, to have some visual
> indication of important messages in search results. This should be
> helpful for new users.

I am not sure if this is the place to ask but is there a corresponding
option for colouring the summary line in notmuch-show depending on
tags/flags?

Many thanks

Mark

(sorry for the resend: sent from the wrong address the first time)

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-27 10:29 ` Mark Walters
@ 2012-01-27 10:37   ` David Edmondson
  2012-01-28 11:07     ` Mark Walters
  0 siblings, 1 reply; 15+ messages in thread
From: David Edmondson @ 2012-01-27 10:37 UTC (permalink / raw)
  To: Mark Walters; +Cc: Notmuch Mail

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

On Fri, 27 Jan 2012 10:29:22 +0000, Mark Walters <markwalters1009@gmail.com> wrote:
> I am not sure if this is the place

Here or #notmuch.

> to ask but is there a corresponding option for colouring the summary
> line in notmuch-show depending on tags/flags?

There's id:"1325006003-27152-1-git-send-email-dme@dme.org", but it's a
bit old and may not apply cleanly any more.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-27 10:37   ` David Edmondson
@ 2012-01-28 11:07     ` Mark Walters
  2012-01-28 11:18       ` Mark Walters
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Walters @ 2012-01-28 11:07 UTC (permalink / raw)
  To: David Edmondson; +Cc: Notmuch Mail


On Fri, 27 Jan 2012 10:37:43 +0000, David Edmondson <dme@dme.org> wrote:
> On Fri, 27 Jan 2012 10:29:22 +0000, Mark Walters <markwalters1009@gmail.com> wrote:
> > I am not sure if this is the place
> 
> Here or #notmuch.
> 
> > to ask but is there a corresponding option for colouring the summary
> > line in notmuch-show depending on tags/flags?
> 
> There's id:"1325006003-27152-1-git-send-email-dme@dme.org", but it's a
> bit old and may not apply cleanly any more.

That's great! One hunk didn't apply but the merge was so trivial I am not sure
why it did not apply. Anyway in case anyone else wants it I include the
rebased version below (I also moved the defcustom under notmuch-show).

Best wishes

Mark

Subject: [PATCH] rebased id:"1325006003-27152-1-git-send-email-dme@dme.org"

---
 emacs/notmuch-lib.el  |   18 ++++++++++++++++++
 emacs/notmuch-show.el |   33 +++++++++++++++++++++++++++++----
 emacs/notmuch.el      |   17 ++---------------
 3 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index c906ca7..ab1d8e8 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -133,6 +133,24 @@ the user hasn't set this variable with the old or new value."
   (interactive)
   (kill-buffer (current-buffer)))
 
+(defun notmuch-color-line (start end line-tag-list spec)
+  "Colorize a line based on tags."
+  ;; Create the overlay only if the message has tags which match one
+  ;; of those specified in `spec'.
+  (let (overlay)
+    (mapc (lambda (elem)
+	    (let ((tag (car elem))
+		  (attributes (cdr elem)))
+	      (when (member tag line-tag-list)
+		(when (not overlay)
+		  (setq overlay (make-overlay start end))
+		  (overlay-put overlay 'priority 5))
+		;; Merge the specified properties with any already
+		;; applied from an earlier match.
+		(overlay-put overlay 'face
+			     (append (overlay-get overlay 'face) attributes)))))
+	  spec)))
+
 ;;
 
 (defun notmuch-common-do-stash (text)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 84ac624..c448ab2 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -92,6 +92,24 @@ any given message."
   :group 'notmuch-show
   :group 'notmuch-hooks)
 
+(defcustom notmuch-show-line-faces nil
+  "Tag to face mapping for header line highlighting in `notmuch-show-mode'.
+
+Here is an example of how to color search results based on tags.
+ (the following text would be placed in your ~/.emacs file):
+
+ (setq notmuch-search-line-faces '((\"delete\" . (:foreground \"red\"
+						  :background \"blue\"))
+                                   (\"unread\" . (:foreground \"green\"))))
+
+The attributes defined for matching tags are merged, with later
+attributes overriding earlier. A message having both \"delete\"
+and \"unread\" tags with the above settings would have a green
+foreground and blue background."
+  :type '(alist :key-type (string) :value-type (custom-face-edit))
+  :group 'notmuch-show
+  :group 'notmuch-faces)
+
 ;; Mostly useful for debugging.
 (defcustom notmuch-show-all-multipart/alternative-parts t
   "Should all parts of multipart/alternative parts be shown?"
@@ -340,7 +358,8 @@ unchanged ADDRESS if parsing fails."
 (defun notmuch-show-insert-headerline (headers date tags depth)
   "Insert a notmuch style headerline based on HEADERS for a
 message at DEPTH in the current thread."
-  (let ((start (point)))
+  (let ((start (point))
+	overlay)
     (insert (notmuch-show-spaces-n (* notmuch-show-indent-messages-width depth))
 	    (notmuch-show-clean-address (plist-get headers :From))
 	    " ("
@@ -349,7 +368,9 @@ message at DEPTH in the current thread."
 	    (propertize (mapconcat 'identity tags " ")
 			'face 'notmuch-tag-face)
 	    ")\n")
-    (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face)))
+    (setq overlay (make-overlay start (point)))
+    (overlay-put overlay 'face 'notmuch-message-summary-face)
+    (overlay-put overlay 'priority 2)))
 
 (defun notmuch-show-insert-header (header header-value)
   "Insert a single header."
@@ -818,7 +839,8 @@ current buffer, if possible."
 	 body-start body-end
 	 (headers-invis-spec (notmuch-show-make-symbol "header"))
 	 (message-invis-spec (notmuch-show-make-symbol "message"))
-	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject))))
+	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
+	 (tags (plist-get msg :tags)))
 
     ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
     ;; removing items from `buffer-invisibility-spec' (which is what
@@ -843,10 +865,13 @@ current buffer, if possible."
 					    (plist-get msg :date_relative)
 					  nil)
 					(plist-get headers :Date))
-				    (plist-get msg :tags) depth)
+				    tags depth)
 
     (setq content-start (point-marker))
 
+    ;; Colour the header line according to the tags of the message.
+    (notmuch-color-line message-start content-start tags notmuch-show-line-faces)
+
     (plist-put msg :headers-invis-spec headers-invis-spec)
     (plist-put msg :message-invis-spec message-invis-spec)
 
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 72f78ed..244fafa 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -690,7 +690,7 @@ This function advances the next thread when finished."
 		  (forward-line (1- notmuch-search-target-line))))))))
 
 (defcustom notmuch-search-line-faces nil
-  "Tag/face mapping for line highlighting in notmuch-search.
+  "Tag to face mapping for line highlighting in `notmuch-search-mode'.
 
 Here is an example of how to color search results based on tags.
  (the following text would be placed in your ~/.emacs file):
@@ -709,20 +709,7 @@ foreground and blue background."
 
 (defun notmuch-search-color-line (start end line-tag-list)
   "Colorize lines in `notmuch-show' based on tags."
-  ;; Create the overlay only if the message has tags which match one
-  ;; of those specified in `notmuch-search-line-faces'.
-  (let (overlay)
-    (mapc (lambda (elem)
-	    (let ((tag (car elem))
-		  (attributes (cdr elem)))
-	      (when (member tag line-tag-list)
-		(when (not overlay)
-		  (setq overlay (make-overlay start end)))
-		;; Merge the specified properties with any already
-		;; applied from an earlier match.
-		(overlay-put overlay 'face
-			     (append (overlay-get overlay 'face) attributes)))))
-	  notmuch-search-line-faces)))
+  (notmuch-color-line start end line-tag-list notmuch-search-line-faces))
 
 (defun notmuch-search-author-propertize (authors)
   "Split `authors' into matching and non-matching authors and
-- 
1.7.2.3

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-28 11:07     ` Mark Walters
@ 2012-01-28 11:18       ` Mark Walters
  0 siblings, 0 replies; 15+ messages in thread
From: Mark Walters @ 2012-01-28 11:18 UTC (permalink / raw)
  To: David Edmondson; +Cc: Notmuch Mail


I wondered whether the general view is that this following trivial
extension to David's notmuch-show-line-faces patch is too gross/hacky to
live? It passes a fake tag of "flag:match" to notmuch-color-line so that
the same customisation as for colouring lines based on tags can also
colour based on match. I find it useful when using the collapsed view
for example.

Best wishes

Mark


diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c448ab2..00c1a2f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -837,11 +837,14 @@ current buffer, if possible."
 	 content-start content-end
 	 headers-start headers-end
 	 body-start body-end
+	 tags-and-flags
 	 (headers-invis-spec (notmuch-show-make-symbol "header"))
 	 (message-invis-spec (notmuch-show-make-symbol "message"))
 	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
 	 (tags (plist-get msg :tags)))
 
+    (if (plist-get msg :match)
+	(setq tags-and-flags (append tags '("flag:match"))))
     ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise
     ;; removing items from `buffer-invisibility-spec' (which is what
     ;; `notmuch-show-headers-visible' and
@@ -870,7 +873,7 @@ current buffer, if possible."
     (setq content-start (point-marker))
 
     ;; Colour the header line according to the tags of the message.
-    (notmuch-color-line message-start content-start tags notmuch-show-line-faces)
+    (notmuch-color-line message-start content-start tags-and-flags notmuch-show-line-faces)
 
     (plist-put msg :headers-invis-spec headers-invis-spec)
     (plist-put msg :message-invis-spec message-invis-spec)
-- 
1.7.2.3

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-26 21:58   ` Jani Nikula
@ 2012-01-31 13:12     ` Jani Nikula
  2012-01-31 15:19       ` Austin Clements
  0 siblings, 1 reply; 15+ messages in thread
From: Jani Nikula @ 2012-01-31 13:12 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch

On Thu, 26 Jan 2012 23:58:51 +0200, Jani Nikula <jani@nikula.org> wrote:
> On Thu, 26 Jan 2012 14:41:46 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> > Quoth Jani Nikula on Jan 26 at  9:21 pm:
> > > +				       ("flagged" :foreground "red"))
> > 
> > Red is pretty universally used to indicate danger or a serious
> > condition, while "flagged" is simply supposed to draw attention.  I
> > would say blue as a neutral and distinct indicator, but it also has
> > poor visibility (I used to use blue, but found that when scanning my
> > mail, I would habitually skip over flagged messages because they were
> > dark, which was the opposite of what I wanted).  Personally I've
> > settled on yellow; it's visually distinct enough to be easily
> > noticeable and bright enough that I don't skip over it, though it
> > obviously wouldn't work on a light background.
> 
> Can be yellow, I don't really care that much. But isn't a light
> background the default for emacs in most distros? If that matters,
> *shrug*.

Ugh, yellow is absolutely horrible on a white background... that would
certainly draw people to figure out how to change the settings. Now
shall I send v2 with bold for unread and yellow for flagged, or can this
go in as it is?

BR,
Jani.

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

* Re: [PATCH] emacs: add default value to notmuch-search-line-faces
  2012-01-31 13:12     ` Jani Nikula
@ 2012-01-31 15:19       ` Austin Clements
  0 siblings, 0 replies; 15+ messages in thread
From: Austin Clements @ 2012-01-31 15:19 UTC (permalink / raw)
  To: Jani Nikula; +Cc: notmuch

Quoth Jani Nikula on Jan 31 at  3:12 pm:
> On Thu, 26 Jan 2012 23:58:51 +0200, Jani Nikula <jani@nikula.org> wrote:
> > On Thu, 26 Jan 2012 14:41:46 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> > > Quoth Jani Nikula on Jan 26 at  9:21 pm:
> > > > +				       ("flagged" :foreground "red"))
> > > 
> > > Red is pretty universally used to indicate danger or a serious
> > > condition, while "flagged" is simply supposed to draw attention.  I
> > > would say blue as a neutral and distinct indicator, but it also has
> > > poor visibility (I used to use blue, but found that when scanning my
> > > mail, I would habitually skip over flagged messages because they were
> > > dark, which was the opposite of what I wanted).  Personally I've
> > > settled on yellow; it's visually distinct enough to be easily
> > > noticeable and bright enough that I don't skip over it, though it
> > > obviously wouldn't work on a light background.
> > 
> > Can be yellow, I don't really care that much. But isn't a light
> > background the default for emacs in most distros? If that matters,
> > *shrug*.
> 
> Ugh, yellow is absolutely horrible on a white background... that would
> certainly draw people to figure out how to change the settings. Now
> shall I send v2 with bold for unread and yellow for flagged, or can this
> go in as it is?

Sorry, I really meant to propose blue for flagged.  The thing about
yellow was meant more as an aside.  Blue is reasonably visible on both
light and dark backgrounds.  It should draw people into customizing
it, while still being a reasonable default.

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

* [PATCH v2] emacs: add default value to notmuch-search-line-faces
  2012-01-26 19:21 [PATCH] emacs: add default value to notmuch-search-line-faces Jani Nikula
  2012-01-26 19:41 ` Austin Clements
  2012-01-27 10:29 ` Mark Walters
@ 2012-02-02 14:58 ` Jani Nikula
  2012-02-02 16:15   ` Tomi Ollila
                     ` (2 more replies)
  2 siblings, 3 replies; 15+ messages in thread
From: Jani Nikula @ 2012-02-02 14:58 UTC (permalink / raw)
  To: notmuch

Add default value to notmuch-search-line-faces to show "unread"
messages in bold, and "flagged" messages in blue, to have some visual
indication of important messages in search results. This should be
helpful for new users.

"unread" tag is quite obvious, and handled specially both in the lib
and emacs ui. "flagged" is synced to maildir F flag in the lib. If one
syncs the maildir to IMAP, this also translates to corresponding IMAP
flag. (This is "starred" in GMail and Android.)

Signed-off-by: Jani Nikula <jani@nikula.org>
---
 emacs/notmuch.el |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 5fa239a..bbf0aec 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -688,7 +688,8 @@ This function advances the next thread when finished."
 		  (goto-char (point-min))
 		  (forward-line (1- notmuch-search-target-line))))))))
 
-(defcustom notmuch-search-line-faces nil
+(defcustom notmuch-search-line-faces '(("unread" :weight bold)
+				       ("flagged" :foreground "blue"))
   "Tag/face mapping for line highlighting in notmuch-search.
 
 Here is an example of how to color search results based on tags.
-- 
1.7.5.4

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

* Re: [PATCH v2] emacs: add default value to notmuch-search-line-faces
  2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
@ 2012-02-02 16:15   ` Tomi Ollila
  2012-02-03  8:08   ` David Edmondson
  2012-02-12 17:32   ` David Bremner
  2 siblings, 0 replies; 15+ messages in thread
From: Tomi Ollila @ 2012-02-02 16:15 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Thu,  2 Feb 2012 16:58:41 +0200, Jani Nikula <jani@nikula.org> wrote:
> Add default value to notmuch-search-line-faces to show "unread"
> messages in bold, and "flagged" messages in blue, to have some visual
> indication of important messages in search results. This should be
> helpful for new users.
> 
> "unread" tag is quite obvious, and handled specially both in the lib
> and emacs ui. "flagged" is synced to maildir F flag in the lib. If one
> syncs the maildir to IMAP, this also translates to corresponding IMAP
> flag. (This is "starred" in GMail and Android.)
> 
> Signed-off-by: Jani Nikula <jani@nikula.org>
> ---

Works fine. +1

Tomi

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

* Re: [PATCH v2] emacs: add default value to notmuch-search-line-faces
  2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
  2012-02-02 16:15   ` Tomi Ollila
@ 2012-02-03  8:08   ` David Edmondson
  2012-02-12 17:32   ` David Bremner
  2 siblings, 0 replies; 15+ messages in thread
From: David Edmondson @ 2012-02-03  8:08 UTC (permalink / raw)
  To: Jani Nikula, notmuch

[-- Attachment #1: Type: text/plain, Size: 4 bytes --]

+1.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH v2] emacs: add default value to notmuch-search-line-faces
  2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
  2012-02-02 16:15   ` Tomi Ollila
  2012-02-03  8:08   ` David Edmondson
@ 2012-02-12 17:32   ` David Bremner
  2 siblings, 0 replies; 15+ messages in thread
From: David Bremner @ 2012-02-12 17:32 UTC (permalink / raw)
  To: Jani Nikula, notmuch

On Thu,  2 Feb 2012 16:58:41 +0200, Jani Nikula <jani@nikula.org> wrote:
> Add default value to notmuch-search-line-faces to show "unread"
> messages in bold, and "flagged" messages in blue, to have some visual
> indication of important messages in search results. This should be
> helpful for new users.

Pushed, 

d

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

end of thread, other threads:[~2012-02-12 17:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-26 19:21 [PATCH] emacs: add default value to notmuch-search-line-faces Jani Nikula
2012-01-26 19:41 ` Austin Clements
2012-01-26 21:58   ` Jani Nikula
2012-01-31 13:12     ` Jani Nikula
2012-01-31 15:19       ` Austin Clements
2012-01-26 21:59   ` Jeremy Nickurak
2012-01-26 22:17     ` Austin Clements
2012-01-27 10:29 ` Mark Walters
2012-01-27 10:37   ` David Edmondson
2012-01-28 11:07     ` Mark Walters
2012-01-28 11:18       ` Mark Walters
2012-02-02 14:58 ` [PATCH v2] " Jani Nikula
2012-02-02 16:15   ` Tomi Ollila
2012-02-03  8:08   ` David Edmondson
2012-02-12 17:32   ` David Bremner

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