unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* how to specify notmuch colors in emacs24
@ 2014-03-06 13:24 David Belohrad
  2014-03-06 13:52 ` Suvayu Ali
  2014-03-06 14:27 ` Austin Clements
  0 siblings, 2 replies; 4+ messages in thread
From: David Belohrad @ 2014-03-06 13:24 UTC (permalink / raw)
  To: notmuch

Dear All,

so far I'm changing some color faces programmatically:

  (setq notmuch-search-line-faces '(("deleted" . (:foreground "red"
                                                  :background "blue"))
                                     ("unread" . (:foreground "DeepSkyBlue"))
                                     ("flagged" . (:foreground "firebrick1"))
                                     ))


I recently upgraded to emacs24. I was using default shipped tango-dark
theme. Then (because of VHDL mode I'm using) I have created a custom
theme, and I'd like to 'backport' the piece of code above into the
custom theme so it is in accordance with the philosophy of themes.

I have no idea how to specify it using the 'class approach',as e.g.

   `(gnus-group-news-1 ((,class (:foreground ,plum-1))))
   `(gnus-group-news-1-low ((,class (:foreground ,plum-2))))

Any hint would be greatly appreciated

d.

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

* Re: how to specify notmuch colors in emacs24
  2014-03-06 13:24 how to specify notmuch colors in emacs24 David Belohrad
@ 2014-03-06 13:52 ` Suvayu Ali
  2014-03-06 14:27 ` Austin Clements
  1 sibling, 0 replies; 4+ messages in thread
From: Suvayu Ali @ 2014-03-06 13:52 UTC (permalink / raw)
  To: notmuch

On Thu, Mar 06, 2014 at 02:24:51PM +0100, David Belohrad wrote:
> Dear All,
> 
> so far I'm changing some color faces programmatically:
> 
>   (setq notmuch-search-line-faces '(("deleted" . (:foreground "red"
>                                                   :background "blue"))
>                                      ("unread" . (:foreground "DeepSkyBlue"))
>                                      ("flagged" . (:foreground "firebrick1"))
>                                      ))

I use custom-set-faces and themes for this kind of customisation.

