Compare commits

...

298 commits
5.0.0 ... main

Author SHA1 Message Date
Protesilaos f1ad6c9383
Reorganise the links to other Modus projects in the README.md and clarify I am not endorsing anybody's views 2026-09-07 11:39:25 +03:00
Protesilaos d7e30694cb
Mention omarchy-modus-themes by Dhavan Vaidya in the README.md 2026-09-06 15:38:17 +03:00
Protesilaos bcf065b803
Add support for log-view-marked face (Emacs 32)
I wrote a patch for it in emacs.git.
2026-09-04 16:49:03 +03:00
Protesilaos a3e7ba2805
Make all flymake EOL faces have the same :height 0.9 2026-09-01 12:44:05 +03:00
Protesilaos fd124dc370
Make read-multiple-choice-face use the style of keybindings plus :inverse-video
This is to make repeat-echo-message more consistent while also
accounting for the original use-case of this face where the
surrounding text is that of the minibuffer prompt (and may thus look
similar/identical to the keybindings).
2026-09-01 05:11:05 +03:00
Protesilaos 24e4b4b9e4
Make log-edit-headers-separator same as separator-line (Emacs bug#81753)
This is the same topic as with commit 2bae09f. Thanks again to Dmitry
Gutov for the suggestion: <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81753>.
2026-08-31 19:13:17 +03:00
Protesilaos 2bae09feeb
Expand the separator-line style to work on TTY and graphics as needed (Emacs bug#81754)
Thanks to Dmitry Gutov for suggesting this in Emacs bug#81754:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=81754>
2026-08-31 19:11:32 +03:00
Protesilaos 0f4d27dd96
Add missing :version and :package-version from some defface 2026-08-31 19:01:26 +03:00
Protesilaos 27a0ed0260
Make completion-preview-common also have an underline
It looks more consistent this way when we type something that goes
from completion-preview-common to completion-preview-exact.
2026-08-31 18:55:50 +03:00
Protesilaos 9a3cd56cc2
Include the modus-themes-common-palette-user in the resulting palette (Emacs bug#81640)
Thanks to Lucas Jimenez for reporting the bug on the Emacs bug tracker.
2026-08-29 22:26:55 +03:00
Protesilaos b86cace435
Cover query-replace-preview-match (Emacs 32)
This is to (i) only :inherit once and (ii) for me to remember this face.
2026-08-25 10:24:40 +03:00
Protesilaos 21ffe0cd5a
Mention peppers-theme by Joar von Arndt in the README.md 2026-08-24 12:10:46 +03:00
Protesilaos 75ad377135
Reword two statements in the manual 2026-08-19 23:03:37 +03:00
Protesilaos 8ebcedea65
Add support for query-replace-preview (Emacs 32) 2026-08-16 13:54:03 +03:00
Protesilaos 887af1139e
Add modus-vague by @paniash to the list of themes based on Modus 2026-08-13 14:07:23 +03:00
Protesilaos 52d4665bc5
Mention word-smith by @Sadsnake1 in the README.md
I was informed about it in issue 229:
<https://github.com/protesilaos/modus-themes/issues/229>.
2026-08-11 10:53:00 +03:00
Protesilaos 75aa3fa79e
Simplify the flymake end-of-line faces 2026-07-30 10:19:53 +03:00
Protesilaos 940249694c
Extend support for flycheck faces 2026-07-30 10:19:38 +03:00
Protesilaos 7d53a6959c
Add support for (setq magit-diff-use-indicator-faces t) 2026-07-22 10:11:54 +03:00
Protesilaos e81c3c6ce3
Remove two obsolete company-mode faces 2026-07-17 14:09:09 +03:00
Protesilaos 47dc463561
Clarify how Modus-related projects are listed in the README.md 2026-07-16 22:07:41 +03:00
Protesilaos 50b7a66423
Mention modus-alabaster by Derek Passen @dpassen in the project's README.md 2026-07-16 22:06:24 +03:00
Protesilaos 9a46f89607
Add TODO for more faces that I might want to bring back 2026-07-14 10:16:35 +03:00
Protesilaos 3c98eadc35
Bring back the Modus mark faces
Read the commit message of bf69c6c for the explanation.
2026-07-14 10:08:46 +03:00
Protesilaos 4bd5e91ee0
Add support for the synaxis package by Thanos Apollo 2026-07-14 09:41:05 +03:00
Protesilaos f2b88b4d7f
Simplify the faces I just reinstated 2026-07-14 09:18:30 +03:00
Protesilaos a1d081256e
Bring back the Modus search facesc
Read the commit message of bf69c6c for the explanation.
2026-07-14 09:12:22 +03:00
Protesilaos 0cf5a2a52a
Bring back the Modus completion faces
Read the commit message of bf69c6c for the explanation.
2026-07-14 09:04:23 +03:00
Protesilaos bf69c6cbcc
Bring back the modus-themes-prompt face
At some point I removed all the :inherit entries out of concern that
we would run into problems with circular dependencies (there was that
case with button and link inheriting each other, which recent Emacs
versions treat as an error).

With the Modus faces that can happen if the user configures things
accordingly or if I make some mistake here.

My plan now is to rely on Modus faces for cases such as this one, but
to not use :inherit for other faces, since I do not control how those
are defined.
2026-07-14 08:56:56 +03:00
Protesilaos 35586477b1
Add README.md reference to folio-theme by @kn66 2026-07-13 12:26:09 +03:00
Protesilaos 31e8394cb1
Acknowledge Heitor Augusto for commit 89e40be
This was done in pull request 225: <https://github.com/protesilaos/modus-themes/pull/225>.
The change is small, meaning that Heitor does not need to assign
copyright to the Free Software Foundation.
2026-07-12 12:27:59 +03:00
Protesilaos 21d97d4fe6
Remove trailing spaces from modus-themes--get-theme-palette-subr 2026-07-12 12:26:55 +03:00
Protesilaos 89294a9a6f
Merge pull request #225 from HeitorAugustoLN/patch-1
Improve core palette loading logic
2026-07-12 12:22:57 +03:00
Protesilaos f237b3ec47
Acknowledge Yuta Yamamoto for commit b3bd04a
This was done in pull request 227: <https://github.com/protesilaos/modus-themes/pull/227>.
The change is small, meaning that Yuta does not need to assign
copyright to the Free Software Foundation.
2026-07-12 12:19:58 +03:00
Protesilaos 61b5e30bb8
Merge pull request #227 from yutayamamoto/fix-auto-dim-face-names
Update auto-dim-other-buffers faces to their new names
2026-07-12 12:19:05 +03:00
Yuta Yamamoto b3bd04aca5 Update auto-dim-other-buffers faces to their new names
The package dropped the `-face' suffix: `auto-dim-other-buffers-face'
and `auto-dim-other-buffers-hide-face' are now obsolete aliases for
`auto-dim-other-buffers' and `auto-dim-other-buffers-hide'.
2026-07-08 15:13:27 +09:00
Protesilaos a69a3c80b6
Remove outdated reference to project mailing list
Thanks to Yuta Yamamoto for telling me about this in issue 226:
<https://github.com/protesilaos/modus-themes/issues/226>.
2026-07-07 23:08:48 +03:00
Heitor Augusto 89e40be4d8
Improve core palette loading logic
Enhance theme palette loading by ensuring core palette is loaded before accessing its value.
2026-07-06 21:17:13 +00:00
Protesilaos a071a9d8e7
Acknowledge Shawn LeMaster for commits c981ca6, 50c42fe, f28a5e5
These are part of pull request 224: <https://github.com/protesilaos/modus-themes/pull/224>.
2026-07-02 11:51:31 +03:00
Protesilaos a378446107
Merge pull request #224 from shlemas/main
Improve mapping coverage for modus-themes-generate-palette + tests
2026-07-02 11:50:20 +03:00
Protesilaos 9172a0e8ef
Add support for vc-dir-key-binding-hint-label (Emacs 32) 2026-06-28 13:42:10 +03:00
Shawn LeMaster f28a5e5931 Add missing quotes on color names 2026-06-27 22:12:59 -05:00
Shawn LeMaster 50c42fe90d Add more mappings to modus-themes-generate-palette + test 2026-06-27 17:42:40 -05:00
Shawn LeMaster c981ca60ae Add complete-palette-mappings test 2026-06-27 17:24:11 -05:00
Protesilaos c6a08aa1a8
Mention the modus-noric themes by Ashton Wiersdorf 2026-06-23 22:13:35 +03:00
Protesilaos 2d044ac89f
Update to modus-themes version 5.3.0 2026-06-21 16:25:01 +03:00
Protesilaos f97a9b0240
Mention pixel-themes by Lucas (@lucasobx) as project that builds on top of Modus 2026-06-16 09:28:44 +03:00
Protesilaos ef2fa82b12
Change read-multiple-choice-face to work with any combination of prompt colours 2026-05-22 10:20:20 +03:00
Protesilaos 87d5764ecc
Update elfeed faces to their new names
Thanks to Daniel Mendler for telling me about this change:
<https://github.com/emacs-elfeed/elfeed/pull/562#issuecomment-4511165960>.
2026-05-21 23:15:10 +03:00
Protesilaos c115002430
Change the fill-column-indicator background to unspecified
Thanks to vpxyz for telling me about the relevant warning. This was
done in issue 219: <https://github.com/protesilaos/modus-themes/issues/219>.
2026-05-19 13:38:17 +03:00
Protesilaos a47ed7af3f
Recompile the Info manual 2026-05-17 13:34:25 +03:00
Protesilaos 124ba3168e
Make fill-column-indicator appear a thin line also on TTY
I am doing this in response to issue 218, as reported by Mike Crowe:
<https://github.com/protesilaos/modus-themes/issues/218>.
2026-05-17 13:34:20 +03:00
Protesilaos c6bb5eb8df
Use the correct form to deprecate the modus-themes-prompt face 2026-05-08 23:29:53 +03:00
Protesilaos a4b6ada971
Deprecate the user option modus-themes-completions 2026-05-08 23:29:53 +03:00
Protesilaos 634dcc3245
Deprecate the user option modus-themes-prompts 2026-05-08 23:15:03 +03:00
Protesilaos c8925cd23b
Modify the manual about the version of the themes in Emacs 31
I wanted to get this done, but I had no time for it.
2026-05-07 20:39:44 +03:00
Protesilaos b242d43e6a
Make elfeed-show-entry-author-face conditionally bold 2026-05-06 08:27:53 +03:00
Protesilaos b4eca2c241
Add support for markdown-ts-mode 2026-05-05 22:40:37 +03:00
Protesilaos 806c894611
Add support for the margin face (Emacs 31) 2026-05-05 21:35:18 +03:00
Protesilaos 02a339ab2d
Mention my modus-themes-exporter in the README.md 2026-05-03 22:19:04 +03:00
Protesilaos c2be0f59b5
Rewrite the manual about modus-themes-mixed-fonts
Okay, this is enough for tonight. I still have a long way to go with this...
2026-05-03 22:11:42 +03:00
Protesilaos 211a72b708
Rewrite the manual about modus-themes-to-rotate 2026-05-03 22:03:44 +03:00
Protesilaos b7f64effe5
Rewrite the manual about modus-themes-to-toggle 2026-05-03 22:01:21 +03:00
Protesilaos 7c3c48b6dd
Rewrite the manual about modus-themes-italic-constructs 2026-05-03 21:59:03 +03:00
Protesilaos 1fc28ad804
Rewrite the manual about modus-themes-bold-constructs 2026-05-03 21:58:58 +03:00
Protesilaos 3ab7b22105
Rewrite the manual about modus-themes-disable-other-themes 2026-05-03 21:51:31 +03:00
Protesilaos 7f146f8826
Continue making stylistic changes to the manual 2026-05-03 21:45:36 +03:00
Protesilaos 5efd13653a
Merge pull request #217 from Stebalien/steb/elfeed
Add support for the new elfeed-show faces
2026-05-03 10:07:09 +03:00
Steven Allen 34c169a780 Add support for the new elfeed-show faces
The faces match the other elfeed faces where possible, and
notmuch/message faces otherwise (given that the elfeed interface is
inspired by notmuch).
2026-05-02 08:58:45 -07:00
Protesilaos 010ed94527
Start rewriting the manual
I will review the entire document, but this is enough for the evening.
2026-05-01 21:52:03 +03:00
Protesilaos 0164619a09
Be consistent about letter casing in the manual's Org PROPERTIES drawers 2026-05-01 20:18:09 +03:00
Protesilaos 8ebdc208ae
Mention in the README.md the Modus derivatives I am aware of 2026-05-01 20:01:25 +03:00
Protesilaos 2156e94a40
Same small rewording to the README.md 2026-05-01 20:01:13 +03:00
Protesilaos 15c77ce939
Update the test for modus-themes-wcag-formula
I prefer to have an error if the wrong colour is provided.
2026-05-01 17:44:49 +03:00
Protesilaos 0775c7ee92
Update test for modus-themes--hex-or-name-to-rgb
It is called differently now and also throws an error if it must.
2026-05-01 17:44:15 +03:00
Protesilaos c9c0974747
Write test for modus-themes-color-hex-p 2026-05-01 17:43:28 +03:00
Protesilaos cf0044518f
Deprecate modus-themes-generate-gradient and use modus-themes-adjust-value instead
They are meant to do the same thing.
2026-05-01 17:41:48 +03:00
Protesilaos 8d62a73f2a
Make modus-themes-adjust-value not depend on color-lighten-name
This is because that function relies on color-name-to-rgb which does
not seem to work in the early-init.el as reported by amano-kenji in
issue 215: <https://github.com/protesilaos/modus-themes/issues/215>.
2026-05-01 17:40:45 +03:00
Protesilaos 4b286c2b61
Change all HEX-COLOR parameters to COLOR in light of commit 488e913 2026-05-01 17:37:26 +03:00
Protesilaos 488e913b1e
Make helper function accept named colours as well as hex RGB
Otherwise we have a regression. Something like "gray50" is a valid
colour value (when list-colors-display returns it, anyway).
2026-05-01 17:35:30 +03:00
Protesilaos f71db69bad
Use "Protesilaos" instead of "Protesilaos Stavrou"
As I announced here: <https://protesilaos.com/news/2026-04-21-omitting-the-surname/>.
2026-04-24 13:27:23 +03:00
Protesilaos Stavrou 7c2ce1ff0d
Add support for the trust-manager package 2026-04-18 16:13:16 +03:00
Protesilaos Stavrou 7950791b52
Clarify the comment about evaluating user options before loading a theme 2026-04-17 22:51:55 +03:00
Protesilaos Stavrou 195011352e
Reword a heading in the manual 2026-04-17 22:49:56 +03:00
Protesilaos Stavrou a2c40a9f92
Add support for tab-line-active and tab-line-inactive faces (Emacs 31) 2026-04-17 12:42:03 +03:00
Protesilaos Stavrou 657fd6f92d
Make modus-themes-retrieve-palette-value public 2026-04-13 15:33:08 +03:00
Protesilaos Stavrou 9e87779b5e
Replace "doc string" with "docstring" 2026-04-13 08:45:14 +03:00
Protesilaos Stavrou ea87862946
Add a comment about the use of format in two tests 2026-04-12 18:46:25 +03:00
Protesilaos Stavrou 8635304365
Acknowledge Elias Gabriel Perez for commit 51c89ec
This was done in pull request 213: <https://github.com/protesilaos/modus-themes/pull/213>.

The change is small, meaning that Elias does not need to assign
copyright to the Free Software Foundation.
2026-04-10 23:44:16 +03:00
Protesilaos Stavrou ef4197d5ae
Merge pull request #213 from DevelopmentCool2449/main
Fix regression in mc/cursor-mc/cursor-bar-face
2026-04-10 23:43:14 +03:00
Elias Gabriel Perez 51c89ec604 * modus-themes.el (modus-themes-faces): Fix regression in mc/cursor-bar-face 2026-04-10 13:02:56 -06:00
Protesilaos Stavrou 4ca21529ae
Make stylistic tweaks to modus-themes-test--define-test (mtt-define-test) 2026-04-10 21:39:21 +03:00
Protesilaos Stavrou 704edc5af3
Update the "Author:" field in modus-themes-test.el 2026-04-10 21:33:18 +03:00
Protesilaos Stavrou 551f4254c8
Acknowledge Benjamin Kästner for commit 44cc370
This was done in pull request 212: <https://github.com/protesilaos/modus-themes/pull/212>.

The change is within the ~15-line limit for non-trivial changes,
meaning that Benjamin does not need to assign copyright to the Free
Software Foundation.
2026-04-10 21:30:37 +03:00
Protesilaos Stavrou 44cc370313
Merge pull request #212 from bkaestner/main
Make DOCSTRING in mtt-define-test optional
2026-04-10 21:29:03 +03:00
Benjamin Kästner f90869584a Remove explicit optional DOCSTRING `nil's
The explicit `nil's actually don't break the previously introduced
functionality. As (stringp nil) is `nil', it was interpreted as a
missing DOCSTRING.

However, they now contain only noise.
2026-04-10 18:29:24 +02:00
Benjamin Kästner 742054c713 Make DOCSTRING in mtt-define-test optional
This commit removes mtt-define-test's explicit DOCSTRING argument and
instead inspects the first entry of the given ARGS:

- if (car args) is a string, it is interpreted as a DOCSTRING
- otherwise, it is considered to be part of the test's BODY

Examples:

;; No docstring
(macroexpand-1
 '(mtt-define-test trivial-check
    (should (= 1 1))))
=> (ert-deftest mtt-trivial-check nil "Test that `trivial-check' does the right thing." (should (= 1 1)))

;; With docstring
(macroexpand-1
 '(mtt-define-test trivial-check-with-docstring
    "This tests a trivial thing."
    (should (= 1 1))))
=> (ert-deftest mtt-trivial-check-with-docstring nil "This tests a trivial thing." (should (= 1 1)))

mtt-define-test's own docstring follows the usual \(fn ARGLIST)
feature used for macros, see "(elisp) Function Documentation".
2026-04-10 18:29:24 +02:00
Protesilaos Stavrou 0217c0dde5
Refine modus-themes--color-eight-to-six-digits
Thanks to Stefan Monnier for pointing this in a message to the
emacs-devel mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2026-04/msg00358.html>.
2026-04-10 18:57:57 +03:00
Protesilaos Stavrou 8a8ed85ae7
Make stylistic change to the test of modus-themes-sort 2026-04-10 16:26:12 +03:00
Protesilaos Stavrou d2f64a8a4f
Write test for modus-themes-sort 2026-04-10 16:24:52 +03:00
Protesilaos Stavrou f430f287bd
Write macro to express tests how I want them 2026-04-10 16:24:38 +03:00
Protesilaos Stavrou ec4c79c472
Write test for modus-themes--background-p 2026-04-10 15:59:50 +03:00
Protesilaos Stavrou 087b419503
Write a test for modus-themes--belongs-to-family-p 2026-04-10 15:57:36 +03:00
Protesilaos Stavrou d76bbf9865
Write test for modus-themes--belongs-to-family-p 2026-04-10 15:55:31 +03:00
Protesilaos Stavrou dce91510b3
Write test for modus-themes-activate 2026-04-10 15:37:29 +03:00
Protesilaos Stavrou df74b73a60
Write a test for modus-themes--color-eight-to-six-digits and use its name instead of the older symbol 2026-04-10 14:58:24 +03:00
Protesilaos Stavrou 282dbd66b5
Improve modus-themes-adjust-value and write a test for it 2026-04-10 14:58:06 +03:00
Protesilaos Stavrou b31966fe65
Change name of ancillary function to be more precise and refine its implementation 2026-04-10 14:57:36 +03:00
Protesilaos Stavrou c63be80d3b
Refine modus-themes-contrast and write a test for it 2026-04-10 14:48:51 +03:00
Protesilaos Stavrou 953ec93841
Refine modus-themes-wcag-formula and write a test for it 2026-04-10 14:48:14 +03:00
Protesilaos Stavrou f062c8d99a
Write a test for modus-themes--hex-to-rgb 2026-04-10 14:21:18 +03:00
Protesilaos Stavrou a134889772
Add missing parenthesis to a doc string 2026-04-10 14:16:29 +03:00
Protesilaos Stavrou 2e19f038c3
Update the modus-themes--hex-to-rgb doc string 2026-04-10 14:03:51 +03:00
Protesilaos Stavrou 6fa9f61f48
Fix current year in modus-themes-test.el 2026-04-10 12:55:59 +03:00
Protesilaos Stavrou dbd67e1140
Update the modus-themes-test.el copyright years 2026-04-10 12:49:08 +03:00
Protesilaos Stavrou 937ee8047b
Make stylistic change to modus-themes--hex-to-rgb 2026-04-10 12:45:32 +03:00
Protesilaos Stavrou 7d234fd65f
Make blink-matching-paren-offscreen the same as show-paren-match
Thanks to Troy Brown for suggesting this change in issue 209:
<https://github.com/protesilaos/modus-themes/issues/209>.
2026-04-05 21:15:09 +03:00
Protesilaos Stavrou b07a5d5001
Reinstate 'provide' in all theme files
I thought this was not needed, but Ihor Radchenko showed me a useful
example. This was done in issue 207: <https://github.com/protesilaos/modus-themes/issues/207>.
2026-04-05 16:33:11 +03:00
Protesilaos Stavrou 9492b9e3fa
Mention modus-themes.nvim in the README.md
A project by @miikanissi.
2026-04-05 16:26:38 +03:00
Protesilaos Stavrou 0a6f5d33a3
Mention zed-modus-themes in the README.md
A project by @vitallium.
2026-04-05 16:24:20 +03:00
Protesilaos Stavrou d763988f80
Mention hugo-modus in the README.md
I am putting it here instead of the manual. The latter is synchronised
with emacs.git and I do not want to have any issues about mentioning
projects that may not be in line with GNU policy.
2026-04-05 16:16:54 +03:00
Protesilaos Stavrou 84528d1f3e
Refine the typst-ts-script-char-face to use bold conditionally
This is about the user option modus-themes-bold-constructs.
2026-04-05 15:53:21 +03:00
Protesilaos Stavrou 5e69da089a
Make font-latex-script-char-face look like escape-glyph 2026-04-05 15:52:37 +03:00
Protesilaos Stavrou bbb43a6f62
Add initial support for typst-ts-mode
Thanks to Pranshu Sharma for making this suggestion in issue 208:
<https://github.com/protesilaos/modus-themes/issues/208>.
2026-04-05 15:52:05 +03:00
Protesilaos Stavrou e0f42f2740
Extend support for my lin package faces 2026-03-25 10:09:07 +02:00
Protesilaos Stavrou e5fb7f2229
Update the manual's acknowledgements for commit 83501bc 2026-03-20 08:17:15 +02:00
Protesilaos Stavrou 83501bcd50
Correct the modus-themes-toggle behaviour to match its doc string
I want to prompt for a theme only if modus-themes-to-toggle is not
right.

Thanks Morten Kjeldgaard for bringing this matter to my attention in
issue 44 in the ef-themes repository (those are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/44>.
2026-03-20 08:15:02 +02:00
Protesilaos Stavrou 5e1621d638
Make the breadcrumb faces inherit from their base face
This way users can apply, say, a font height that carries over to all
the faces.

Thanks to baconabo for making this suggestion in issue 204:
<https://github.com/protesilaos/modus-themes/issues/204>.
2026-03-16 20:17:51 +02:00
Protesilaos Stavrou c865abc82d
Remove blank line 2026-03-15 21:48:02 +02:00
Protesilaos Stavrou 30cbfe27b5
Consolidate some colours in the modus-themes-common-palette-mappings 2026-03-15 21:47:09 +02:00
Protesilaos Stavrou 6beea7125e
Define new bg-popup named colour
This gives users and derivative themes the option to pick a suitable
value for those interfaces.

Thanks to aikrahguzar for making this suggestion in issue 70 of my
ef-themes repository (the ef-themes are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/70>.
2026-03-15 21:28:05 +02:00
Protesilaos Stavrou 100533ab0f
Remove background value from company-preview face
This makes it consistent with the style I am applying to the built-in
completion-preview-mode.
2026-03-15 21:28:02 +02:00
Protesilaos Stavrou a4264088b7
Make modus-themes-adjust-value return 6-digit colour 2026-03-14 10:57:29 +02:00
Protesilaos Stavrou ed36e34132
Bring back the modus-themes-adjust-value
Derivative themes may need it.
2026-03-08 21:43:54 +02:00
Protesilaos Stavrou cb20bbe83f
Remove needless comment 2026-03-08 21:30:46 +02:00
Protesilaos Stavrou 9d0226961d
Include the featurep check in modus-themes-theme
This is because our check involves this:

    (let ((theme-exists-p (get name 'theme-feature)) ...) ...)

Thanks to Daniel Colascione for informing me about this in issue 201:
<https://github.com/protesilaos/modus-themes/issues/201>.
2026-03-01 12:07:59 +02:00
Protesilaos Stavrou 789cb7ea32
Revert "Add back theme-autoload cookies to all theme files"
This reverts commit b2e0aff5ed.

It does not work as intended, as reported by Daniel Colascione in
issue 202: <https://github.com/protesilaos/modus-themes/issues/202>. I
will need to make a wider revision here.
2026-03-01 12:05:46 +02:00
Protesilaos Stavrou b45b0d8a7c
Only disable 'color-schemes' with modus-themes-disable-other-themes
This is because Emacs 31 comes with a "newcomer" theme that we do not
want to disable by mistake.
2026-02-22 08:43:39 +02:00
Protesilaos Stavrou ecd696daf8
Add support for my institution-calendar faces 2026-02-20 08:58:50 +02:00
Protesilaos Stavrou b2e0aff5ed
Add back theme-autoload cookies to all theme files
I tried to do this with a recent commit but that broke things because
I also included a deftheme declaration. Having that meant that
modus-themes-theme would not declare the theme with all its data,
including its palette.

I looked at loaddefs-generate--emacs-batch and it seems that having
just the theme-autoload line is enough.
2026-02-19 08:43:20 +02:00
Protesilaos Stavrou 1343ea9947
Revert "Reinstate the theme-autoload cookie with the deftheme in place"
This reverts commit 122d53333f.

The reason is that this breaks the package when trying to load a theme
at startup. This was reported by Eamonn Sullivan in issue 69 in the
ef-themes repository: <https://github.com/protesilaos/ef-themes/issues/69>.
2026-02-18 20:44:05 +02:00
Protesilaos Stavrou 122d53333f
Reinstate the theme-autoload cookie with the deftheme in place
We need this because otherwise the autolaods are not generated
properly, which can cause problems for other packages that need to
read the theme data.
2026-02-18 18:48:27 +02:00
Protesilaos Stavrou 127ed57f0e
Remove magit face that does not exist anymore 2026-02-17 09:26:40 +02:00
Protesilaos Stavrou 9dd3b9074b
Acknowledge Mike Olson for commit c475454
This is what allows the modus-themes to be loaded in the early-init.el
because they no longer depend on color-name-to-rgb to be available at
that time.

This change was done in pull request 199: <https://github.com/protesilaos/modus-themes/pull/199>.
It is within the ~15-line limit, meaning that Mike does not need to
assign copyright to the Free Software Foundation.
2026-02-17 09:15:57 +02:00
Protesilaos Stavrou 9af856fb38
Merge pull request #199 from mwolson/fix/color-values-display-independence
Use color-values-from-color-spec instead of color-name-to-rgb
2026-02-17 09:13:13 +02:00
Mike Olson c475454d87 Use color-values-from-color-spec instead of color-name-to-rgb
Replace `color-name-to-rgb' with a new internal helper
`modus-themes--hex-to-rgb' that uses `color-values-from-color-spec'
(a C built-in since Emacs 28.1) to parse hex RGB strings without
any display dependency.

This fixes a crash when loading a Modus theme during early-init.el
on GUI Emacs (e.g. macOS Homebrew emacs-plus), where
`color-name-to-rgb' fails because `color-values' returns nil before
the display is ready.

The fix applies to all three direct call sites:
- `modus-themes-wcag-formula' (the critical one, called during
  theme loading)
- `modus-themes-generate-color-blend'
- `modus-themes-color-warm-p'

Fixes #198.
2026-02-16 15:04:35 -05:00
Protesilaos Stavrou 0ace30e471
Write tests for dark colour and readable colour 2026-01-31 10:14:40 +02:00
Protesilaos Stavrou b633768b7c
Rewrite mtt-inheritance test to restore the current Modus theme 2026-01-31 10:13:45 +02:00
Protesilaos Stavrou ea135519d3
Revert to using a readable foreground for the org-habit faces
This relies on our own functions, which should be available even if
the theme is loaded via the early-init.el.

Thanks to Jacod "Jake" Gordon for reminding me to fix this and for
testing my prototype. It was done in issue 197:
<https://github.com/protesilaos/modus-themes/issues/197>.
2026-01-31 10:00:35 +02:00
Protesilaos Stavrou 27456c3121
Change modus-themes--list-colors-tabulated to use our own function for a readable foreground (commit 2c225b6) 2026-01-31 10:00:07 +02:00
Protesilaos Stavrou 2c225b634e
Define function to get readable foreground, based on our own "dark-p" (per commit 4ecefd9) 2026-01-31 09:59:34 +02:00
Protesilaos Stavrou 4ecefd924f
Implement our own "dark-p" which relies on our WCAG formula test
This way I can more easily reason about the return value.
2026-01-31 09:58:21 +02:00
Protesilaos Stavrou 4b4fd65336
Change the parameter name in a couple of places to suggest it is a hexadecimal RGB colour 2026-01-31 09:56:45 +02:00
Protesilaos Stavrou 39682cd87c
Make stylistic changes to the WCAG formula functions 2026-01-31 09:56:13 +02:00
Protesilaos Stavrou ba747a245f
Change the scroll-bar background to ensure better visibility 2026-01-25 08:59:38 +02:00
Protesilaos Stavrou 0f6ce4f8bb
Remove the box and background from the completion group titles and make them optionally italic 2026-01-24 10:18:37 +02:00
Protesilaos Stavrou c57f158886
Only use bold in org-list-dt
The reason is that the foreground overrides other foregrounds, such as
for ~code~ elements.
2026-01-23 09:32:51 +02:00
Protesilaos Stavrou 55be658ddf
Use a background and box for the completion groups 2026-01-21 08:55:00 +02:00
Protesilaos Stavrou 8a45a1393a
Tweak the format of the modus-themes-with-colors error message 2026-01-13 06:31:26 +02:00
Protesilaos Stavrou 4d9a19513d
Update the copyright years 2026-01-11 12:45:54 +02:00
Protesilaos Stavrou 192b2f612e
Go back to using a "success" colour for git commit summary lines
This is because it is the only colour that is guaranteed to contrast
with the warning and error colours we use for long lines and non-empty
second line.
2026-01-10 07:57:30 +02:00
Protesilaos Stavrou 0b6956a783
Be more strict about how to check for loaded theme
This is because typically themes have a 'provide-theme' in their file,
which we do not have in our theme files. Not doing a 'provide-theme'
at all times can break user configurations.

Thanks to Daniel Colascione for pointing this out in issue 195:
<https://github.com/protesilaos/modus-themes/issues/195>.
2026-01-10 07:51:08 +02:00
Protesilaos Stavrou 073e1d2488
Remove outdated comment 2026-01-09 07:11:35 +02:00
Protesilaos Stavrou afe5c14f30
Acknowledge Steven Allen for commit e22df92
This was done in pull request 194: <https://github.com/protesilaos/modus-themes/pull/194>.
Steven has assigned copyright to the Free Software Foundation.
2026-01-09 07:03:49 +02:00
Protesilaos Stavrou 8f05f03bc9
Merge pull request #194 from Stebalien/steb/fix-gradients
Lighten/darken colors in a specified direction instead of guessing
2026-01-09 07:01:09 +02:00
Steven Allen e22df9248c Lighten/darken colors in a specified direction instead of guessing
Previously, we'd sometimes specify a direction, but then we'd guess the
direction again `modus-themes-generate-gradient'. This commit removes
that guess and specifies the direction explicitly in all cases.

fixes https://github.com/protesilaos/ef-themes/issues/65
2026-01-08 09:48:03 -08:00
Protesilaos Stavrou be8111f267
Acknowledge ukiran03 for commit 7eeadab
This was done in pull request 193:
<https://github.com/protesilaos/modus-themes/pull/193>.

The change is small, meaning that ukiran03 does not need to assign
copyright to the Free Software Foundation.
2026-01-08 18:36:44 +02:00
Protesilaos Stavrou 7eeadab5d8
Merge pull request #193 from ukiran03/widget-field-underline
Set widget-field underline face to border color
2026-01-08 18:35:38 +02:00
Protesilaos Stavrou e438a2fcdc
Acknowledge JD Smith for commit e8dee25
This was done in pull request 191: <https://github.com/protesilaos/modus-themes/pull/191>.
2026-01-08 06:46:35 +02:00
Protesilaos Stavrou b38aaf265f
Merge pull request #191 from jdtsmith/with-colors-symbol-macrolet
Rewrite modus-themes-with-color to use cl-symbol-macrolet
2026-01-08 06:45:36 +02:00
ukiran03 f5df8edd15 Set widget-field underline face to border color
The widget-field underline inherits the foreground color by default.
This change ensures it uses the border face for better visual
consistency.

Fixes: https://github.com/protesilaos/modus-themes/issues/192
2026-01-05 10:13:32 +05:30
JD Smith e8dee25bd6 Rewrite modus-themes-with-color to use cl-symbol-macrolet
To address bugs associated with real color vs. mapped color ordering
and other issues, we swap the let* form construction for
cl-symbol-macrolet.
2026-01-04 09:37:20 -05:00
Protesilaos Stavrou 53fa9fd23d
Document how users can configure vc-annotate colours 2026-01-03 07:55:35 +02:00
Protesilaos Stavrou 3247c5d0f7
Add support for the faces of my pulsar package
Their colours are consistent with Modus by default, but they will not
necessarily look right in Modus derivatives.
2026-01-02 12:48:46 +02:00
Protesilaos Stavrou d1a9fbb4e6
Add support for the faces of my lin package
Their colours are consistent with Modus by default, but they will not
necessarily look right in Modus derivatives.
2026-01-02 12:47:00 +02:00
Protesilaos Stavrou 5b4747748e
Port emacs.git commit e09990891ffac9fa20385a8a38a18edf2e27d246
This is done by Eshel Yaron, as discussed on the mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2026-01/msg00011.html>.
2026-01-02 11:33:54 +02:00
Protesilaos Stavrou d1037f1322
Update to modus-themes version 5.2.0 2025-12-31 10:34:19 +02:00
Protesilaos Stavrou fc20e2bf7a
Cover the xref-file-header face 2025-12-28 11:28:54 +02:00
Protesilaos Stavrou 89185784ea
Fix typo in doc string 2025-12-28 08:31:47 +02:00
Protesilaos Stavrou 6dcd369037
Use a higher luminance value for modus-themes-generate-gradient 2025-12-23 07:58:45 +02:00
Protesilaos Stavrou cd01e5ead6
Use shorthands in the tests' file 2025-12-23 07:17:20 +02:00
Protesilaos Stavrou d673df22ca
Make small tweaks to modus-themes-test-inheritance 2025-12-23 07:06:55 +02:00
Protesilaos Stavrou 46d4b49266
Update the manual on account of commit 7a86cf4 2025-12-19 15:06:58 +02:00
Protesilaos Stavrou 7a86cf49a8
Revise modus-themes-with-colors to work with dynamic variables
This is how it used to be. I am addressing a regression that was
introduced in Modus themes version 5.0.0.

Thanks to Alexandr Semenov and realazy for testing my patch in issue
170: <https://github.com/protesilaos/modus-themes/issues/170>.
2025-12-19 15:04:34 +02:00
Protesilaos Stavrou 4ac7fdd6c7
Rewrite the completion table and expand it with group and display sort functions 2025-12-13 04:56:09 +02:00
Protesilaos Stavrou c8a6aa6998
Apply a faint foreground to marginalia-file-name 2025-12-13 04:55:29 +02:00
Protesilaos Stavrou 03c716e5bb
Merge pull request #189 from basil-conto/blc/spell
Fix some docstring typos
2025-12-11 08:44:16 +02:00
Protesilaos Stavrou cb99f74bc9
Merge pull request #188 from rudolf-adamkovic/main
Fix incorrect face inheritance affecting AUCTeX
2025-12-11 08:44:05 +02:00
Protesilaos Stavrou 0358a2a460
Merge pull request #190 from basil-conto/blc/push
Minor logic simplifications
2025-12-11 08:42:51 +02:00
Basil L. Contovounesios 83670578ea
Minor logic simplifications
Prefer push over add-to-list when membership equal-ity is not
needed.  Simplify some boolean expressions.
2025-12-09 14:06:08 +01:00
Basil L. Contovounesios e1154773ce
Fix some docstring typos 2025-12-09 13:56:01 +01:00
Rudolf Adamkovič 9649a18f69 Fix incorrect face inheritance affecting AUCTeX 2025-12-08 14:35:29 +01:00
Protesilaos Stavrou 64735b7df0
Remove duplicate entries for faces
Thanks to Basil L. Contovounesios for pointing this out in issue 185:
<https://github.com/protesilaos/modus-themes/issues/185>.
2025-12-06 09:59:42 +02:00
Protesilaos Stavrou 703dad8fd1
M-x untabify and then re-indent the buffer 2025-12-06 09:46:09 +02:00
Protesilaos Stavrou 582f53b07b
Add doc string to modus-themes--modus-theme-p 2025-12-06 09:45:36 +02:00
Protesilaos Stavrou 175a519494
Tweak the adjustment for derivative backgrounds in modus-themes-generate-palette and add TODO about it 2025-12-06 09:39:44 +02:00
Protesilaos Stavrou 53f461b397
Merge pull request #184 from PierreTechoueyres/main
Fix modus-themes-toggle and modus-themes--disable-themes
2025-12-03 09:54:14 +02:00
Pierre Téchoueyres 725bf50aba Fix modus-themes-toggle by using modus-themes-get-current-theme 2025-12-02 21:53:03 +01:00
Pierre Téchoueyres bf9dfed400 Add modus-themes--modus-theme-p predicate.
Rewrite modus-themes-get-current-theme and modus-themes--disable-themes to use it
2025-12-02 21:51:18 +01:00
Pierre Téchoueyres 7d06212953 Fix modus-themes--disable-themes to follow modus-themes-disable-other-themes
Disable themes of the modus collection when the value of the variable
is nil as stated in the docstring.
2025-12-02 21:47:30 +01:00
Protesilaos Stavrou 3cc6f7fec2
Implement a completions group-function and use unique category 2025-12-02 05:24:44 +02:00
Protesilaos Stavrou 2c901c9969
Make derived modus-themes-define-derivative-command doc strings a bit shorter 2025-11-30 19:00:56 +02:00
Protesilaos Stavrou c41281151f
Adjust the intensity of the derived coloured backgrounds in modus-themes-generate-palette 2025-11-29 07:13:07 +02:00
Protesilaos Stavrou b238abe7fc
Remove one mapping from modus-themes-generate-palette
It will be inherited from the underlying core palette. Styling this
here is not important.
2025-11-29 07:12:53 +02:00
Protesilaos Stavrou bcaf0835fd
Require color.el at all times
This is because other packages may use some of the color-related
functions we provide without calling modus-themes-generate-palette.
2025-11-29 07:12:39 +02:00
Protesilaos Stavrou 117875cb12
Rewrite modus-themes-get-current-theme to work with many custom-enabled-themes
Thanks to Pierre Téchoueyres for reporting the scenario where multiple
other themes are loaded on top of a Modus theme. This was done in
issue 182: <https://github.com/protesilaos/modus-themes/issues/182>.
2025-11-28 07:41:48 +02:00
Protesilaos Stavrou 2a32f92782
Remove obsolete argument from one modus-themes-get-current-theme call (see commit 7076680) 2025-11-26 18:47:28 +02:00
Protesilaos Stavrou 7076680932
Remove logic of theme loading from modus-themes-get-all-known-themes
It has no business there. This is something I used to do long ago and
I tried to keep it for the upgrade to version 5.0.0. I believe we are
safe without it, but I guess we will find out.
2025-11-26 18:34:38 +02:00
Protesilaos Stavrou 344946ac0e
Make modus-themes-activate load a theme if we cannot operate on it
Annotate the code to better communicate intent.
2025-11-26 18:31:22 +02:00
Protesilaos Stavrou f4474129e6
Simplify how modus-themes-generate-palette falls back to cool or warm preference 2025-11-26 13:07:03 +02:00
Protesilaos Stavrou 1ee7c20971
Fix modus-themes-generate-palette old assumption about the six accent colours
This was fine when I originally implemented it, but then I changed
some other parts and forgot to update this one...
2025-11-26 13:06:27 +02:00
Protesilaos Stavrou ffdee3a436
Tweak a couple of derived mappings in modus-themes-generate-palette 2025-11-26 07:19:20 +02:00
Protesilaos Stavrou fdcbb99be2
Use the correct foreground for org-dispatcher-highlight and make it bold unconditionally 2025-11-26 06:33:30 +02:00
Protesilaos Stavrou 6fc7630666
Document how to activate derivative themes 2025-11-26 06:30:22 +02:00
Protesilaos Stavrou fc3783e5d3
Also autoload modus-themes-activate 2025-11-26 06:23:38 +02:00
Protesilaos Stavrou dbbfff6582
Make modus-themes-activate a public function
I plan to mention it in the manual.
2025-11-26 06:16:57 +02:00
Protesilaos Stavrou 0958eb8e48
Reduce all generated colors to 6 digits (see commit 1129cf5) 2025-11-26 06:04:43 +02:00
Protesilaos Stavrou 1129cf5f92
Define helper to reduce a color from 4 digits per triplet to 2 2025-11-26 06:04:00 +02:00
Protesilaos Stavrou ecfd90d430
Make copy of color-blend because we need it for older versions 2025-11-26 06:03:09 +02:00
Protesilaos Stavrou 7bfc18d130
Be consistent with the terminology I am using in one comment
I have "cool" elsewhere, so better not confuse people.
2025-11-25 16:00:34 +02:00
Protesilaos Stavrou 3b0bbaa779
Simplify modus-themes-color-warm-p
Thanks to Stefan Monnier for pointing this out on the emacs-devel
mailing list: <https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00996.html>.

It is what I was trying to do before with 'color-distance', per the
comment right above:

    ;; NOTE 2025-11-25: I used to rely on `color-distance', thinking that
    ;; it would do the right thing here:
    ;;
    ;;     (> (color-distance color "#ff0000") (color-distance color "#0000ff"))
    ;;
    ;; But my understanding of "warm" versus "cold" is simple, so better
    ;; do it my way.

But I did not originally see the simpler modus-themes-color-warm-p, so here we are!
2025-11-25 14:15:40 +02:00
Protesilaos Stavrou 01080b292b
Rewrite modus-themes--activate for clarity 2025-11-25 13:13:58 +02:00
Protesilaos Stavrou 1d0348fc64
Stop hardcoding colour values for the three Gnus mail groups 2025-11-25 12:48:54 +02:00
Protesilaos Stavrou c2cf943239
Simplify the test for warm or cool preference (see commit d0f1537) 2025-11-25 10:54:41 +02:00
Protesilaos Stavrou d0f1537f95
Implement modus-themes-color-warm-p because color-distance fails to do what I assumed 2025-11-25 10:54:15 +02:00
Protesilaos Stavrou 1a346f825b
Refine how we disable other themes
We do not need to actually disable other Modus themes because their
palettes have the same entries, so the active theme will anyway take
effect over the others. And if another Modus theme has more colours in
its palette, then the user probably wants to keep those around.
2025-11-25 09:00:09 +02:00
Protesilaos Stavrou 7f5e40060a
Also cover the identifier mapping in modus-themes-generate-palette 2025-11-25 08:50:56 +02:00
Protesilaos Stavrou a8583fae4e
Cover new search mappings in modus-themes-generate-palette (see commit cf8cc86) 2025-11-25 08:47:59 +02:00
Protesilaos Stavrou cf8cc86afc
Implement semantic mappings for search-related foregrounds
By the way, I love occur+kmacros! All these changes are so easy to make.
2025-11-25 08:41:09 +02:00
Protesilaos Stavrou b48837de67
Add yet more mappings to modus-themes-generate-palette 2025-11-25 08:24:02 +02:00
Protesilaos Stavrou 0088add0ad
Make modus-themes-generate-palette define more mappings 2025-11-25 08:17:20 +02:00
Protesilaos Stavrou e49b1e0248
Reword some parts of the section about modus-themes-generate-palette 2025-11-25 07:41:56 +02:00
Protesilaos Stavrou c15eea4125
Write the manual's detailed guide for modus-themes-generate-palette
We can always refine the implementation details, but at least the
results are looking very promising. I think/hope users will benefit
from this enhancement.
2025-11-24 19:39:38 +02:00
Protesilaos Stavrou 80db306ddb
Update the modus-themes-generate-palette doc string 2025-11-24 17:39:56 +02:00
Protesilaos Stavrou ec8f8a80b1
Conditionally push to mappings in modus-themes-generate-palette
I think this is done now. All that remains is to (i) polish the
derived colors because some of them are not nice and (ii) check the
code again to make sure I am not being sloppy.
2025-11-24 14:51:04 +02:00
Protesilaos Stavrou 4694dc5a8b
Resolve the duplicates and prioritisation in modus-themes-generate-palette 2025-11-24 14:49:25 +02:00
Protesilaos Stavrou 78e79d3eba
Reindent modus-themes-generate-palette 2025-11-24 14:18:08 +02:00
Protesilaos Stavrou 2c85a495cb
Push a derived colour only if needed in modus-themes-generate-palette
I want to do the same for the mappings, but I will have to go soon...
2025-11-24 14:13:22 +02:00
Protesilaos Stavrou 24d426e59b
Use cadr not cdr in modus-themes-generate-palette 2025-11-24 14:08:21 +02:00
Protesilaos Stavrou ed618c1050
Add two error checks for the type of modus-themes-generate-palette arguments 2025-11-24 13:54:41 +02:00
Protesilaos Stavrou 51dd0362b9
Fix a typo 2025-11-24 13:54:33 +02:00
Protesilaos Stavrou 1a7867074e
Make modus-themes-generate-palette require at bg-main and fg-main 2025-11-24 13:48:16 +02:00
Protesilaos Stavrou feecb71130
Make modus-themes-generate-palette accept optional mappings and refine its internals
I wrote those changes earlier, but then forgot to commit. Then I came
back and accidentally reverted/destroyed what I had... This is going
off of memory, but I will need to check again.
2025-11-24 13:41:05 +02:00
Protesilaos Stavrou 0730b28045
Add missing fullstop in first line of modus-themes-generate-palette doc string 2025-11-24 12:08:46 +02:00
Protesilaos Stavrou a416bc4906
Add missing autoload for modus-themes-generate-palette 2025-11-24 12:08:38 +02:00
Protesilaos Stavrou 823d31d19b
Use optional preference for modus-themes-generate-palette 2025-11-24 07:37:53 +02:00
Protesilaos Stavrou 72bf76eb84
Define prototype of modus-themes-generate-palette
I will document it later. First I want to make sure it works decently.
2025-11-24 07:18:19 +02:00
Protesilaos Stavrou ef3e513dfe
Add the missing registration of derivative themes in modus-themes-theme 2025-11-24 07:17:49 +02:00
Protesilaos Stavrou 5af03b7294
Add comment about doing something like modus-themes--box for some underlines 2025-11-23 18:34:17 +02:00
Protesilaos Stavrou 23e443a016
Pass correct attributes when ':box (:color unspecified)'
We have to make sure that the value passed to :color is not
'unspecified'. Users may want to do this, given the option they have
via the overrides, and it is a fine use of the system. Internally
though, we have to adjust the :box to do the right thing instead of
throwing an error.

Thanks to JD Smith for reporting a bug along those lines in issue 9 of
my standard-themes repo (they are derived from the modus-themes, hence
the changes here): <https://github.com/protesilaos/standard-themes/issues/9>.
I am generalising the fix for all faces that could exhibit the same
problem. I will check if we need to do the same for some of the underlines.
2025-11-23 18:21:15 +02:00
Protesilaos Stavrou a472f54645
Update modus-themes-define-derivative-command-known-suffixes to include select-{dark,light} 2025-11-22 16:48:12 +02:00
Protesilaos Stavrou c270cd8f5e
Implement convenience commands modus-themes-select-{dark,light} 2025-11-22 14:15:36 +02:00
Protesilaos Stavrou 26d60d3e6b
Disambiguare calendar-today from org-date-selected
This is because both can appear in the same context, whereas I thought
this would never happen.

Thanks to Rudolf Adamkovič for discussing this with me in the context
of the same change for my doric-themes (issue 20):
<https://github.com/protesilaos/doric-themes/issues/20>.
2025-11-22 11:41:47 +02:00
Protesilaos Stavrou 53717d1607
Support transient-semantic-coloring (also see commit 81862df) 2025-11-19 07:29:04 +02:00
Protesilaos Stavrou 81862dfa99
Define modus-themes-faces-deuteranopia and modus-themes-faces-tritanopia
These are meant to be applied as a deviation from modus-themes-faces,
as they are specific to the needs of users with the given colour deficiency.
2025-11-19 07:28:04 +02:00
Protesilaos Stavrou 065fbe15e7
Remove transient named colour faces that do not exist anymore 2025-11-19 07:27:26 +02:00
Protesilaos Stavrou 2602e2c0db
Use more appropriate style for completion-preview-exact and add note about it 2025-11-18 19:30:35 +02:00
Protesilaos Stavrou 3ddb82b37b
Add explicit support for the built-in completion-preview-mode faces
We want to do this because completion-preview-exact hardcodes a colour
value, which does not work for our purposes.

Thanks to Kevin Fleming for asking me about this in issue 178:
<https://github.com/protesilaos/modus-themes/issues/178>.
2025-11-18 12:38:20 +02:00
Protesilaos Stavrou f79684961e
Use optional bold weight for hl-todo faces
This is how we were doing it before until I undid it by mistake.

Thanks to Dominik Schrempf for reporting the bug in issue 177:
<https://github.com/protesilaos/modus-themes/issues/177>.
2025-11-17 12:14:45 +02:00
Protesilaos Stavrou 88fca8fd42
Change how we get the palette for modus-themes-with-colors
This makes it so derivative theme actually get their own colours
instead of those coming from the core theme. Same for user-defined
palette overrides.

Another advantage of this approach is that we keep a separation of
concerns between the different uses we have for the palettes we
retrieve and the structure we want them to have. I prefer this over a
helper function that has to behave according to some optional
parameter.

This is in response to issue 175 by Fritz Gabo, which reports a bug
about derivative themes not getting the right colours when using
modus-themes-with-colors: <https://github.com/protesilaos/modus-themes/issues/175>.

Also thanks to Roshan Shariff for testing my suggested changes (i.e.
this diff) and informing me of getting the expected results out of them.
2025-11-15 13:37:13 +02:00
Protesilaos Stavrou b9eb16d1a1
Make neo-vc-removed-face consistent with vc-removed-state (see commit e08fb8a)
Thanks to Morgan Willcock for discussing with me the use of the
:strike-through style in issue 169: <https://github.com/protesilaos/modus-themes/issues/169>.

The plan is to review all uses of :strike-through to determine which
ones actually benefit from it.
2025-11-14 10:05:00 +02:00
Protesilaos Stavrou e08fb8adcd
Use a wavy underline for vc-removed-state 2025-11-14 10:04:48 +02:00
Protesilaos Stavrou bb548f6564
Use a wavy underline and warning colour for vc-missing-state 2025-11-14 10:04:42 +02:00
Protesilaos Stavrou 3058909617
Use warning instead of err for the vc-dir-status-warning
We use the err colour in other places.
2025-11-14 10:01:13 +02:00
Protesilaos Stavrou ee27621ce8
Use a wavy underline style for Notmuch tag addition and removal
This way the notmuch-tag-deleted is not using a style that is unique
to it. The wavy underline is easy to spot and does not obfuscate the
text of the tag.

Thanks to Morgan Willcock for discussing with me the use of the
:strike-through style in issue 169: <https://github.com/protesilaos/modus-themes/issues/169>.

The plan is to review all uses of :strike-through to determine which
ones actually benefit from it.
2025-11-14 09:42:14 +02:00
Protesilaos Stavrou 0e3b21ef87
Improve the consistency of transient.el unavailable indicators 2025-11-14 07:04:51 +02:00
Protesilaos Stavrou 0cd0b3cc7b
Diversify symbol-overlay faces to all have unique background colours
That was the case before, but I must have changed it by accident when
I was removing most of the :inherit attributes.
2025-11-12 14:29:31 +02:00
Protesilaos Stavrou 3b0850883a
Stop using readable-foreground-color for the org-habit faces
It breaks the themes when they loaded via the early-init.el, as
reported by Gaston Cabotin in issue 174:
<https://github.com/protesilaos/modus-themes/issues/174>.
2025-11-12 08:14:06 +02:00
Protesilaos Stavrou c94938ff79
Greatly expand the manual with complete examples of creating Modus derivatives
This covers the basic and more advanced use cases. It also is for both
private use and making new packages.
2025-11-10 13:02:49 +02:00
Protesilaos Stavrou 4c6a73dc71
Make modus-themes-with-colors use the correct order for palette entries
This affects how the overrides are handled when they mention  a
semantic palette mapping, which itself is a semantic palette mapping.

Thanks to Alexandr Semenov for reporting a relevant bug and testing
this diff in issue 170: <https://github.com/protesilaos/modus-themes/issues/170>.
2025-11-09 11:57:24 +02:00
Protesilaos Stavrou d46e782510
Make gnus-button less intrusive
It is not really a link and it also gets applied to a lot of places
that should not look exactly like links.

Thanks to Morgan Willcock for discussing this with me in issue 140:
<https://github.com/protesilaos/modus-themes/issues/140>.
2025-11-09 11:41:10 +02:00
Protesilaos Stavrou 4fd8cdfc55
Update to modus-themes version 5.1.0 2025-11-07 07:53:36 +02:00
Protesilaos Stavrou bbaa20a45b
Add missing NO-ENABLE to theme check in modus-themes-with-colors-subr
I added that parameter specifically for this case. When I was
committing edd5b66, I thought I had passed it here, but apparently I
did not because that commit also reverted 5777db8...
2025-11-06 10:00:59 +02:00
Protesilaos Stavrou a1149ce5e7
Clarify that a derivative theme has to be in a file among custom-theme-load-path
Thanks to Ashton Wiersdorf for asking for clarification about this in
issue 171: <https://github.com/protesilaos/modus-themes/issues/171>.
2025-11-05 12:55:45 +02:00
Protesilaos Stavrou edd5b66833
Revert 1b66344 and tweak how modus-themes-with-colors binds display spec and 'unspecified'
For some reason the macro was no longer working with commit 1b66344
after I restarted Emacs. Will investigate further. This should
nevertheless be the final commit that fixes all known issues with
modus-themes-with-colors.
2025-11-05 12:39:11 +02:00
Protesilaos Stavrou 5777db8d9b
Fix error with positional argument in latest commit 9c65704 2025-11-05 12:28:41 +02:00
Protesilaos Stavrou 9c65704b61
Avoid recursion in modus-themes-with-colors through enable-theme-functions
The modus-themes-with-colors should either work on an already loaded
theme or do nothing. Otherwise with the enable-theme-functions we end
up with excessive lisp nesting.

Thanks to Alexandr Semenov for reporting the bug in issue 170:
<https://github.com/protesilaos/modus-themes/issues/170>.
2025-11-05 12:21:05 +02:00
Stefan Monnier 1b663444fe
Make modus-themes-with-colors evaluate body as a function
See the discussion on the emacs-devel mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00114.html>.
2025-11-05 10:07:49 +02:00
Protesilaos Stavrou 11329d1c49
Make modus-themes--with-colors-resolve-palette-sort easier to read and remove second processing for 'unspecified' 2025-11-04 10:44:24 +02:00
Protesilaos Stavrou 0844ec814a
Remove CRITICAL FIXME comment
I think I have fixed it. Will continue testing throughout the day. If
it works, then I will bump the version number to trigger a GNU ELPA
rebuild. Will also updated emacs.git.
2025-11-04 09:50:09 +02:00
Protesilaos Stavrou 0eae2aa8f5
Make palette sort remove duplicates and limit its use to modus-themes-with-colors
This means that the overrides will be the only ones present instead of
the original values. Also, we do not need this in general but only in
the context of the modus-themes-with-colors.
2025-11-04 08:10:20 +02:00
Protesilaos Stavrou 247f5803bc
Pass missing LEXICAL to 'eval'
This might be what I was missing the whole time. I think the macro is
working now. Will continue testing...
2025-11-04 07:52:31 +02:00
Protesilaos Stavrou 7e06d30099
Make modus-themes-with-colors call a function and update CRITICAL FIXME findings
The updated code of the macro relative to commit 16c2c66 works
correectly at all times ONLY WHEN the function that uses
modus-themes-with-colors is added to the modus-themes-after-load-theme-hook
and thus triggered by modus-themes-load-theme.

The enable-theme-functions and load-theme combination is not working
though and I need to figure out why. It leads to excessive lisp nesting.
2025-11-04 07:00:58 +02:00
Protesilaos Stavrou 0b67bdfb20
Tweak how modus-themes-known-p works with a symbol argument
There is no point in doing seq-every-p with one element...
2025-11-04 06:36:28 +02:00
Protesilaos Stavrou 4fca99d3ac
Document that modus-themes-get-theme-palette may return nil 2025-11-04 06:36:05 +02:00
Protesilaos Stavrou dda6a00e37
Make modus-themes--get-theme-palette-subr return nil instead of an error for unknown THEME 2025-11-04 06:12:25 +02:00
Protesilaos Stavrou 2bc9c72fbd
Make modus-themes-get-theme-palette more efficient
Otherwise modus-themes-get-current-theme calls modus-themes-get-themes
which is also what modus-themes-known-p needs to do.
2025-11-04 06:08:39 +02:00
Protesilaos Stavrou 72ed98f786
Implement modus-themes--get-theme-sort
This makes it easier to place the return value of 'modus-themes-get-theme-palette'
in a 'let*' because something like '(cursor red-warmer)' will come
after '(red-warmer "#ff0000")'.

This might help me sort out the woes with the excessive lisp nesting
of modus-themes-with-colors (see commits 5e77bff and 4514036), but
looks appropriate anyway.
2025-11-04 05:55:31 +02:00
Protesilaos Stavrou 4514036961
Expand the CRITICAL FIXME for modus-themes-with-colors with the failed macro+function test I did
I tried a few variations of that function, but the point is that I
cannot make the macro work inside of a function that is evaluated at
startup in a user's init file. The same function works after I go and
evaluate it manually.

I stumbled across 'define-inline' while looking around in the Emacs
source code, but I am not sure this is what I need... Will need to
test further.
2025-11-04 05:07:39 +02:00
Protesilaos Stavrou 5e77bff62e
Add detailed CRITICAL FIXME comment about modus-themes-with-colors 2025-11-04 03:26:03 +02:00
Protesilaos Stavrou 68de71e7aa
Make modus-themes-with-colors only work when a theme is current
We do not want to break the enable-theme-functions when it is called
with any other non-Modus theme.
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 0839a6b3cb
Change the logic of modus-themes-get-current-theme
The previous one was faulty because we would get "the first enabled
Modus theme", even if it was not the current one. Whereas I want the
"first enabled only if it is a Modus theme".
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 70b31306d0
Never throw an error in modus-themes-known-p
Just return nil or the theme. It is the job of other functions to
produce errors.
2025-11-03 20:15:01 +02:00
Protesilaos Stavrou 1d3bdbd2e5
Reinstate what we were doing with load-theme
This undoes what I was trying to do with commits ef3e0e5 (use 'load'
instead of 'load-themes') and 67b6db3 (let bind hooks to nil).

What I did before was wrong. I was thrown off by the fact that
'enable-theme-functions' works with all themes, not just colour
themes. This includes 'user'. In some tests I also got other
configuration themes like 'use-package' or even the ones that come
from my 'fontaine' and 'spacious-padding' packages. But I did not
bother to figure out when those themes would show up. By default,
at least 'user' is passed to the 'enable-theme-functions'.

With 'emacs -Q':

    (defun test (theme)
      (message "Current theme is `%s'" theme))

    (add-hook 'enable-theme-functions #'test)

    (load-theme 'modus-operandi)

    ;; ;; From the *Messages*:
    ;;
    ;; Current theme is ‘user’
    ;; Current theme is ‘modus-operandi’
2025-11-03 20:12:02 +02:00
Protesilaos Stavrou 88d6a8d721
Make markdown-italic-face always italic 2025-11-03 07:07:46 +02:00
Protesilaos Stavrou ef3e0e5d4d
Use 'load' instead of 'load-theme' for the initial theme reification
This looks cleaner and saves us from the trouble of having to deal
with any hooks after load-theme at this early stage. I took the file
binding from the load-theme source.

Fundamentally, I want to have a theme symbol, like 'modus-operandi'
exist with all the relevant 'theme-properties' so that something like
'modus-themes-list-colors' can work with it even before
modus-operandi-theme.el is loaded.
2025-11-02 17:36:14 +02:00
Protesilaos Stavrou 6e1bdce593
Remove strike-through from jabber-roster-user-offline
It does not lead to a nice result. Thanks to Morgan Willcock for
bringing this matter to my attention in issue 169:
<https://github.com/protesilaos/modus-themes/issues/169>.
2025-11-02 14:43:57 +02:00
Protesilaos Stavrou 67b6db32fb
Disable all hooks when activating the themes the first time 2025-11-02 10:06:28 +02:00
14 changed files with 5317 additions and 2920 deletions

View file

@ -1,5 +1,5 @@
#+TITLE: Change log of the Modus Themes for GNU Emacs
#+AUTHOR: Protesilaos Stavrou
#+AUTHOR: Protesilaos
#+EMAIL: info@protesilaos.com
#+OPTIONS: ':nil toc:nil num:nil author:nil email:nil
@ -15,6 +15,488 @@ For further details, please consult these additional resources:
+ Manual :: <https://protesilaos.com/emacs/modus-themes>
+ Screenshots :: <https://protesilaos.com/emacs/modus-themes-pictures>
* 5.3.0 on 2026-06-21
:PROPERTIES:
:CUSTOM_ID: h:b4fa17a7-77a3-4e54-9af8-6a413b6b4e7c
:END:
The Modus themes are in a stable state. To my mind, they provide the
best "default theme" experience across the 40+ original themes I have
carefully designed.
Modus is also a platform for making themes for Emacs. There are plenty
of derivatives already. I am linking to them through the project's
README.md and am always happy to mention more packages---just let me
know.
This version does not include many user-facing changes. Most of my
work focused on making internal refinements.
** Load the themes through the =early-init.el=
:PROPERTIES:
:CUSTOM_ID: h:4d80aeaa-e93f-4cca-a2b2-792700081ead
:END:
The Modus themes can now be loaded through the =early-init.el= file.
The idea is to avoid the flash of light that occurs under certain
conditions during startup.
This feature is the result of several changes to helper functions,
especially those contributing to the ~modus-themes-generate-palette~
function that Modus derivatives may be relying on.
Thanks to Steven Allen for an intermediate refinement in pull request
194 and to Mike Olson for another relevant tweak in pull request 199:
- <https://github.com/protesilaos/modus-themes/pull/194>
- <https://github.com/protesilaos/modus-themes/pull/199>
Steven's contribution no longer exists in the code base due to other
changes I made, but was still useful at the time.
Both changes are small, meaning that their authors do not need to
assign copyright to the Free Software Foundation.
Also thanks to Jacod "Jake" Gordon for reminding me to apply one of
the new functions to the ~org-habit~ faces. This was done in issue
197: <https://github.com/protesilaos/modus-themes/issues/197>.
** The underline for widget fields has the correct colour
:PROPERTIES:
:CUSTOM_ID: h:c936a591-25ff-440d-88e8-e710da2c3f59
:END:
Relevant faces use the palette entry for =border= (invoke the command
~modus-themes-preview-colors~ or ~modus-themes-preview-colors-current~
to view the entries in a theme's palette).
A popular package that makes use of =widget.el= widgets is ~notmuch~.
Thanks to ukiran03 for the contribution, which was done in pull
request 193: <https://github.com/protesilaos/modus-themes/pull/193>.
The change is small, meaning that ukiran03 does not need to assign
copyright to the Free Software Foundation.
** A palette can now have a =bg-popup= entry
:PROPERTIES:
:CUSTOM_ID: h:bb9166ae-2424-4edf-8004-91e99ff8555a
:END:
This gives users and derivative themes the option to pick a suitable
value for popup interfaces, such as those of the ~company~ and ~corfu~
packages.
Thanks to aikrahguzar for making this suggestion in issue 70 of my
~ef-themes~ repository (the ~ef-themes~ are built on top of the
~modus-themes~ since Modus version =5.0.0=, Ef version =2.0.0=):
<https://github.com/protesilaos/ef-themes/issues/70>.
** Support for faces or packages
:PROPERTIES:
:CUSTOM_ID: h:cb1de864-f749-46e6-a8c4-1b5c47a59aff
:END:
- ~lin~ by Protesilaos.
- ~pulsar~ by Protesilaos.
- ~institution-calendar~ by Protesilaos.
- ~markdown-ts-mode~ by Rahul Martim Juliato and Stéphane Marks.
- ~trust-manager~ by Eshel Yaron.
- ~typst-ts-mode~ by Ziqi Yang. Thanks to Pranshu Sharma for
suggesting its inclusion in issue 208:
<https://github.com/protesilaos/modus-themes/issues/208>.
- new ~elfeed~ faces since the maintenance of the project was assumed
by Daniel Mendler, Karthik Chikmagalur, and Ihor Radchenko. To this
end, thanks to Steven Allen for pull request 217 that added the
=elfeed-show-*= faces: <https://github.com/protesilaos/modus-themes/pull/217>
** Internal refinements to the ~modus-themes-with-colors~ macro
:PROPERTIES:
:CUSTOM_ID: h:36d438e6-2779-4e34-b9ae-bb26503643ed
:END:
It now correctly handles the order of default palette colours and
user-defined palette overrides. Thanks to JD Smith for the
contribution in pull request 191: <https://github.com/protesilaos/modus-themes/pull/191>.
The change is small, meaning that JD does not need to assign copyright
to the Free Software Foundation.
** The ~multiple-cursors~ are fine even when a bar is used
:PROPERTIES:
:CUSTOM_ID: h:d707af16-66c9-4520-bd96-129e7b0511dd
:END:
When the ~cursor-type~ is configured to be a =bar=, the fake cursors
produced by the ~multiple-cursors~ package will still look right.
Thanks to Elias Gabriel Perez for the change to the
~mc/cursor-bar-face~ in pull request 213: <https://github.com/protesilaos/modus-themes/pull/213>.
** The ~blink-matching-paren-offscreen~ is the same as ~show-paren-match~
:PROPERTIES:
:CUSTOM_ID: h:025061cd-ebdf-47bd-a596-9e8e9d6afa7d
:END:
This is for thematic consistency. Thanks to Troy Brown for suggesting
this change in issue 209: <https://github.com/protesilaos/modus-themes/issues/209>.
** Get ~vc-annotate~ look right
:PROPERTIES:
:CUSTOM_ID: h:73e5911d-fe08-43b4-b3d9-e5a79af447b0
:END:
The built-in ~vc-annotate~ command relies on a user option to read
color values. We cannot handle this nicely at the theme level. Users
need to write their own configuration like this:
#+begin_src emacs-lisp
(defun my-modus-vc-annotate (&rest _)
(modus-themes-with-colors
(setq vc-annotate-background-mode nil)
(setq vc-annotate-very-old-color fg-dim)
(setq vc-annotate-color-map
`(( 20. . ,red)
( 40. . ,red-cooler)
( 60. . ,red-warmer)
( 80. . ,yellow-warmer)
(100. . ,yellow)
(120. . ,yellow-cooler)
(140. . ,green-warmer)
(160. . ,green)
(180. . ,green-cooler)
(200. . ,cyan-cooler)
(220. . ,cyan-warmer)
(240. . ,cyan)
(260. . ,blue-warmer)
(280. . ,blue)
(300. . ,blue-cooler)
(320. . ,blue-intense)
(340. . ,magenta-cooler)
(360. . ,fg-dim)))))
(with-eval-after-load 'vc-annotate
(my-modus-vc-annotate)
(add-hook 'enable-theme-functions #'my-modus-vc-annotate))
#+end_src
[ The above code is relevant as of this writing. Though remember that
I do not keep older publications up-to-date. The only source of
truth is the manual of the Modus themes. ]
** Two old user options are no longer needed
:PROPERTIES:
:CUSTOM_ID: h:39eb95f4-76b1-46b8-8f2e-245591c2ec03
:END:
The user options ~modus-themes-completions~ and ~modus-themes-prompts~
are obsolete. They used to be relevant before the introduction of
palette overrides.
** Rewrote large parts of the manual
:PROPERTIES:
:CUSTOM_ID: h:73703b3a-ef75-4cc0-97ca-344f8d6812ba
:END:
I did it for clarity, but also to remove notes that were specific to
older versions of Emacs.
** Many new ERT tests for the project
:PROPERTIES:
:CUSTOM_ID: h:98134bb3-9eea-4fc2-9f21-bc619508de8a
:END:
I have written many tests. They do not cover every single function,
though the plan is to do that eventually. These tests are important to
ensure that Modus is a solid platform for making derivative themes.
Much of this was done live: <https://protesilaos.com/codelog/2026-04-10-emacs-spontaneous-live-modus-themes/>.
Thanks to Benjamin Kästner for a couple of tweaks to a relevant macro
in the tests' file. This was done in pull request 212, with further
changes by me: <https://github.com/protesilaos/modus-themes/pull/212>.
** Links to projects related to Modus
:PROPERTIES:
:CUSTOM_ID: h:50301743-a109-4d96-83dd-3b8c7c6b90ed
:END:
In the README.md I now mention projects that are related to the Modus
themes, such as derivative Emacs themes, but also ports for other
editors.
There is also a link to my ~modus-themes-exporter~ package, which I
developed during a live stream:
- <https://github.com/protesilaos/modus-themes-exporter>
- <https://protesilaos.com/codelog/2026-04-13-emacs-live-develop-modus-themes-exporter-package/>
** Git commits
:PROPERTIES:
:CUSTOM_ID: h:e869b1e6-5bc1-4d79-83cd-bb3f648c3ebf
:END:
#+begin_src
git shortlog 5.2.0..5.3.0 --summary --numbered
123 Protesilaos
2 Benjamin Kästner
2 Steven Allen
1 Elias Gabriel Perez
1 JD Smith
1 Mike Olson
1 ukiran03
#+end_src
* 5.2.0 on 2025-12-31
:PROPERTIES:
:CUSTOM_ID: h:2c723b97-df07-4a3e-915f-b00f6647f74b
:END:
This version fixes some bugs, adds a new feature for those who want to
derive a theme from Modus, and makes other small quality-of-life
refinements.
** The ~modus-themes-with-colors~ should work at all times
:PROPERTIES:
:CUSTOM_ID: h:fcf14029-fd5f-4404-8ff7-370fb742c00d
:END:
In the transition to version =5.0.0=, I inadvertently introduced
regressions to the behaviour of the ~modus-themes-with-colors~ macro.
This macro ~let~ binds the current theme's palette around arbitrary
Elisp expressions, which allows users to access the named colours
therein. In versions =5.0.0= and =5.1.0= the macro could not read
variables defined outside its scope. Users needed to write an ~eval~
around it, which I did not like. Now the macro should not require such
workarounds: it basically is a ~let~ that should work as expected
everywhere.
This was fixed over a series of Git commits related to issue 170:
<https://github.com/protesilaos/modus-themes/issues/170>. Thanks to
Alexandr Semenov and realazy for reporting the problems and testing my
revisions.
** The ~modus-themes-generate-palette~ function to quickly get a palette
:PROPERTIES:
:CUSTOM_ID: h:6786fe0c-3853-4586-89d6-4f60b3828b1c
:END:
Users or package developers who want to create a theme on top of Modus
can now get a kickstart by defining their palette with the help of the
new ~modus-themes-generate-palette~ function. This function is meant
to return a complete palette, given a list of basic colours. Users can
thus experiment with their new theme while knowing that what they got
contains all the definitions; definitions that they may then modify
further (e.g. to define different semantic mappings than the defaults
such as, for example, to have =(fg-heading-1 red-warmer)= instead of
what originally is =(fg-heading-1 fg-main)=).
I have written extensive documentation in the manual, which includes a
complete example of a Solarized theme that is built on top of Modus.
If you have any questions, you are welcome to contact me.
** Convenience commands to select only dark or light themes
:PROPERTIES:
:CUSTOM_ID: h:deaebb75-129a-4ca2-8fd3-d29ae723474a
:END:
The commands ~modus-themes-select-dark~ and ~modus-themes-select-light~
use minibuffer completion to load a theme. The completion candidates
are filtered to only dark or light themes, respectively.
This is effectively the same as calling the command ~modus-themes-select~
with a prefix argument (=C-u= by default).
Remember that we also have the commands ~modus-themes-load-random~,
~modus-themes-load-random-dark~, and ~modus-themes-load-random-light~.
Otherwise use the command ~modus-themes-rotate~.
** Improved prompt for theme selection
:PROPERTIES:
:CUSTOM_ID: h:fcfe5599-9d12-46cf-8896-e45625aa7304
:END:
The minibuffer prompt used by the various Modus commands to select a
theme now has a grouping function in place: it shows the current theme
at the top and then all other themes grouped by their dark or light
background. This makes it easier to find a relevant theme, especially
if lots of them are present, such as when ~modus-themes-include-derivatives-mode~
is enabled and relevant packages/themes are available (e.g. my
~ef-themes~ and ~standard-themes~).
** Semantic colours for =transient.el= (e.g. in Magit)
:PROPERTIES:
:CUSTOM_ID: h:9bee92ab-e082-4f66-b01c-892860c60a0c
:END:
The =transient.el= concept of "semantic colours" is now supported.
This is used by default in Magit to denote the different types of
keys, such as those that exit the transient, keep it active, move to
another transient, and the like. Users who prefer the old style where
all key bindings looked the same must customise the user option
~transient-semantic-coloring~.
Note that the deuteranopia- and tritanopia- optimised themes adapt
gracefully to such "semantics", owning to relevant internal
refinements I made. Those themes cannot rely on the full colour
spectrum to communicate such nuances.
** All ~hl-todo-mode~ faces use a bold weight if appropriate
:PROPERTIES:
:CUSTOM_ID: h:309dd08f-dc01-47f6-8e88-0558181e1bb8
:END:
When the user option ~modus-themes-bold-constructs~ is set to a
non-~nil~ value, then all keywords that ~hl-todo-mode~ highlights will
be rendered in a bold weight (technically, they inherit the ~bold~
face). This is how we were doing it before until I undid it by
mistake. Thanks to Dominik Schrempf for reporting the bug in issue
177: <https://github.com/protesilaos/modus-themes/issues/177>.
** Theme-sensitive colours for Gnus mail groups
:PROPERTIES:
:CUSTOM_ID: h:ea438d6c-2e3e-4427-86af-3d9590e260d3
:END:
The Gnus mail groups no longer have hardcoded colour values. They will
look different depending on the current Modus theme.
** Faces that set a =:box= attribute handle unspecified colours
:PROPERTIES:
:CUSTOM_ID: h:98c4f263-81ad-4bb2-85fc-af30b32584a2
:END:
I updated all faces that use a =:box= attribute to account for the
scenario of a user writing palette overrides that unset the relevant
colour. Thanks to JD Smith for reporting a bug along those lines in
issue 9 of my ~standard-themes~ repository (they are derived from the
~modus-themes~, hence the changes here):
<https://github.com/protesilaos/standard-themes/issues/9>.
** The ~calendar-today~ and ~org-date-selected~ faces are disambiguated
:PROPERTIES:
:CUSTOM_ID: h:c5c7ff66-0ed8-424c-8579-b84b776ad461
:END:
These two faces are no longer using the same styles. This is because
they can appear in the same buffer. Thanks to Rudolf Adamkovič for
discussing this with me in the context of the same change for my
~doric-themes~ (issue 20 in doric-themes.git):
<https://github.com/protesilaos/doric-themes/issues/20>.
** The Modus "current theme" respects multiple enabled themes
:PROPERTIES:
:CUSTOM_ID: h:4c2abd1b-407a-4273-96d8-aba3bb42e0dc
:END:
The Modus concept of "current theme" respects the user's choice for
multiple themes loaded at once. It will return the first Modus theme
even if it is not at the front of the list.
[ Emacs will load multiple themes by default, which leads to awkward
colour combinations, unless you know what you are doing---as such all
the Modus commands that load a theme will disable all others, subject
to the user option ~modus-themes-disable-other-themes~. ]
Thanks to Pierre Téchoueyres for reporting the scenario where multiple
other themes are loaded on top of a Modus theme. This was done in
issue 182: <https://github.com/protesilaos/modus-themes/issues/182>.
Also thanks to Pierre for covering another snippet that I had missed.
This was done in pull request 184:
<https://github.com/protesilaos/modus-themes/pull/184>.
Pierre has assigned copyright to the Free Software Foundation.
** Fixed symbol of inherited AUCTeX face
:PROPERTIES:
:CUSTOM_ID: h:4caebf48-2544-4367-ad35-61957f5f043b
:END:
There was a typo which caused an error. Thanks to Rudolf Adamkovič for
the patch and also for providing a relevant unit test. This was done
in pull request 188: <https://github.com/protesilaos/modus-themes/pull/188>.
Rudolf has assigned copyright to the Free Software Foundation.
** Miscellaneous
:PROPERTIES:
:CUSTOM_ID: h:738675ea-6f7b-47e5-907e-468b67ecd430
:END:
- Thanks to Basil L. Contovounesios for simplifying a couple of
expressions. This was done in pull request 190:
<https://github.com/protesilaos/modus-themes/pull/190>. Basil has
assigned copyright to the Free Software Foundation.
- The faces of the built-in ~completion-preview-mode~ are now
supported. Thanks to Kevin Fleming for asking me about this in issue
178: <https://github.com/protesilaos/modus-themes/issues/178>.
- Several faces that had a strike-through effect when they did not
really need it are revised to use a wavy underline instead. The idea
is to let the text be readable at all times, regardless of the
effective font family. With the strike-through effect, some fonts
completely obscure the underlying text.Thanks to Morgan Willcock for
discussing with me the use of the strike-through style in issue 169:
<https://github.com/protesilaos/modus-themes/issues/169>.
- All ~symbol-overlay~ faces are unique, fixing a mistake I had done
before.
- The ~org-dispatcher-highlight~, which is used to highlight the keys
of the Org export interface, now uses the appropriate foreground
colour and is always rendered in a bold weight.
- The ~org-habit~ faces no longer call the function
~readable-foreground-color~. This is because that function does not
work if the theme is loaded via the =early-init.el=. Thanks to
Gaston Cabotin for reporting the problem in issue 174:
<https://github.com/protesilaos/modus-themes/issues/174>.
- The ~gnus-button~, which Gnus uses in all sorts of places to mark
some text as clickable, is styled with a less intense underline and
will no longer follow the style of links, including possible palette
overrides. This way, Gnus article buffers will not have visual
noise. Thanks to Morgan Willcock for discussing this with me in
issue 140: <https://github.com/protesilaos/modus-themes/issues/140>.
* 5.1.0 on 2025-11-07
:PROPERTIES:
:CUSTOM_ID: h:86a4b45a-14e0-45f1-9625-969ad966b9ff
:END:
This version fixes a critical bug in the ~modus-themes-with-colors~
macro. In short, it was not working as before or was not working at
all. Now it should do the right thing.
Thanks to Alexandr Semenov for reporting a relevant bug in issue 170
and for helping me test the results: <https://github.com/protesilaos/modus-themes/issues/170>.
Thanks to Stéphane Marks for testing some configurations with the
latest stable Emacs version as well as with builds from emacs.git.
This was done via a private channel and I am sharing this information
with permission.
Also thanks to Stefan Monnier for monitoring my commits as I was
trying to refactor the ~modus-themes-with-colors~ macro. Some comments
were posted on the emacs-devel mailing list, as well as a patch that I
ended up applying and then reverting (check the commit log for the
technicalities): <https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00114.html>.
Apologies to everyone for the inconvenience! This was a tricky bug.
The good thing is that it compelled me to improve several parts of the
code.
This version also includes a clarification in the manual about
building a theme on top of Modus:
- Web page :: Visit <https://protesilaos.com/emacs/modus-themes#h:86eb375b-9be4-43ce-879a-0686a524a63b>.
- Info manual :: Evaluate ~(info "(modus-themes) Build on top of the Modus themes")~.
In short, it mentions that a theme exists in an appropriately named
file that is part of the ~custom-theme-load-path~. Thanks to Ashton
Wiersdorf for asking a related question in issue 171:
<https://github.com/protesilaos/modus-themes/issues/171>.
* 5.0.0 on 2025-11-01
:PROPERTIES:
:CUSTOM_ID: h:9232615a-02d7-4376-90a6-7e7570ac1c1e
@ -2972,7 +3454,7 @@ users, while also catering to their aesthetic preferences.
#+begin_src text
Modus themes version 3.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-10-28
By Protesilaos <info@protesilaos.com> on 2022-10-28
The version that will ship with Emacs 29
@ -3148,7 +3630,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-10-01
By Protesilaos <info@protesilaos.com> on 2022-10-01
Support for packages or faces
@ -3325,7 +3807,7 @@ Changes to the manual
#+begin_src text
Modus themes version 2.6.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-08-19
By Protesilaos <info@protesilaos.com> on 2022-08-19
Changes to supported faces or face groups
@ -3438,7 +3920,7 @@ Changes to the manual
#+begin_src text
Modus themes version 2.5.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-08-03
By Protesilaos <info@protesilaos.com> on 2022-08-03
This entry documents the changes made to the project since the
publication of version 2.4.0 on 2022-06-01. It spans more than 60
@ -3865,7 +4347,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.4.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-06-01
By Protesilaos <info@protesilaos.com> on 2022-06-01
This entry documents the changes made to the project since the
publication of version 2.3.0 on 2022-04-01. It spans more than 60
@ -4204,7 +4686,7 @@ Miscellaneous
#+begin_src text
Modus themes version 2.3.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-04-01
By Protesilaos <info@protesilaos.com> on 2022-04-01
This entry documents the changes made to the project since the
publication of version 2.2.0 on 2022-02-23. It spans more than 70
@ -4270,7 +4752,7 @@ Attempted bug fix for byte compiled files
Quoting from the git log:
commit f067d2ef39c22174b95584f2cba7942aaf03bcca
Author: Protesilaos Stavrou <info@protesilaos.com>
Author: Protesilaos <info@protesilaos.com>
Date: Thu Mar 3 06:52:31 2022 +0200
Reify themes with eval-and-compile
@ -4504,7 +4986,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 2.2.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-02-23
By Protesilaos <info@protesilaos.com> on 2022-02-23
The present entry records the changes made to the project since the
publication of version 2.1.0 on 2022-02-17. This spans about 10 commits
@ -4614,7 +5096,7 @@ Miscellaneous changes
#+begin_src text
Modus themes version 2.1.0
By Protesilaos Stavrou <info@protesilaos.com> on 2022-02-17
By Protesilaos <info@protesilaos.com> on 2022-02-17
The present entry records the changes made to the project since the
publication of version 2.0.0 on 2021-12-24. There have been more than
@ -5323,7 +5805,7 @@ intense work which further iterated on an already solid base.
#+begin_src text
Modus themes version 2.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-12-24
By Protesilaos <info@protesilaos.com> on 2021-12-24
This entry covers the changes made to the project since the publication
of version 1.7.0 on 2021-11-18. There have been more than 90 commits in
@ -5705,7 +6187,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-11-18
By Protesilaos <info@protesilaos.com> on 2021-11-18
The present entry records the changes made to the project since the
release of version 1.6.0 on 2021-09-29. There have been more than 60
@ -5938,7 +6420,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 1.6.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-09-29
By Protesilaos <info@protesilaos.com> on 2021-09-29
This entry records the changes made to the project since the release of
version 1.5.0 on 2021-07-15. There have been around 70 commits since
@ -6291,7 +6773,7 @@ themes, version 1.6.0, as part of the next stable release of Emacs.
#+begin_src text
Modus themes version 1.5.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-07-15
By Protesilaos <info@protesilaos.com> on 2021-07-15
This entry outlines the set of changes made to the project since the
release of version 1.4.0 on 2021-05-25. There have been over 130
@ -6732,7 +7214,7 @@ Thanks again to everyone involved!
#+begin_src text
Modus themes version 1.4.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-05-25
By Protesilaos <info@protesilaos.com> on 2021-05-25
This entry records the changes made to the project since the release of
version 1.3.0 on 2021-04-17. There have been around 100 commits in the
@ -7051,7 +7533,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.3.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-04-17
By Protesilaos <info@protesilaos.com> on 2021-04-17
This entry records the changes introduced to the project since the
publication of version 1.2.0 (2021-03-04). There have been around 100
@ -7420,7 +7902,7 @@ Thanks once again to everyone involved!
#+begin_src text
Modus themes version 1.2.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-03-04
By Protesilaos <info@protesilaos.com> on 2021-03-04
This entry records the changes introduced to the project since the
publication of version 1.1.0 (2021-01-24). There have been close to 100
@ -7773,7 +8255,7 @@ Miscellaneous
#+begin_src text
Modus themes version 1.1.0
By Protesilaos Stavrou <info@protesilaos.com> on 2021-01-24
By Protesilaos <info@protesilaos.com> on 2021-01-24
This entry records the changes introduced to the project since the
publication of version 1.0.0 (2020-12-05). There have been around 150
@ -8234,7 +8716,7 @@ terms of face coverage, and (iv) meticulously designed throughout.
#+begin_src text
Modus themes version 1.0.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-12-05
By Protesilaos <info@protesilaos.com> on 2020-12-05
This entry documents the changes since version 0.13.0 (2020-10-08).
They constitute a major release with backward-incompatible additions
@ -8641,7 +9123,7 @@ it may have introduced.
#+begin_src text
Modus Operandi and Modus Vivendi version 0.13.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-10-08
By Protesilaos <info@protesilaos.com> on 2020-10-08
This entry documents the changes since version 0.12.0 (2020-08-26).
There have been around 150 commits in the meantime, making this the
@ -9172,7 +9654,7 @@ Thanks again to everyone who helped improve the themes!
#+begin_src text
Modus Operandi and Modus Vivendi version 0.12.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-08-26
By Protesilaos <info@protesilaos.com> on 2020-08-26
This entry documents the set of changes since version 0.11.0
(2020-07-31). There have been around 70 commits in the meatime, though
@ -9476,7 +9958,7 @@ their thoughts. The people already mentioned herein:
#+begin_src text
Modus Operandi and Modus Vivendi version 0.11.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-07-31
By Protesilaos <info@protesilaos.com> on 2020-07-31
This entry records the changes since version 0.10.0 (2020-06-24). The
present release covers close to 100 commits, some of which introduce
@ -9740,7 +10222,7 @@ https://gitlab.com/protesilaos/modus-themes/-/issues
#+begin_src text
Modus Operandi and Modus Vivendi version 0.10.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-06-24
By Protesilaos <info@protesilaos.com> on 2020-06-24
This entry records the changes since version 0.9.0 (2020-06-03). The
present release is focused on stability and internal improvements.
@ -9862,7 +10344,7 @@ My thanks to Basil and André for their contributions!
#+begin_src text
Modus Operandi and Modus Vivendi version 0.9.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-06-03
By Protesilaos <info@protesilaos.com> on 2020-06-03
This entry records the changes since version 0.8.0 (2020-04-28). The
present release contains about 50 commits, covering a month of active
@ -10020,7 +10502,7 @@ Added support for
#+begin_src text
Modus Operandi and Modus Vivendi version 0.8.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-04-28
By Protesilaos <info@protesilaos.com> on 2020-04-28
This entry records the changes since version 0.7.0 (2020-03-30). The
present release contains a little more than a hundred commits, covering
@ -10194,7 +10676,7 @@ Miscellaneous changes and concluding remarks
#+begin_src text
Modus Operandi and Modus Vivendi version 0.7.0
By Protesilaos Stavrou <info@protesilaos.com> on 2020-03-30
By Protesilaos <info@protesilaos.com> on 2020-03-30
This entry documents the changes since version 0.6.0 (2020-03-01). The
present release is the largest to date containing 110 commits.

View file

@ -67,7 +67,8 @@ The manual has a section about building on top of Modus. My
("C-<f5>" . modus-themes-select)
("M-<f5>" . modus-themes-load-random))
:config
;; Your customizations here:
;; Your customizations here. All customizations must evaluated
;; BEFORE loading the theme.
(setq modus-themes-to-toggle '(modus-operandi modus-vivendi)
modus-themes-to-rotate modus-themes-items
modus-themes-mixed-fonts t
@ -88,3 +89,49 @@ The manual has a section about building on top of Modus. My
;; `modus-themes-load-random-light').
(modus-themes-load-theme 'modus-operandi))
```
## Links to other projects
In this section I collect links to other themes built on top of Modus,
have Modus as a dependency, or are porting Modus to some other
platform. You are welcome to append your project to the relevant list.
In linking to these projects, I am not endorsing anybody's views.
### Emacs themes based on Modus
This is not an exhaustive list. You are welcome to add your package
here. Newer projects are at the bottom and are added as I am made
aware of them.
- `ef-themes` by Protesilaos <https://github.com/protesilaos/ef-themes>
- `standard-themes` by Protesilaos <https://github.com/protesilaos/standard-themes>
- `modus-ewal-theme` by Oliwier Czerwiński <https://github.com/deadendpl/modus-ewal-theme>
- `modus-flexoki` by Derek Passen <https://github.com/dpassen/modus-flexoki>
- `faff-theme` (since version 4) by James Ferguson <https://github.com/WJCFerguson/emacs-faff-theme>
- `modus-catpuccin` by Magnus Therning <https://gitlab.com/magus/modus-catppuccin>
- `pixel-themes` by Lucas <https://github.com/lucasobx/pixel-themes>
- `modus-nordic` (`modus-nordic-night` and `modus-nordic-midnight`) by Ashton Wiersdorf <https://codeberg.org/ashton314/modus-nordic-night>
- `folio-theme` by kn66 (nobu43) <https://github.com/kn66/folio-theme.el>
- `modus-alabaster` by Derek Passen <https://github.com/dpassen/modus-alabaster>
- `modus-vague` by Ashish Panigrahi <https://github.com/paniash/modus-vague.git>
- `peppers-theme` by Joar von Arndt <https://codeberg.org/joar/peppers-theme>
### Other Emacs packages based on Modus
- `modus-themes-exporter` by Protesilaos <https://github.com/protesilaos/modus-themes-exporter>
### Projects inspired by the Modus themes
This is not an exhaustive list. You are welcome to add your project here.
- `hugo-modus` by Yejun Su is a theme for the Hugo static site
generator: <https://github.com/goofansu/hugo-modus>. It uses colours
from the Modus themes.
- `modus-themes.nvim` by Miika Nissi and others is a port for NeoVim:
<https://github.com/miikanissi/modus-themes.nvim>.
- `zed-modus-themes` by Vitaly Slobodin is a port for the Zed editor:
<https://github.com/vitallium/zed-modus-themes>.
- `word-smith` by Sadsnake1 is a distraction-free writing for Obsidian
that includes ports of the Modus themes: <https://github.com/Sadsnake1/word-smith>
- `omarchy-modus-themes` by Dhavan Vaidya: <https://github.com/codingquark/omarchy-modus-themes>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
;;; modus-operandi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a white background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,6 +87,9 @@ standard)."
'light
'modus-themes-operandi-deuteranopia-palette
'modus-operandi-deuteranopia-palette-user
'modus-operandi-deuteranopia-palette-overrides)
'modus-operandi-deuteranopia-palette-overrides
'modus-themes-faces-deuteranopia)
(provide 'modus-operandi-deuteranopia-theme)
;;; modus-operandi-deuteranopia-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-operandi-theme.el --- Elegant, highly legible theme with a white background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-operandi-palette-user
'modus-operandi-palette-overrides)
(provide 'modus-operandi-theme)
;;; modus-operandi-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-operandi-tinted-theme.el --- Elegant, highly legible theme with a light ochre background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-operandi-tinted-palette-user
'modus-operandi-tinted-palette-overrides)
(provide 'modus-operandi-tinted-theme)
;;; modus-operandi-tinted-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-operandi-tritanopia-theme.el --- Tritanopia-optimized theme with a white background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,6 +87,9 @@ standard)."
'light
'modus-themes-operandi-tritanopia-palette
'modus-operandi-tritanopia-palette-user
'modus-operandi-tritanopia-palette-overrides)
'modus-operandi-tritanopia-palette-overrides
'modus-themes-faces-tritanopia)
(provide 'modus-operandi-tritanopia-theme)
;;; modus-operandi-tritanopia-theme.el ends here

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-deuteranopia-theme.el --- Deuteranopia-optimized theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,6 +87,9 @@ standard)."
'dark
'modus-themes-vivendi-deuteranopia-palette
'modus-vivendi-deuteranopia-palette-user
'modus-vivendi-deuteranopia-palette-overrides)
'modus-vivendi-deuteranopia-palette-overrides
'modus-themes-faces-deuteranopia)
(provide 'modus-vivendi-deuteranopia-theme)
;;; modus-vivendi-deuteranopia-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-theme.el --- Elegant, highly legible theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-vivendi-palette-user
'modus-vivendi-palette-overrides)
(provide 'modus-vivendi-theme)
;;; modus-vivendi-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-tinted-theme.el --- Elegant, highly legible theme with a night sky background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,4 +87,6 @@ which corresponds to a minimum contrast in relative luminance of
'modus-vivendi-tinted-palette-user
'modus-vivendi-tinted-palette-overrides)
(provide 'modus-vivendi-tinted-theme)
;;; modus-vivendi-tinted-theme.el ends here

View file

@ -1,9 +1,9 @@
;;; modus-vivendi-tritanopia-theme.el --- Tritanopia-optimized theme with a black background -*- lexical-binding:t -*-
;; Copyright (C) 2019-2025 Free Software Foundation, Inc.
;; Copyright (C) 2019-2026 Free Software Foundation, Inc.
;; Author: Protesilaos Stavrou <info@protesilaos.com>
;; Maintainer: Protesilaos Stavrou <info@protesilaos.com>
;; Author: Protesilaos <info@protesilaos.com>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; Keywords: faces, theme, accessibility
@ -87,6 +87,9 @@ standard)."
'dark
'modus-themes-vivendi-tritanopia-palette
'modus-vivendi-tritanopia-palette-user
'modus-vivendi-tritanopia-palette-overrides)
'modus-vivendi-tritanopia-palette-overrides
'modus-themes-faces-tritanopia)
(provide 'modus-vivendi-tritanopia-theme)
;;; modus-vivendi-tritanopia-theme.el ends here

372
tests/modus-themes-test.el Normal file
View file

@ -0,0 +1,372 @@
;;; modus-themes-test.el --- Unit tests for the Modus themes -*- lexical-binding: t -*-
;; Copyright (C) 2025-2026 Free Software Foundation, Inc.
;; Author: Protesilaos <info@protesilaos.com>,
;; Rudolf Adamkovič <rudolf@adamkovic.org>
;; Maintainer: Protesilaos <info@protesilaos.com>
;; URL: https://github.com/protesilaos/modus-themes
;; This file is NOT part of GNU Emacs.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;; Tests for the Modus themes. Note that we are using Shorthands in
;; this file, so the "mtt-" prefix really is "modus-themes-test-".
;; Evaluate the following to learn more:
;;
;; (info "(elisp) Shorthands")
;;; Code:
(require 'ert)
(require 'modus-themes)
(defmacro mtt-define-test (symbol &rest body)
"Write test for SYMBOL with BODY forms.
If the `car' of BODY is a string, use it as the docstring of the test.
Else provide a generic snippet of text."
(declare (doc-string 2) (indent defun))
(let* ((first (car body))
(has-docstring (stringp first))
(docstring (if has-docstring
first
(format "Test that `%s' does the right thing." symbol)))
(body (if has-docstring (cdr body) body)))
`(ert-deftest ,(intern (format "mtt-%s" symbol)) ()
,docstring
,@body)))
(mtt-define-test modus-themes--color-hex-p
(should (modus-themes--color-hex-p "#123"))
(should (modus-themes--color-hex-p "#123456"))
(should (modus-themes--color-hex-p "#abc"))
(should (modus-themes--color-hex-p "#ABCDEF"))
(should-not (modus-themes--color-hex-p "abc"))
(should-not (modus-themes--color-hex-p "#abcd"))
(should-not (modus-themes--color-hex-p "#12345"))
(should-not (modus-themes--color-hex-p "#1234567"))
(should-not (modus-themes--color-hex-p "#zzz"))
(should-not (modus-themes--color-hex-p "#zzz"))
(should-not (modus-themes--color-hex-p "#12g456")))
(mtt-define-test modus-themes--hex-or-name-to-rgb
(should (equal (modus-themes--hex-or-name-to-rgb "#fff") (list 1.0 1.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#000") (list 0.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#f00") (list 1.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#0f0") (list 0.0 1.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#00f") (list 0.0 0.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#ffffff") (list 1.0 1.0 1.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#000000") (list 0.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#ff0000") (list 1.0 0.0 0.0)))
(should (equal (modus-themes--hex-or-name-to-rgb "#00ff00") (list 0.0 1.0 0.0)))
;; NOTE 2026-04-12: I do not need it to be precise here, hence the `format'.
(let ((rgb-rounded-fn
(lambda (hex)
(let ((rgb (modus-themes--hex-or-name-to-rgb hex)))
(mapcar (lambda (float) (string-to-number (format "%.2f" float))) rgb)))))
(should (equal (funcall rgb-rounded-fn "#800000") (list 0.5 0.0 0.0)))
(should (equal (funcall rgb-rounded-fn "#008000") (list 0.0 0.5 0.0)))
(should (equal (funcall rgb-rounded-fn "#000080") (list 0.0 0.0 0.5))))
(should-error (modus-themes--hex-or-name-to-rgb ""))
(should-error (modus-themes--hex-or-name-to-rgb "#"))
(should-error (modus-themes--hex-or-name-to-rgb "#1"))
(should-error (modus-themes--hex-or-name-to-rgb "#12"))
(should-error (modus-themes--hex-or-name-to-rgb "#1234"))
(should-error (modus-themes--hex-or-name-to-rgb "#12345"))
(should-error (modus-themes--hex-or-name-to-rgb "#gggggg"))
(should-error (modus-themes--hex-or-name-to-rgb (list 1.0 1.0 1.0))))
(mtt-define-test modus-themes-wcag-formula
"Test that `modus-themes-wcag-formula' does the right thing.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (= (modus-themes-wcag-formula "#ffffff") 1.0))
(should (= (modus-themes-wcag-formula "#000000") 0.0))
(should-error (modus-themes-wcag-formula "#00000")))
(mtt-define-test modus-themes-contrast
"Test that `modus-themes-contrast' works as intended.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (= (modus-themes-contrast "#ffffff" "#000000") 21.0))
(should (= (modus-themes-contrast "#000000" "#ffffff") 21.0))
;; NOTE 2026-04-12: I do not need it to be precise here, hence the `format'.
(let ((float-2-fn (lambda (hex1 hex2) (string-to-number (format "%.2f" (modus-themes-contrast hex1 hex2))))))
(should (= (funcall float-2-fn "#ff0000" "#ffffff") 4.0))
(should (= (funcall float-2-fn "#00ff00" "#ffffff") 1.37))
(should (= (funcall float-2-fn "#0000ff" "#ffffff") 8.59))
(should (= (funcall float-2-fn "#ffff00" "#ffffff") 1.07))
(should (= (funcall float-2-fn "#00ffff" "#ffffff") 1.25))
(should (= (funcall float-2-fn "#ff00ff" "#ffffff") 3.14)))
(should-error (modus-themes-contrast "#ffffff" "#00000"))
(should-error (modus-themes-contrast "#fffff" "#00000")))
(mtt-define-test modus-themes--color-eight-to-six-digits
(should (string= (modus-themes--color-eight-to-six-digits "#f00") "#f00"))
(should (string= (modus-themes--color-eight-to-six-digits "#ff1919") "#ff1919"))
(should (string= (modus-themes--color-eight-to-six-digits "#ffff19991999") "#ff1919")))
(mtt-define-test modus-themes-adjust-value
"Test that `modus-themes-adjust-value' does the right thing.
Also see `modus-themes-test--modus-themes--hex-to-rgb'."
(should (string= (modus-themes-adjust-value "#ff0000" 10) "#ff1919"))
(should (string= (modus-themes-adjust-value "#505050" 100) "#ffffff"))
(should (string= (modus-themes-adjust-value "#505050" -100) "#000000"))
(should (string= (modus-themes-adjust-value "#505050" 0) "#505050"))
(should-error (modus-themes-adjust-value "#ff00" 10)))
(mtt-define-test modus-themes-activate
(if (custom-theme-p 'modus-operandi-tritanopia)
(should-not (modus-themes-activate 'modus-operandi-tritanopia))
(should (custom-theme-p 'modus-operandi-tritanopia))))
(mtt-define-test modus-themes--belongs-to-family-p
(should (modus-themes--belongs-to-family-p 'modus-operandi 'modus-themes))
(should-not (modus-themes--belongs-to-family-p 'my-fancy-theme 'modus-themes))
(should-not (modus-themes--belongs-to-family-p 'modus-operandi 'my-fancy-themes)))
(mtt-define-test modus-themes-get-all-known-themes
(should (equal (modus-themes-get-all-known-themes) modus-themes-items))
(should-not (modus-themes-get-all-known-themes 'my-fancy-themes)))
(mtt-define-test modus-themes--background-p
(should (modus-themes--background-p 'modus-operandi 'light))
(should-not (modus-themes--background-p 'modus-operandi 'dark))
(should-not (modus-themes--background-p 'modus-operandi t))
(should-not (modus-themes--background-p 'modus-operandi :light)))
(mtt-define-test modus-themes-sort
(let ((first-has-prefix-fn (lambda (themes prefix)
(when-let* ((first (car themes))
(name (symbol-name first)))
(string-match-p prefix name)))))
(should (funcall first-has-prefix-fn (modus-themes-sort (reverse modus-themes-items) 'light) "modus-operandi"))
(should (funcall first-has-prefix-fn (modus-themes-sort modus-themes-items 'dark) "modus-vivendi"))))
(mtt-define-test inheritance
"Ensure all faces inherit from valid faces."
;; Third-party packages, loaded if possible to better test face inheritance.
(require 'font-latex nil t)
(let ((current-theme (modus-themes-get-current-theme)))
(unwind-protect
(progn
(modus-themes-load-theme 'modus-operandi)
(should-not (seq-filter
(lambda (face)
;; The face either has no parent ...
(if-let* ((parent (face-attribute face :inherit)))
(and (symbolp parent)
(not (eq parent 'unspecified))
;; ... or its parent is a valid face.
(not (facep parent)))))
(face-list))))
(modus-themes-load-theme current-theme))))
(mtt-define-test color-dark-p
(let ((modus-operandi-sample-foregrounds
'("#a60000"
"#972500"
"#a0132f"
"#7f0000"
"#006800"
"#316500"
"#00663f"
"#2a5045"
"#6f5500"
"#884900"
"#7a4f2f"
"#624416"
"#0031a9"
"#3548cf"
"#0000b0"
"#003497"
"#721045"
"#8f0075"
"#531ab6"
"#7c318f"
"#005e8b"
"#3f578f"
"#005f5f"
"#005077"))
(modus-vivendi-sample-foregrounds
'("#ff5f59"
"#ff6b55"
"#ff7f86"
"#ff9580"
"#44bc44"
"#70b900"
"#00c06f"
"#88ca9f"
"#d0bc00"
"#fec43f"
"#dfaf7a"
"#d2b580"
"#2fafff"
"#79a8ff"
"#00bcff"
"#82b0ec"
"#feacd0"
"#f78fe7"
"#b6a0ff"
"#caa6df"
"#00d3d0"
"#4ae2f0"
"#6ae4b9"
"#9ac8e0")))
(should (seq-every-p #'modus-themes-color-dark-p modus-operandi-sample-foregrounds))
(should-not (seq-every-p #'modus-themes-color-dark-p modus-vivendi-sample-foregrounds))))
(mtt-define-test get-readable-foreground
(let ((modus-operandi-sample-foregrounds
'("#a60000"
"#972500"
"#a0132f"
"#7f0000"
"#006800"
"#316500"
"#00663f"
"#2a5045"
"#6f5500"
"#884900"
"#7a4f2f"
"#624416"
"#0031a9"
"#3548cf"
"#0000b0"
"#003497"
"#721045"
"#8f0075"
"#531ab6"
"#7c318f"
"#005e8b"
"#3f578f"
"#005f5f"
"#005077"))
(modus-vivendi-sample-foregrounds
'("#ff5f59"
"#ff6b55"
"#ff7f86"
"#ff9580"
"#44bc44"
"#70b900"
"#00c06f"
"#88ca9f"
"#d0bc00"
"#fec43f"
"#dfaf7a"
"#d2b580"
"#2fafff"
"#79a8ff"
"#00bcff"
"#82b0ec"
"#feacd0"
"#f78fe7"
"#b6a0ff"
"#caa6df"
"#00d3d0"
"#4ae2f0"
"#6ae4b9"
"#9ac8e0")))
(should (seq-every-p
(lambda (value)
(string= value "#ffffff"))
(mapcar #'modus-themes-get-readable-foreground modus-operandi-sample-foregrounds)))
(should (seq-every-p
(lambda (value)
(string= value "#000000"))
(mapcar #'modus-themes-get-readable-foreground modus-vivendi-sample-foregrounds)))))
(mtt-define-test complete-palette-mappings
"Ensure all built-in palettes contain entries for all palette mappings.
This computes a complete list of mapping names from the built-in palettes
and then cross-checks the palettes against the list. This should help ensure
consistency and completeness where adding a new mapping in one palette will
fail this test until it is added in all palettes."
(let* ((operandi-names (seq-uniq (mapcar #'car modus-themes-operandi-palette)))
(operandi-tinted-names (seq-uniq (mapcar #'car modus-themes-operandi-tinted-palette)))
(operandi-deuteranopia-names (seq-uniq (mapcar #'car modus-themes-operandi-deuteranopia-palette)))
(operandi-tritanopia-names (seq-uniq (mapcar #'car modus-themes-operandi-tritanopia-palette)))
(vivendi-names (seq-uniq (mapcar #'car modus-themes-vivendi-palette)))
(vivendi-tinted-names (seq-uniq (mapcar #'car modus-themes-vivendi-tinted-palette)))
(vivendi-deuteranopia-names (seq-uniq (mapcar #'car modus-themes-vivendi-deuteranopia-palette)))
(vivendi-tritanopia-names (seq-uniq (mapcar #'car modus-themes-vivendi-tritanopia-palette)))
(all-names (seq-uniq (append operandi-names
operandi-tinted-names
operandi-deuteranopia-names
operandi-tritanopia-names
vivendi-names
vivendi-tinted-names
vivendi-deuteranopia-names
vivendi-tritanopia-names))))
(should (seq-empty-p (seq-difference all-names operandi-names)))
(should (seq-empty-p (seq-difference all-names operandi-tinted-names)))
(should (seq-empty-p (seq-difference all-names operandi-deuteranopia-names)))
(should (seq-empty-p (seq-difference all-names operandi-tritanopia-names)))
(should (seq-empty-p (seq-difference all-names vivendi-names)))
(should (seq-empty-p (seq-difference all-names vivendi-tinted-names)))
(should (seq-empty-p (seq-difference all-names vivendi-deuteranopia-names)))
(should (seq-empty-p (seq-difference all-names vivendi-tritanopia-names)))))
(mtt-define-test modus-themes-generate-palette
"Ensure `modus-themes-generate-palette' provides enough mapping coverage
such that the generated palette does not inherit explicit color values
from a parent core palette."
(let* ((generated-palette (modus-themes-generate-palette
'((fg-main "#ffffff")
(bg-main "#000000")
(red "#ff0000")
(green "#00ff00")
(yellow "#ffff00")
(blue "#0000ff")
(magenta "#ff00ff")
(cyan "#00ffff"))))
;; These are colors we expect to have an explicit hex value,
;; either because they were provided explicitly in the call to
;; `modus-themes-generate-palette' above, or because we expect
;; `modus-themes-generate-palette' to generate the color.
(explicit-colors '( fg-main bg-main
fg-alt fg-dim bg-inactive bg-active bg-dim border
;; cyan
cyan bg-cyan-nuanced bg-cyan-subtle bg-cyan-intense
cyan-intense cyan-faint cyan-cooler cyan-warmer
;; magenta
magenta bg-magenta-nuanced bg-magenta-subtle bg-magenta-intense
magenta-intense magenta-faint magenta-cooler magenta-warmer
;; blue
blue bg-blue-nuanced bg-blue-subtle bg-blue-intense
blue-intense blue-faint blue-cooler blue-warmer
;; yellow
yellow bg-yellow-nuanced bg-yellow-subtle bg-yellow-intense
yellow-intense yellow-faint yellow-cooler yellow-warmer
;; green
green bg-green-nuanced bg-green-subtle bg-green-intense
green-intense green-faint green-cooler green-warmer
;; red
red bg-red-nuanced bg-red-subtle bg-red-intense
red-intense red-faint red-cooler red-warmer)))
;; Ensure all other colors in the palette map to a color name and not an
;; explicit hex value. If this check fails, the offending color should
;; be mapped to an appropriate color name in `modus-themes-generate-palette'.
(should (seq-empty-p (seq-remove (lambda (elem)
(or (member (car elem) explicit-colors)
(symbolp (cadr elem))))
generated-palette)))))
(provide 'modus-themes-test)
;;; modus-themes-test.el ends here
;; Local Variables:
;; read-symbol-shorthands: (("mtt" . "modus-themes-test-"))
;; End: