Commit graph

2486 commits

Author SHA1 Message Date
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