Add user option modus-themes-disable-other-themes

In the past, we used to disable all other themes while loading a Modus
theme.  I revised this for version 4 because I learnt that some users
use "themes" as bundles of arbitrary configurations.  This was
supported by the fact that the Modus themes are built into Emacs so we
need to accommodate every workflow that Emacs supports.

With this addition, I am reverting to the old way of doing things:
loading a Modus theme should disable all others.  Users who need to
run multiple themes can set this option to a nil value.

Thanks to Tony Zorman for the feedback on the mailing list:
<https://lists.sr.ht/~protesilaos/modus-themes/%3C874jtew0gp.fsf%40hyperspace%3E#%3C87bkne84d2.fsf@hyperspace%3E>.
This commit is contained in:
Protesilaos Stavrou 2023-01-05 04:59:50 +02:00
parent 5a624267a5
commit 2b046eceb4
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
3 changed files with 259 additions and 152 deletions

View file

@ -106,6 +106,7 @@ Enable and load
Customization options
* Custom reload theme:: Toggle auto-reload of the theme when setting custom variables
* Disable other themes:: Determine whether loading a Modus themes disables all others
* Bold constructs:: Toggle bold constructs in code
* Italic constructs:: Toggle italic font constructs in code
* Mixed fonts:: Toggle mixing of font families
@ -438,7 +439,8 @@ File: modus-themes.info, Node: Enable and load, Next: Customization options,
NOTE that Emacs can load multiple themes, which typically produces
undesirable results and undoes the work of the designer. Use the
disable-theme command if you are trying other themes beside the Modus
collection.
collection (*note Option for disabling other themes while loading Modus:
Disable other themes.).
Users of the built-in themes cannot require the package as usual
because there is no package to speak of. Instead, things are simpler as
@ -716,6 +718,7 @@ active, it must be reloaded for changes to take effect.
* Menu:
* Custom reload theme:: Toggle auto-reload of the theme when setting custom variables
* Disable other themes:: Determine whether loading a Modus themes disables all others
* Bold constructs:: Toggle bold constructs in code
* Italic constructs:: Toggle italic font constructs in code
* Mixed fonts:: Toggle mixing of font families
@ -727,7 +730,7 @@ active, it must be reloaded for changes to take effect.
* Palette overrides:: Refashion color values and/or semantic color mappings

File: modus-themes.info, Node: Custom reload theme, Next: Bold constructs, Up: Customization options
File: modus-themes.info, Node: Custom reload theme, Next: Disable other themes, Up: Customization options
4.1 Option for reloading the theme on custom change
===================================================
@ -754,9 +757,41 @@ consequences: the user must manually reload the theme (*note Enable and
load::).

File: modus-themes.info, Node: Bold constructs, Next: Italic constructs, Prev: Custom reload theme, Up: Customization options
File: modus-themes.info, Node: Disable other themes, Next: Bold constructs, Prev: Custom reload theme, Up: Customization options
4.2 Option for more bold constructs
4.2 Option for disabling other themes while loading Modus
=========================================================
[ Part of 4.1.0-dev. ]
Brief: Disable all other themes when loading a Modus theme.
Symbol: modus-themes-disable-other-themes (boolean type)
Possible values:
1. nil
2. t (default)
When the value is non-nil, the commands modus-themes-toggle and
modus-themes-select, as well as the modus-themes-load-theme
function, will disable all other themes while loading the specified
Modus theme. This is done to ensure that Emacs does not blend two or
more themes: such blends lead to awkward results that undermine the work
of the designer.
When the value is nil, the aforementioned commands and function will
only disable other themes within the Modus collection.
This option is provided because Emacs themes are not necessarily
limited to colors/faces: they can consist of an arbitrary set of
customizations. Users who use such customization bundles must set this
variable to a nil value.

File: modus-themes.info, Node: Bold constructs, Next: Italic constructs, Prev: Disable other themes, Up: Customization options
4.3 Option for more bold constructs
===================================
Brief: Use bold for code syntax highlighting and related.
@ -784,7 +819,7 @@ prompts.

File: modus-themes.info, Node: Italic constructs, Next: Mixed fonts, Prev: Bold constructs, Up: Customization options
4.3 Option for more italic constructs
4.4 Option for more italic constructs
=====================================
Brief: Use italics for code syntax highlighting and related.
@ -810,7 +845,7 @@ This typically affects documentation strings and code comments.

