chatgpt's answer
it’s that the two kinds of highlighting live in /different layers/ of Org’s
font-lock system.
Here’s what’s really happening:
*** 1\. TODO keywords
- Org fontifies them with a *dedicated regexp and its own face name per
keyword* .
- Those faces are looked up in =org-todo-keyword-faces=, which Org applies
/before/ any theme’s face merges happen.
- The theme doesn’t normally override that section of the buffer, so your color
wins “out of the box.”
*** 2\. Tags
- Tags are drawn as part of the *headline*, which already carries faces like
=org-level-1=, =org-level-2= , etc.
- The tag text also inherits the generic =org-tag= face from the theme.
- When multiple faces overlap, Emacs merges them—so the theme’s
foreground/background usually win.
- =org-tag-faces= merely adds another face to the mix; it doesn’t remove or
reorder the others.
- Hence your settings “work” technically (the face is there) but remain
invisible because they lose the merge battle.
That’s why packages such as *org-rainbow-tags* step outside that system: they
add their own font-lock rule /after/ Org’s built-ins, ensuring their faces sit
on top of everything.
If you want consistent tag coloring without fighting every theme, you have two
solid paths:
1. *Do it like =org-rainbow-tags=* – add a custom font-lock keyword for your
tags (as in the =my/org-colored-tags-mode= example).
It runs last and simply wins.
2. *Use overlays* – what you saw working earlier; overlays always override
normal face merges.
Both avoid theme interference entirely.
So yes, it’s not intuitive that TODOs “just work” and tags need extra handling,
but it’s a side-effect of how Org’s headline fontification was designed—not a
lack of thought from the developers.
On Wed, 15 Oct 2025, at 10:54, Racoon Chimp wrote:
> On Wed, 15 Oct 2025, at 08:27, Racoon Chimp wrote:
>> hello,
>>
>> i have used org-rainbow-tags, and i like the idea, but i do not care
>> about the random assignment. also the tags are specific to this one
>> file, so how can i colorize the tags in the org file?
>>
>> thanks,
>
> in the following example, the todo keywords change, no problem, but the
> tags do not
>
> # Local Variables:
> # org-default-properties: nil
> # org-tag-faces: ("great" . (:background "orange" :foreground "blue"))
> # org-todo-keyword-faces: (
> # ("HAVE.TO.SEE" . (:background "light gray" :foreground "red"))
> # )
> # End: