Now showing

Emacs: custom faces for Org emphasis styles (org-emphasis-alist)

Documentaries & Learning2022Creative Commons
Poster for Emacs: custom faces for Org emphasis styles (org-emphasis-alist)

About this film

In this video presentation, I demonstrate how to define Emacs “faces” for the purposes of configuring the user option org-emphasis-alist . In short: you can add more colours or alternative styles to your org-mode buffers for the different styles of emphasis that the Org notation supports. This video can also be described as an introduction to using the defface macro, as I explain all you need to know to get started. A face is a construct that holds display attributes, such as the colour of the text or a background value, as well as typographic properties like a bold weight and a slant. Faces can evaluate conditions to determine which set of attributes to apply. In practical terms, this means that we do not need different faces for light and dark themes: one definition with the appropriate checks will suffice. Below is the code I used for the demo: (setq org-emphasis-alist '(("*" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim) ("+" (:strike-through t)))) (defface my-org-emphasis-bold '((default :inherit bold) (((class color) (min-colors 88) (background light)) :foreground "#a60000") (((class color) (min-colors 88) (background dark)) :foreground…

Directors & creators

Protesilaos Stavrou

View on archive.org ↗

More from this pool

Documentaries & Learning

See all →