File: modus-themes.info, Node: Mixed fonts, Next: Command prompts, Prev: Italic constructs, Up: Customization options
4.4 Option for font mixing
4.5 Option for font mixing
==========================
Brief: Toggle the use of monospaced fonts for spacing-sensitive
@ -838,7 +873,7 @@ of the fixed-pitch face.

File: modus-themes.info, Node: Command prompts, Next: Completion UIs, Prev: Mixed fonts, Up: Customization options
4.5 Option for command prompt styles
4.6 Option for command prompt styles
====================================
Brief: Control the style of command prompts (e.g. minibuffer, shell,
@ -894,7 +929,7 @@ in these examples:

File: modus-themes.info, Node: Completion UIs, Next: Org mode blocks, Prev: Command prompts, Up: Customization options
4.6 Option for completion framework aesthetics
4.7 Option for completion framework aesthetics
==============================================
Brief: Set the overall style of completion framework interfaces.
@ -959,7 +994,7 @@ across all keys that are not explicitly referenced. For example, this:

File: modus-themes.info, Node: Org mode blocks, Next: Heading styles, Prev: Completion UIs, Up: Customization options
4.7 Option for org-mode block styles
4.8 Option for org-mode block styles
====================================
Brief: Set the overall style of Org code blocks, quotes, and the like.
@ -1003,7 +1038,7 @@ non-nil. While quote/verse blocks require setting

File: modus-themes.info, Node: Heading styles, Next: UI typeface, Prev: Org mode blocks, Up: Customization options
4.8 Option for the headings overall style
4.9 Option for the headings overall style
==========================================
Brief: Heading styles with optional list of values per heading level.
@ -1114,8 +1149,8 @@ done in older versions of the themes).

File: modus-themes.info, Node: UI typeface, Next: Palette overrides, Prev: Heading styles, Up: Customization options
4.9 Option for variable-pitch font in UI elements
=================================================
4.10 Option for variable-pitch font in UI elements
==================================================
Brief: Toggle the use of proportionately spaced (variable-pitch) fonts
in the User Interface.
@ -1143,7 +1178,7 @@ items.

File: modus-themes.info, Node: Palette overrides, Prev: UI typeface, Up: Customization options
4.10 Option for palette overrides
4.11 Option for palette overrides
=================================
This section describes palette overrides in detail. For a simpler
@ -1262,7 +1297,7 @@ watch:

File: modus-themes.info, Node: Palette override presets, Next: Stylistic variants using palette overrides, Up: Palette overrides
4.10.1 Palette override presets
4.11.1 Palette override presets
-------------------------------
This section shows how to refashion the themes by opting in to the
@ -1316,7 +1351,7 @@ the general idea (extra space for didactic purposes):

File: modus-themes.info, Node: Stylistic variants using palette overrides, Prev: Palette override presets, Up: Palette overrides
4.10.2 Stylistic variants using palette overrides
4.11.2 Stylistic variants using palette overrides
-------------------------------------------------
This section contains practical examples of overriding the palette of
@ -1353,7 +1388,7 @@ Palette override presets::).

File: modus-themes.info, Node: Make the mode line borderless, Next: Make the active mode line colorful, Up: Stylistic variants using palette overrides
4.10.2.1 Make the mode line borderless
4.11.2.1 Make the mode line borderless
......................................
This is one of our practical examples to override the semantic colors of
@ -1389,7 +1424,7 @@ set their color to that of the underlying background.

File: modus-themes.info, Node: Make the active mode line colorful, Next: Make the fringe invisible or another color, Prev: Make the mode line borderless, Up: Stylistic variants using palette overrides
4.10.2.2 Make the active mode line colorful
4.11.2.2 Make the active mode line colorful
...........................................
This is one of our practical examples to override the semantic colors of
@ -1431,7 +1466,7 @@ blue mode line for modus-operandi and a red one for modus-vivendi.

File: modus-themes.info, Node: Make the fringe invisible or another color, Next: Make links use subtle or no underlines, Prev: Make the active mode line colorful, Up: Stylistic variants using palette overrides
4.10.2.3 Make the fringe invisible or another color
4.11.2.3 Make the fringe invisible or another color
...................................................
This is one of our practical examples to override the semantic colors of
@ -1464,7 +1499,7 @@ or continuation lines.

