Commit graph

2686 commits

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