Now showing

Emacs: buffer-local faces (face-remap-add-relative)

Documentaries & Learning2022Creative Commons
Poster for Emacs: buffer-local faces (face-remap-add-relative)

About this film

In this video presentation, I demonstrate how to change Emacs faces only in specific contexts instead of using the standard methods which modify their global value. Context-dependent faces give us the freedom to particularise the presentation of certain interfaces or major-modes. I am already implementing those ideas in my LIN package: https://protesilaos.com/emacs/lin . The code I use starts from the basics and culminates in the creation of a minor-mode that can be invoked with M-x or via hooks. It covers all you need to get started. Such techniques are also discussed in the manual of my modus-themes package (built into Emacs 28 or higher): https://protesilaos.com/emacs/modus-themes . Below is the code I used for the demo: ;; This is what we will be using: (face-remap-add-relative SOURCE DEST) ;; To find the face at point, use M-x describe-char or type C-u C-x = ;; ;; To learn about all available faces from the loaded packages on your ;; system, use M-x list-faces-display ;; ;; Create a disposable buffer and evaluate the following (you'll soon ;; learn why a disposable buffer is needed): (face-remap-add-relative 'font-lock-comment-face 'error) ;; The problem with what I just showe…

Directors & creators

Protesilaos Stavrou

View on archive.org ↗

More from this pool

Documentaries & Learning

See all →