File: modus-themes.info, Node: Make links use subtle or no underlines, Next: Make prompts more or less colorful, Prev: Make the fringe invisible or another color, Up: Stylistic variants using palette overrides
4.10.2.4 Make links use subtle or no underlines
4.11.2.4 Make links use subtle or no underlines
...............................................
This is one of our practical examples to override the semantic colors of
@ -1487,7 +1522,7 @@ that underline mappings can read correctly.

File: modus-themes.info, Node: Make prompts more or less colorful, Next: Make completion matches more or less colorful, Prev: Make links use subtle or no underlines, Up: Stylistic variants using palette overrides
4.10.2.5 Make prompts more or less colorful
4.11.2.5 Make prompts more or less colorful
...........................................
This section contains practical examples of overriding the palette of
@ -1524,7 +1559,7 @@ prompts.

File: modus-themes.info, Node: Make completion matches more or less colorful, Next: Make comments yellow and strings green, Prev: Make prompts more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.6 Make completion matches more or less colorful
4.11.2.6 Make completion matches more or less colorful
......................................................
This section contains practical examples of overriding the palette of
@ -1607,7 +1642,7 @@ colors to two:

File: modus-themes.info, Node: Make comments yellow and strings green, Next: Make code syntax use the old alt-syntax style, Prev: Make completion matches more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.7 Make comments yellow and strings green
4.11.2.7 Make comments yellow and strings green
...............................................
This is one of our practical examples to override the semantic colors of
@ -1649,7 +1684,7 @@ reproduce the effect, but also how to tweak it to ones liking.

File: modus-themes.info, Node: Make code syntax use the old alt-syntax style, Next: Make use of alternative styles for code syntax, Prev: Make comments yellow and strings green, Up: Stylistic variants using palette overrides
4.10.2.8 Make code syntax use the old alt-syntax style
4.11.2.8 Make code syntax use the old alt-syntax style
......................................................
This is one of our practical examples to override the semantic colors of
@ -1729,7 +1764,7 @@ interesting to experiment with faintly red colored comments:

File: modus-themes.info, Node: Make use of alternative styles for code syntax, Next: Make matching parenthesis more or less intense, Prev: Make code syntax use the old alt-syntax style, Up: Stylistic variants using palette overrides
4.10.2.9 Make use of alternative styles for code syntax
4.11.2.9 Make use of alternative styles for code syntax
.......................................................
This is one of our practical examples to override the semantic colors of
@ -1819,7 +1854,7 @@ palette.

File: modus-themes.info, Node: Make matching parenthesis more or less intense, Next: Make box buttons more or less gray, Prev: Make use of alternative styles for code syntax, Up: Stylistic variants using palette overrides
4.10.2.10 Make matching parenthesis more or less intense
4.11.2.10 Make matching parenthesis more or less intense
........................................................
This is one of our practical examples to override the semantic colors of
@ -1848,7 +1883,7 @@ to enable underlines for those highlights.

File: modus-themes.info, Node: Make box buttons more or less gray, Next: Make TODO and DONE more or less intense, Prev: Make matching parenthesis more or less intense, Up: Stylistic variants using palette overrides
4.10.2.11 Make box buttons more or less gray
4.11.2.11 Make box buttons more or less gray
............................................
This is one of our practical examples to override the semantic colors of
@ -1874,7 +1909,7 @@ gray from the active buttons and amplifies it for the inactive ones.

File: modus-themes.info, Node: Make TODO and DONE more or less intense, Next: Make headings more or less colorful, Prev: Make box buttons more or less gray, Up: Stylistic variants using palette overrides
4.10.2.12 Make TODO and DONE more or less intense
4.11.2.12 Make TODO and DONE more or less intense
.................................................
This is one of our practical examples to override the semantic colors of
@ -1913,7 +1948,7 @@ subdue them.

File: modus-themes.info, Node: Make headings more or less colorful, Next: Make Org agenda more or less colorful, Prev: Make TODO and DONE more or less intense, Up: Stylistic variants using palette overrides
4.10.2.13 Make headings more or less colorful
4.11.2.13 Make headings more or less colorful
.............................................
This is one of our practical examples to override the semantic colors of
@ -1970,7 +2005,7 @@ less intense.

