Re: [PATCH] emacs: Make highlight-faces for pick configurable

Subject: Re: [PATCH] emacs: Make highlight-faces for pick configurable

Date: Sun, 12 Feb 2012 15:50:00 +0000

To: Daniel Schoepe, notmuch@notmuchmail.org

Cc:

From: Mark Walters


On Sun, 12 Feb 2012 15:47:18 +0100, Daniel Schoepe <daniel@schoepe.org> wrote:
> ---
>  emacs/notmuch-pick.el |   21 ++++++++++++++++++---
>  1 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/emacs/notmuch-pick.el b/emacs/notmuch-pick.el
> index 4c91d7c..2bf1ae4 100644
> --- a/emacs/notmuch-pick.el
> +++ b/emacs/notmuch-pick.el
> @@ -42,6 +42,22 @@
>    :group 'notmuch
>    :type 'int)
>  
> +(defface notmuch-pick-match-face
> +  '((((class color)
> +      (background dark))
> +     (:foreground "white"))
> +    (((class color)
> +      (background light))
> +     (:foreground "black"))
> +    (t (:bold t)))
> +  "Face used in pick mode for matching messages."
> +  :group 'notmuch)
> +
> +(defface notmuch-pick-no-match-face
> +  '((t (:foreground "gray")))
> +  "Face used in pick mode for messages not matching the query."
> +  :group 'notmuch)
> +
>  (defvar notmuch-pick-previous-subject "")
>  (make-variable-buffer-local 'notmuch-pick-previous-subject)
>  
> @@ -415,10 +431,9 @@ unchanged ADDRESS if parsing fails."
>  	 (match (plist-get msg :match))
>  	 (tags (plist-get msg :tags))
>  	 (bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
> -	 ;; Face should be a defcustom or something MJW
>  	 (message-face (if match
> -			   '(:foreground "black")
> -		       '(:foreground "gray"))))
> +			   'notmuch-pick-match-face
> +			 'notmuch-pick-no-match-face)))
>  
>      (insert (propertize (concat
>  			 (notmuch-pick-string-width

This is great. (I had even thought about the hardwired gray: that should
work on both light and dark backgrounds but had forgotten all about the
"black").

Anyway this is the correct fix: thanks!

Mark



Thread: