Emacs: ef-themes version 1.5.0
The ef-themes
is a collection of light and dark themes for GNU Emacs
whose goal is to provide colourful (“pretty”) yet legible options for
users who want something with a bit more flair than the modus-themes
(also designed by me).
- Package name (GNU ELPA):
ef-themes
- Official manual: https://protesilaos.com/emacs/ef-themes
- Change log: https://protesilaos.com/emacs/ef-themes-changelog
- Sample pictures: https://protesilaos.com/emacs/ef-themes-pictures
- Git repo on SourceHut: https://git.sr.ht/~protesilaos/ef-themes
- Mirrors:
- Mailing list: https://lists.sr.ht/~protesilaos/ef-themes
- Backronym: Eclectic Fashion in Themes Hides Exaggerated Markings, Embellishments, and Sparkles.
Below are the release notes.
The new ef-arbutus
and ef-rosa
themes
The ef-arbutus
theme combines red and green colours against a mild
light red-pink background. The announcement article contains
screenshots: https://protesilaos.com/codelog/2023-12-29-ef-arbutus/.
The ef-rosa
theme has a deep dark red-brown background with a blend
of magenta and green foregrounds. Check the blog post for pictures:
https://protesilaos.com/codelog/2024-01-06-emacs-ef-rosa/.
These two new entries bring the total count of the collection to 30.
Remember that you can set the user option ef-themes-to-toggle
to two
themes in the collection and switch between them with the command
ef-themes-toggle
. For example:
(setq ef-themes-to-toggle '(ef-arbutus ef-rosa))
Otherwise, use the command ef-themes-load-random
(call it with a
C-u
prefix argument to limit the result to either dark or light
themes, else call it from Lisp, like (ef-themes-load-random 'dark)
).
Stopped the transient
buffers from trying semantic key colouration
In a recent version of transient.el
, there is a new user option that
applies colour-coding to keys (e.g. we see those while using magit
):
transient-semantic-coloring
. This option is enabled by default,
changing the previous style that was used as a reference for all my
designs.
The idea with such colour coding is to indicate when a key continues to display the transient, exits with a given action, and the like. For our purposes this interface cannot work:
-
We need some place to teach users what each colour means, as there are no indicators of any sort to help them (whereas, say, in diff buffers we have the plus and minus signs).
-
Not all hues are suitable for highlighting a single character. In light themes, for example, green and yellow colours are TERRIBLE choices for the requirements of this interface where the key must be clearly visible. But when we introduce multiple colours, each with their own meaning, we will not be able to avoid those hues.
-
The style of key bindings is not limited to
transient.el
. We find them when we invokeM-x
, doM-x describe-bindings
, while using thewhich-key
package, and many more. If we are to change howtransient.el
shows key bindings, then we have to retain the same visual cues for other contexts. Otherwise, everything is inconsistent. -
All themes must use the same colours to preserve the colour coding, thus removing an important aspect of their presentation.
-
This whole paradigm does not work for themes that are optimised for users with colour deficiency, due to the reduced number of suitable hues. With deuteranopia, for example, we can only rely on yellow and blue: since yellow is not optimal for single key highlights against a light backdrop, blue is the only hue that works in such a context.
The ef-themes
will not support this user option. All relevant faces
use the style of standard key bindings.
Themes can enforce user option values, but I have decided to change the faces instead to better communicate my intent. If a user wants semantic colouring, they can change the faces to whatever they like.
The evil
prompts now show the correct colours
While using evil-mode
, the ex prompts no longer use their generic
hardcoded red value. They take an appropriate colour from the active
Ef theme.
The imenu-list
package is now supported
This package uses the built-in imenu
infrastructure to produce a
sidebar with points of interest in the buffer. Those headings now use
the correct colour values.
Thanks to newhallroad for bringing this matter to my attention in issue 35 on the GitHub mirror: https://github.com/protesilaos/ef-themes/issues/35.
The nerd-icons-completion
package is covered
This package defines a single face for directories/folders. It looks
like all the other nerd-icons
packages that use that icon, such as
nerd-icons-dired
.
Thanks to Ryan Kaskel for the contribution: https://lists.sr.ht/~protesilaos/ef-themes/patches/47379. The change is small. Ryan does not need to assign copyright to the Free Software Foundation.
Completed the coverage of the denote
faces
The new style ensures better thematic consistency.
These faces are found in Dired buffers when denote-dired-mode
is
enabled. Same for the default style of the backlinks buffer.
Changed highlights to avoid conflating “flagged” and “trashed” emails
This is for email clients such as mu4e
and notmuch
. Flagged ad
trashed emails used to have the same colour, which was a problem when
the user would try to filter in such a way as to show both at the same
time.
Thanks to Adam Porter (GitHub user alphapapa) for bringing this matter to my attention in issue 32 on the GitHub mirror: https://github.com/protesilaos/ef-themes/issues/32.
Support for more specialised faces
-
blink-matching-paren-offscreen
: Defined in the built-insimple.el
to highlight the matching parenthesis in the echo area when it is off screen (Emacs 30). -
mct-highlight-candidate
: Part of themct
package to highlight the currently selected completion candidate in the*Completions*
buffer. -
shr-mark
: Used by the built-inshr
library (Simple HTML Renderer) to highlight<mark>
tags (Emacs 29).
Expanded the semantic colour mappings
Each theme defines colours and then maps them to semantic constructs. The idea is to not hardcode colour values, but to have an indirection that enforces consistency, while keeping things flexible/customisable. Users can override palette entries as explained in the manual: https://protesilaos.com/emacs/ef-themes#h:4b923795-4b23-4345-81e5-d1c108a84b6a.
New semantic colour mappings are:
-
bg-search-current
: Background colour of the currently matched term of search interfaces, likeisearch
. -
bg-search-lazy
: This background is used in the same contexts as the above, but for matches other than the current one. -
bg-search-replace
: Background of the currently targeted replacement inquery-replace
operations or related. -
bg-search-rx-group-{0..3}
,: Backgrounds for regular expression groups, such as while usingM-x re-builder
. -
bg-fringe
andfg-fringe
: Applies to the background of the fringe area in Emacs frames. By default, the Ef themes do not use a distinct background there, so this is for those who need it. -
prose-table-formula
: Used for formula entries in plain text tables, such as with Org, to distinguish them from the other contents of the table.
Miscellaneous
-
Used the updated
modus-themes
formula for the contrast tables of all the Ef themes (stored in the filecontrast-ratios.org
in the project’s root directory).I made this change in commit
b410fcc
in themodus-themes
repo. The idea is to avoid the use of thecl-loop
and othercl-
functions that we don’t really need (and which also have their own mini language that I find hard to remember/use). -
Tweaked the value of a few accented backgrounds to better fit with each theme’s style. These colours may not be spotted anywhere right now, but are nonetheless available to those who use palette overrides (run the command
ef-themes-preview-colors
oref-themes-preview-colors-current
to visualise them).