File: modus-themes.info, Node: Make Org agenda more or less colorful, Next: Make inline code in prose use alternative styles, Prev: Make headings more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.14 Make Org agenda more or less colorful
4.11.2.14 Make Org agenda more or less colorful
...............................................
This is one of our practical examples to override the semantic colors of
@ -2029,7 +2064,7 @@ what we show in the other chapters with practical stylistic variants.

File: modus-themes.info, Node: Make inline code in prose use alternative styles, Next: Make mail citations and headers more or less colorful, Prev: Make Org agenda more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.15 Make inline code in prose use alternative styles
4.11.2.15 Make inline code in prose use alternative styles
..........................................................
This is one of our practical examples to override the semantic colors of
@ -2087,7 +2122,7 @@ not show every possible permutation.

File: modus-themes.info, Node: Make mail citations and headers more or less colorful, Next: Make the region preserve text colors plus other styles, Prev: Make inline code in prose use alternative styles, Up: Stylistic variants using palette overrides
4.10.2.16 Make mail citations and headers more or less colorful
4.11.2.16 Make mail citations and headers more or less colorful
...............................................................
This is one of our practical examples to override the semantic colors of
@ -2153,7 +2188,7 @@ a message:

File: modus-themes.info, Node: Make the region preserve text colors plus other styles, Next: Make mouse highlights more or less colorful, Prev: Make mail citations and headers more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.17 Make the region preserve text colors, plus other styles
4.11.2.17 Make the region preserve text colors, plus other styles
.................................................................
This is one of our practical examples to override the semantic colors of
@ -2190,7 +2225,7 @@ an appropriate foreground value.

File: modus-themes.info, Node: Make mouse highlights more or less colorful, Next: Make language underlines less colorful, Prev: Make the region preserve text colors plus other styles, Up: Stylistic variants using palette overrides
4.10.2.18 Make mouse highlights more or less colorful
4.11.2.18 Make mouse highlights more or less colorful
.....................................................
This is one of our practical examples to override the semantic colors of
@ -2218,7 +2253,7 @@ mapping that covers mouse hover effects and related highlights:

File: modus-themes.info, Node: Make language underlines less colorful, Next: Make line numbers use alternative styles, Prev: Make mouse highlights more or less colorful, Up: Stylistic variants using palette overrides
4.10.2.19 Make language underlines less colorful
4.11.2.19 Make language underlines less colorful
................................................
This is one of our practical examples to override the semantic colors of
@ -2250,7 +2285,7 @@ code linters and prose spell checkers.

File: modus-themes.info, Node: Make line numbers use alternative styles, Prev: Make language underlines less colorful, Up: Stylistic variants using palette overrides
4.10.2.20 Make line numbers use alternative styles
4.11.2.20 Make line numbers use alternative styles
..................................................
This is one of our practical examples to override the semantic colors of
@ -5517,6 +5552,7 @@ B.2 Variable index
* modus-themes-common-palette-overrides: Palette overrides. (line 22)
* modus-themes-completions: Completion UIs. (line 6)
* modus-themes-custom-auto-reload: Custom reload theme. (line 6)
* modus-themes-disable-other-themes: Disable other themes. (line 6)
* modus-themes-headings: Heading styles. (line 6)
* modus-themes-italic-constructs: Italic constructs. (line 6)
* modus-themes-mixed-fonts: Mixed fonts. (line 6)
@ -5603,117 +5639,118 @@ B.3 Concept index