> I recently upgraded to emacs24. I was using default shipped tango-dark
> theme. Then (because of VHDL mode I'm using) I have created a custom
> theme, and I'd like to 'backport' the piece of code above into the
> custom theme so it is in accordance with the philosophy of themes.
> 
> I have no idea how to specify it using the 'class approach',as e.g.
> 
>    `(gnus-group-news-1 ((,class (:foreground ,plum-1))))
>    `(gnus-group-news-1-low ((,class (:foreground ,plum-2))))
> 
> Any hint would be greatly appreciated

You could get some ideas from my theme.

<https://github.com/suvayu/.emacs.d/blob/master/themes/dark-emacs-theme.el>

Essentially it boils down to:

  ((type <type>) (class <color/monochrome/etc>) (min-colors <number>))

You can find the gory docs here: (info "(elisp) Defining Faces")

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

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

* Re: how to specify notmuch colors in emacs24
  2014-03-06 13:24 how to specify notmuch colors in emacs24 David Belohrad
  2014-03-06 13:52 ` Suvayu Ali
@ 2014-03-06 14:27 ` Austin Clements
  2014-03-11 10:02   ` David Belohrad
  1 sibling, 1 reply; 4+ messages in thread
From: Austin Clements @ 2014-03-06 14:27 UTC (permalink / raw)
  To: David Belohrad; +Cc: notmuch

Quoth David Belohrad on Mar 06 at  2:24 pm:
> Dear All,
> 
> so far I'm changing some color faces programmatically:
> 
>   (setq notmuch-search-line-faces '(("deleted" . (:foreground "red"
>                                                   :background "blue"))
>                                      ("unread" . (:foreground "DeepSkyBlue"))
>                                      ("flagged" . (:foreground "firebrick1"))
>                                      ))
> 
> 
> I recently upgraded to emacs24. I was using default shipped tango-dark
> theme. Then (because of VHDL mode I'm using) I have created a custom
> theme, and I'd like to 'backport' the piece of code above into the
> custom theme so it is in accordance with the philosophy of themes.
> 
> I have no idea how to specify it using the 'class approach',as e.g.
> 
>    `(gnus-group-news-1 ((,class (:foreground ,plum-1))))
>    `(gnus-group-news-1-low ((,class (:foreground ,plum-2))))
> 
> Any hint would be greatly appreciated

I'm not sure what the values of `class', `plum-1', and `plum-2' are in
your above snippet or what the context of that snippet is, so I may be
misunderstanding your problem, but it may help to know that
`gnus-group-news-1' and `notmuch-search-line-faces' are very different
types of variables.

The value of `gnus-group-news-1' is a face; something like
(:foreground "plum1").  It looks like what you've written above is
actually a "face specification", which uses a bunch of conditions (the
,class part) to determine which of several potential faces to assign
to the variable (though you listed only one face for each variable, so
I'm not sure why you have a condition).  It's unfortunate that Emacs
distinguishes faces and face specification, but that's how it is.

`notmuch-search-line-faces' is *not* a face variable like
`gnus-group-news-1'.  It's an association list that maps tags to
faces.  As such, it won't work if your theme is trying to treat it
like a face variable, since its value is not a face, but rather a data
structure that has faces in it.

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

* Re: how to specify notmuch colors in emacs24
  2014-03-06 14:27 ` Austin Clements
@ 2014-03-11 10:02   ` David Belohrad
  0 siblings, 0 replies; 4+ messages in thread
From: David Belohrad @ 2014-03-11 10:02 UTC (permalink / raw)
  To: Austin Clements; +Cc: notmuch

Hi All,

thanks for extensive answers on this thread. The plum-1 and other
definitions are coming from 'tango-dark' theme of emacs 24, which I
wanted to modify. I understood hence, that the two ways of settings the
colors (notmuch/emacs24) are so far somehow incompatible and hence there
is no way how to specify the notmuch colors the emacs24 way.

many thanks
.d.



Austin Clements <amdragon@MIT.EDU> writes:

> Quoth David Belohrad on Mar 06 at  2:24 pm:
>> Dear All,
>> 
>> so far I'm changing some color faces programmatically:
>> 
>>   (setq notmuch-search-line-faces '(("deleted" . (:foreground "red"
>>                                                   :background "blue"))
>>                                      ("unread" . (:foreground "DeepSkyBlue"))
>>                                      ("flagged" . (:foreground "firebrick1"))
>>                                      ))
>> 
>> 
>> I recently upgraded to emacs24. I was using default shipped tango-dark
>> theme. Then (because of VHDL mode I'm using) I have created a custom
>> theme, and I'd like to 'backport' the piece of code above into the
>> custom theme so it is in accordance with the philosophy of themes.
>> 
>> I have no idea how to specify it using the 'class approach',as e.g.
>> 
>>    `(gnus-group-news-1 ((,class (:foreground ,plum-1))))
>>    `(gnus-group-news-1-low ((,class (:foreground ,plum-2))))
>> 
>> Any hint would be greatly appreciated
>
> I'm not sure what the values of `class', `plum-1', and `plum-2' are in
> your above snippet or what the context of that snippet is, so I may be
> misunderstanding your problem, but it may help to know that
> `gnus-group-news-1' and `notmuch-search-line-faces' are very different
> types of variables.
>
> The value of `gnus-group-news-1' is a face; something like
> (:foreground "plum1").  It looks like what you've written above is
> actually a "face specification", which uses a bunch of conditions (the
> ,class part) to determine which of several potential faces to assign
> to the variable (though you listed only one face for each variable, so
> I'm not sure why you have a condition).  It's unfortunate that Emacs
> distinguishes faces and face specification, but that's how it is.
>
> `notmuch-search-line-faces' is *not* a face variable like
> `gnus-group-news-1'.  It's an association list that maps tags to
> faces.  As such, it won't work if your theme is trying to treat it
> like a face variable, since its value is not a face, but rather a data
> structure that has faces in it.

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

end of thread, other threads:[~2014-03-11 10:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-06 13:24 how to specify notmuch colors in emacs24 David Belohrad
2014-03-06 13:52 ` Suvayu Ali
2014-03-06 14:27 ` Austin Clements
2014-03-11 10:02   ` David Belohrad

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