5.15 Custom Org todo keyword and priority faces

Users of org-mode have the option to configure various keywords and priority cookies to better match their workflow. User options are org-todo-keyword-faces and org-priority-faces.

As those are meant to be custom faces, it is futile to have the themes guess what each user wants to use, which keywords to target, and so on. Instead, we can provide guidelines on how to customize things to one’s liking with the intent of retaining the overall aesthetic of the themes.

Please bear in mind that the end result of those is not controlled by the active Modus theme but by how Org maps faces to its constructs. Editing those while org-mode is active requires re-initialization of the mode with M-x org-mode-restart for changes to take effect.

Let us assume you wish to visually differentiate your keywords. You have something like this:

(setq org-todo-keywords
      '((sequence "TODO(t)" "|" "DONE(D)" "CANCEL(C)")
        (sequence "MEET(m)" "|" "MET(M)")
        (sequence "STUDY(s)" "|" "STUDIED(S)")
        (sequence "WRITE(w)" "|" "WROTE(W)")))

You could then use a variant of the following to inherit from a face that uses the styles you want and also to preserve the properties applied by the org-todo face (in case there is a difference between the two):

(setq org-todo-keyword-faces
      '(("MEET" . '(bold org-todo))
        ("STUDY" . '(warning org-todo))
        ("WRITE" . '(shadow org-todo))))

This will refashion the keywords you specify, while letting the other items in org-todo-keywords use their original styles (which are defined in the org-todo and org-done faces).

If you want back the defaults, try specifying just the org-todo face:

(setq org-todo-keyword-faces
      '(("MEET" . org-todo)
        ("STUDY" . org-todo)
        ("WRITE" . org-todo)))

When you inherit from multiple faces, you need to quote the list as shown further above. The order is significant: the first entry is applied on top of the second, overriding any properties that are explicitly set for both of them: any property that is not specified is not overridden, so, for example, if org-todo has a background and a foreground, while font-lock-type-face only has a foreground, the merged face will include the background of the former and the foreground of the latter. If you do not want to blend multiple faces, you do not need a quoted list. A pattern of ‘keyword . face’ will suffice.

Both approaches can be used simultaneously, as illustrated in this configuration of the priority cookies:

(setq org-priority-faces
      '((?A . '(bold org-priority))
        (?B . org-priority)
        (?C . '(shadow org-priority))))

To find all the faces that are loaded in your current Emacs session, use M-x list-faces-display. Try M-x describe-variable as well and then specify the name of each of those Org variables demonstrated above. Their documentation strings will offer you further guidance.

Recall that the themes let you retrieve a color from their palette. Do it if you plan to control face attributes.

Custom face specs using the themes’ palette.

Check color combinations.