Tag Table:
Node: Top874
Node: Overview7715
Node: How do the themes look like10113
Node: Learn about the latest changes10472
Node: Installation10860
Node: Install manually from source11790
Node: Install from the archives12615
Node: Install on GNU/Linux13214
Node: Debian 11 Bullseye13707
Node: GNU Guix14117
Node: Dealing with byte compilation errors14400
Node: Enable and load15558
Node: The require-theme for built-in Emacs themes18325
Node: Sample configuration with and without use-package19445
Node: Differences between loading and enabling22279
Node: Customization options24317
Node: Custom reload theme27924
Node: Bold constructs28827
Node: Italic constructs29663
Node: Mixed fonts30434
Node: Command prompts31430
Node: Completion UIs33235
Node: Org mode blocks35982
Node: Heading styles37862
Node: UI typeface42216
Node: Palette overrides43145
Node: Palette override presets47452
Node: Stylistic variants using palette overrides49949
Node: Make the mode line borderless51608
Node: Make the active mode line colorful53216
Node: Make the fringe invisible or another color55171
Node: Make links use subtle or no underlines56667
Node: Make prompts more or less colorful57670
Node: Make completion matches more or less colorful59340
Node: Make comments yellow and strings green63147
Node: Make code syntax use the old alt-syntax style65056
Node: Make use of alternative styles for code syntax68343
Node: Make matching parenthesis more or less intense72011
Node: Make box buttons more or less gray73453
Node: Make TODO and DONE more or less intense74765
Node: Make headings more or less colorful76474
Node: Make Org agenda more or less colorful78880
Node: Make inline code in prose use alternative styles81618
Node: Make mail citations and headers more or less colorful84165
Node: Make the region preserve text colors plus other styles86866
Node: Make mouse highlights more or less colorful88634
Node: Make language underlines less colorful89947
Node: Make line numbers use alternative styles91399
Node: Advanced customization93301
Node: More accurate colors in terminal emulators94751
Node: Range of color with terminal emulators95992
Node: Preview theme colors98706
Node: Per-theme customization settings100400
Node: Use theme colors in code with modus-themes-with-colors101765
Node: Add padding to mode line104035
Node: Remap face with local value106610
Node: Font configurations for Org and others109031
Ref: Font configurations for Org and others-Footnote-1111938
Node: Configure bold and italic faces112125
Node: Custom Org todo keyword and priority faces116280
Node: Custom Org emphasis faces119845
Node: Update Org block delimiter fontification124668
Node: Measure color contrast126585
Node: Load theme depending on time of day129283
Node: Backdrop for pdf-tools130291
Node: Toggle themes without reloading them133190
Node: A theme-agnostic hook for theme loading134466
Node: Custom hl-todo colors136888
Node: Add support for solaire-mode138413
Node: Face coverage141324
Node: Supported packages141776
Node: Indirectly covered packages147108
Node: Notes on individual packages148461
Node: Note on calendarel weekday and weekend colors149561
Node: Note on git-gutter in Doom Emacs150709
Node: Note on php-mode multiline comments153053
Node: Note on underlines in compilation buffers153806
Node: Note on inline Latex in Org buffers154643
Node: Note on dimmerel155253
Node: Note on display-fill-column-indicator-mode156738
Node: Note on highlight-parenthesesel158137
Node: Note on mmm-modeel background colors164115
Node: Note for prism166415
Node: Note on company-mode overlay pop-up169583
Ref: Note on company-mode overlay pop-up-Footnote-1170313
Ref: Note on company-mode overlay pop-up-Footnote-2170380
Node: Note on ERC escaped color sequences170435
Ref: Note on ERC escaped color sequences-Footnote-1171863
Node: Note on powerline or spaceline171973
Node: Note on SHR colors172387
Node: Note on SHR fonts172811
Node: Note on Ement colors and fonts173450
Node: Note on pdf-tools link hints174960
Node: Note on the Notmuch logo177420
Node: Note on goto-address-mode faces177958
Node: Frequently Asked Questions179070
Node: Is the contrast ratio about adjacent colors?179701
Node: What does it mean to avoid exaggerations?181208
Node: Why are colors mostly variants of blue magenta cyan?183058
Node: What is the best setup for legibility?187364
Node: Are these color schemes?190009
Node: Port the Modus themes to other platforms?193691
Node: Contributing196463
Node: Sources of the themes196860
Node: Issues you can help with197754
Node: Patches require copyright assignment to the FSF199145
Node: Acknowledgements201365
Node: GNU Free Documentation License205199
Node: Indices230563
Node: Function index230742
Node: Variable index231774
Node: Concept index233600
Node: Overview7809
Node: How do the themes look like10207
Node: Learn about the latest changes10566
Node: Installation10954
Node: Install manually from source11884
Node: Install from the archives12709
Node: Install on GNU/Linux13308
Node: Debian 11 Bullseye13801
Node: GNU Guix14211
Node: Dealing with byte compilation errors14494
Node: Enable and load15652
Node: The require-theme for built-in Emacs themes18504
Node: Sample configuration with and without use-package19624
Node: Differences between loading and enabling22458
Node: Customization options24496
Node: Custom reload theme28197
Node: Disable other themes29105
Node: Bold constructs30313
Node: Italic constructs31150
Node: Mixed fonts31921
Node: Command prompts32917
Node: Completion UIs34722
Node: Org mode blocks37469
Node: Heading styles39349
Node: UI typeface43703
Node: Palette overrides44634
Node: Palette override presets48941
Node: Stylistic variants using palette overrides51438
Node: Make the mode line borderless53097
Node: Make the active mode line colorful54705
Node: Make the fringe invisible or another color56660
Node: Make links use subtle or no underlines58156
Node: Make prompts more or less colorful59159
Node: Make completion matches more or less colorful60829
Node: Make comments yellow and strings green64636
Node: Make code syntax use the old alt-syntax style66545
Node: Make use of alternative styles for code syntax69832
Node: Make matching parenthesis more or less intense73500
Node: Make box buttons more or less gray74942
Node: Make TODO and DONE more or less intense76254
Node: Make headings more or less colorful77963
Node: Make Org agenda more or less colorful80369
Node: Make inline code in prose use alternative styles83107
Node: Make mail citations and headers more or less colorful85654
Node: Make the region preserve text colors plus other styles88355
Node: Make mouse highlights more or less colorful90123
Node: Make language underlines less colorful91436
Node: Make line numbers use alternative styles92888
Node: Advanced customization94790
Node: More accurate colors in terminal emulators96240
Node: Range of color with terminal emulators97481
Node: Preview theme colors100195
Node: Per-theme customization settings101889
Node: Use theme colors in code with modus-themes-with-colors103254
Node: Add padding to mode line105524
Node: Remap face with local value108099
Node: Font configurations for Org and others110520
Ref: Font configurations for Org and others-Footnote-1113427
Node: Configure bold and italic faces113614
Node: Custom Org todo keyword and priority faces117769
Node: Custom Org emphasis faces121334
Node: Update Org block delimiter fontification126157
Node: Measure color contrast128074
Node: Load theme depending on time of day130772
Node: Backdrop for pdf-tools131780
Node: Toggle themes without reloading them134679
Node: A theme-agnostic hook for theme loading135955
Node: Custom hl-todo colors138377
Node: Add support for solaire-mode139902
Node: Face coverage142813
Node: Supported packages143265
Node: Indirectly covered packages148597
Node: Notes on individual packages149950
Node: Note on calendarel weekday and weekend colors151050
Node: Note on git-gutter in Doom Emacs152198
Node: Note on php-mode multiline comments154542
Node: Note on underlines in compilation buffers155295
Node: Note on inline Latex in Org buffers156132
Node: Note on dimmerel156742
Node: Note on display-fill-column-indicator-mode158227
Node: Note on highlight-parenthesesel159626
Node: Note on mmm-modeel background colors165604
Node: Note for prism167904
Node: Note on company-mode overlay pop-up171072
Ref: Note on company-mode overlay pop-up-Footnote-1171802
Ref: Note on company-mode overlay pop-up-Footnote-2171869
Node: Note on ERC escaped color sequences171924
Ref: Note on ERC escaped color sequences-Footnote-1173352
Node: Note on powerline or spaceline173462
Node: Note on SHR colors173876
Node: Note on SHR fonts174300
Node: Note on Ement colors and fonts174939
Node: Note on pdf-tools link hints176449
Node: Note on the Notmuch logo178909
Node: Note on goto-address-mode faces179447
Node: Frequently Asked Questions180559
Node: Is the contrast ratio about adjacent colors?181190
Node: What does it mean to avoid exaggerations?182697
Node: Why are colors mostly variants of blue magenta cyan?184547
Node: What is the best setup for legibility?188853
Node: Are these color schemes?191498
Node: Port the Modus themes to other platforms?195180
Node: Contributing197952
Node: Sources of the themes198349
Node: Issues you can help with199243
Node: Patches require copyright assignment to the FSF200634
Node: Acknowledgements202854
Node: GNU Free Documentation License206688
Node: Indices232052
Node: Function index232231
Node: Variable index233263
Node: Concept index235162

