In my Org Agenda all text except for priorities use the "default" face. Until recently I would see colourful text for say, todo status. I was playing around with custom themes, so I may have broken something. However I can't seem to undo this change, even after reverting all changes.

How can I make the Org Agenda use the correct faces instead of just using "default"?

  • The *Org Agenda* buffer/mode uses text-properties, not font-lock. Enabling font-lock can have the effect of removing text-properties previously assigned. It may be possible to use a theme with an *Org Agenda* buffer so long as font-lock is not enabled. The theme would need to set the faces normally used by org-agenda-mode, which can also be set using the built-in customize user interface or set manually in the .emacs or other user-configuration file. – lawlist Jul 29 '15 at 5:47
  • Thank you - the issue was that I had applied rainbow-mode globally, which turned on font-lock in the *Org Agenda*, which removed the text-properties. If you'd like to write a short answer I'd be happy to mark it as correct. – Conor Jul 29 '15 at 13:45

org-agenda-mode relies on setting text-properties for the faces that are used in the *Org Agenda* buffer. When org-agenda-mode is enabled in the *Org Agenda* buffer, the following snippet is used to prevent font-lock-mode from being enabled:

;; Keep global-font-lock-mode from turning on font-lock-mode
(org-set-local 'font-lock-global-modes (list 'not major-mode))

Emacs does not do well when a marriage is attempted between font-lock-mode and text-properties to colorize text within a buffer. It is possible to some degree (with a lot of work), but probably is not recommended (nor worth the effort, in the opinion of this author). Thus, it is usually best to choose one or the other.

In this particular case, the original poster indicated that font-lock-mode was enabled by using rainbow-mode. Disabling rainbow-mode thus resolved the issue.

Overlays play well with both font-lock and text-properties. So perhaps the original poster could find a minor-mode that does not use font-lock to achieve the desired visual effect.

It is possible to create a custom org-agenda-mode that uses font-lock instead of text-properties [which is what this particular author has done], but that entails a lot of work and is ultimately a custom setup tailored to the needs of an individual user.

  • Thanks again for the comprehensive answer. Looking forward to you sharing your custom org-agenda-mode some time in the future :) – Conor Jul 29 '15 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.