End Tag Table

View file

@ -265,7 +265,7 @@ wrong.
NOTE that Emacs can load multiple themes, which typically produces
undesirable results and undoes the work of the designer. Use the
~disable-theme~ command if you are trying other themes beside the
Modus collection.
Modus collection ([[#h:adb0c49a-f1f9-4690-868b-013a080eed68][Option for disabling other themes while loading Modus]]).
Users of the built-in themes cannot ~require~ the package as usual
because there is no package to speak of. Instead, things are simpler
@ -575,6 +575,40 @@ UI or related functions such as ~customize-set-variable~ and ~setopt~
With a nil value, changes to user options have no further consequences:
the user must manually reload the theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]).
** Option for disabling other themes while loading Modus
:properties:
:alt_title: Disable other themes
:description: Determine whether loading a Modus themes disables all others
:custom_id: h:adb0c49a-f1f9-4690-868b-013a080eed68
:end:
#+vindex: modus-themes-disable-other-themes
[ Part of {{{development-version}}}. ]
Brief: Disable all other themes when loading a Modus theme.
Symbol: ~modus-themes-disable-other-themes~ (=boolean= type)
Possible values:
1. ~nil~
2. ~t~ (default)
When the value is non-nil, the commands ~modus-themes-toggle~ and
~modus-themes-select~, as well as the ~modus-themes-load-theme~
function, will disable all other themes while loading the specified
Modus theme. This is done to ensure that Emacs does not blend two or
more themes: such blends lead to awkward results that undermine the
work of the designer.
When the value is nil, the aforementioned commands and function will
only disable other themes within the Modus collection.
This option is provided because Emacs themes are not necessarily
limited to colors/faces: they can consist of an arbitrary set of
customizations. Users who use such customization bundles must set
this variable to a nil value.
** Option for more bold constructs
:properties:
:alt_title: Bold constructs

View file

@ -329,6 +329,29 @@ Will set SYM to VAL, and reload the current theme, unless
(theme (modus-themes--current-theme)))
(modus-themes-load-theme theme))))
(defcustom modus-themes-disable-other-themes t
"Disable all other themes when loading a Modus theme.
When the value is non-nil, the commands `modus-themes-toggle' and
`modus-themes-select', as well as the `modus-themes-load-theme'
function, will disable all other themes while loading the
specified Modus theme. This is done to ensure that Emacs does
not blend two or more themes: such blends lead to awkward results
that undermine the work of the designer.
When the value is nil, the aforementioned commands and function
will only disable other themes within the Modus collection.
This option is provided because Emacs themes are not necessarily
limited to colors/faces: they can consist of an arbitrary set of
customizations. Users who use such customization bundles must
set this variable to a nil value."
:group 'modus-themes
:package-version '(modus-themes . "4.1.0")
:version "30.1"
:type 'boolean
:link '(info-link "(modus-themes) Disable other themes"))
(defconst modus-themes-items
'( modus-operandi modus-vivendi
modus-operandi-tinted modus-vivendi-tinted
@ -1052,10 +1075,21 @@ overrides."
(modus-themes--palette-value theme))
(user-error "No enabled Modus theme could be found")))
(defun modus-themes--disable-themes ()
"Disable themes per `modus-themes-disable-other-themes'."
(if modus-themes-disable-other-themes
(mapc #'disable-theme custom-enabled-themes)
(mapc #'disable-theme (modus-themes--list-known-themes))))
(defun modus-themes-load-theme (theme)
"Load THEME while disabling other Modus themes.
Run `modus-themes-after-load-theme-hook'."
(mapc #'disable-theme (modus-themes--list-known-themes))
"Load THEME while disabling other themes.
Which themes are disabled is determined by the user option
`modus-themes-disable-other-themes'.
Run the `modus-themes-after-load-theme-hook' as the final step
after loading the THEME."
(modus-themes--disable-themes)
(load-theme theme :no-confirm)
(run-hooks 'modus-themes-after-load-theme-hook))
@ -1080,7 +1114,8 @@ Run `modus-themes-after-load-theme-hook'."
;;;###autoload
(defun modus-themes-select (theme)
"Load a Modus THEME using minibuffer completion.
Run `modus-themes-after-load-theme-hook' after loading the theme."
Run `modus-themes-after-load-theme-hook' after loading the theme.
Disable other themes per `modus-themes-disable-other-themes'."
(interactive (list (modus-themes--select-prompt)))
(modus-themes-load-theme theme))
@ -1100,7 +1135,8 @@ If `modus-themes-to-toggle' does not specify two Modus themes,
prompt with completion for a theme among our collection (this is
practically the same as the `modus-themes-select' command).
Run `modus-themes-after-load-theme-hook' after loading the theme."
Run `modus-themes-after-load-theme-hook' after loading the theme.
Disable other themes per `modus-themes-disable-other-themes'."
(interactive)
(if-let* ((themes (modus-themes--toggle-theme-p))
(one (car themes))