modus-themes.info (274705B)
1 This is docv6TKvo.info, produced by makeinfo version 6.8 from 2 modus-themes.texi. 3 4 Copyright (C) 2020-2023 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation License, 8 Version 1.3 or any later version published by the Free Software 9 Foundation; with no Invariant Sections, with the Front-Cover Texts 10 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 11 below. A copy of the license is included in the section entitled 12 “GNU Free Documentation License.” 13 14 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 15 modify this GNU manual.” 16 17 INFO-DIR-SECTION Emacs misc features 18 START-INFO-DIR-ENTRY 19 * Modus Themes: (modus-themes). Elegant, highly legible and customizable themes. 20 END-INFO-DIR-ENTRY 21 22 23 File: docv6TKvo.info, Node: Top, Next: Overview, Up: (dir) 24 25 Modus themes for GNU Emacs 26 ************************** 27 28 Copyright (C) 2020-2023 Free Software Foundation, Inc. 29 30 Permission is granted to copy, distribute and/or modify this 31 document under the terms of the GNU Free Documentation License, 32 Version 1.3 or any later version published by the Free Software 33 Foundation; with no Invariant Sections, with the Front-Cover Texts 34 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 35 below. A copy of the license is included in the section entitled 36 “GNU Free Documentation License.” 37 38 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 39 modify this GNU manual.” 40 41 This manual, written by Protesilaos Stavrou, describes the 42 customization options for the Modus themes, and provides every other 43 piece of information pertinent to them. 44 45 The documentation furnished herein corresponds to stable version 46 4.4.0, released on 2024-03-17. Any reference to a newer feature which 47 does not yet form part of the latest tagged commit, is explicitly marked 48 as such. 49 50 Current development target is 4.5.0-dev. 51 52 • Package name (GNU ELPA): ‘modus-themes’ 53 • Official manual: <https://protesilaos.com/emacs/modus-themes> 54 • Change log: <https://protesilaos.com/emacs/modus-themes-changelog> 55 • Color palette: <https://protesilaos.com/emacs/modus-themes-colors> 56 • Sample pictures: 57 <https://protesilaos.com/emacs/modus-themes-pictures> 58 • Git repositories: 59 • GitHub: <https://github.com/protesilaos/modus-themes> 60 • GitLab: <https://gitlab.com/protesilaos/modus-themes> 61 • Backronym: My Old Display Unexpectedly Sharpened ... themes. 62 63 * Menu: 64 65 * Overview:: 66 * Installation:: 67 * Enable and load:: 68 * Customization options:: 69 * Preview theme colors:: 70 * Use colors from the Modus themes palette:: 71 * Advanced customization:: 72 * Face coverage:: 73 * Notes on individual packages:: 74 * Frequently Asked Questions:: 75 * Contributing:: 76 * Acknowledgements:: 77 * GNU Free Documentation License:: 78 * Indices:: 79 80 — The Detailed Node Listing — 81 82 Overview 83 84 * How do the themes look like:: 85 * Learn about the latest changes:: 86 87 Installation 88 89 * Install manually from source:: 90 * Install from the archives:: 91 * Install on GNU/Linux:: 92 * Dealing with byte compilation errors:: 93 94 Install on GNU/Linux 95 96 * Debian 11 Bullseye:: 97 * GNU Guix:: 98 99 Enable and load 100 101 * The require-theme for built-in Emacs themes:: 102 * Sample configuration with and without use-package:: 103 * Differences between loading and enabling:: 104 105 Customization options 106 107 * Custom reload theme:: Toggle auto-reload of the theme when setting custom variables 108 * Disable other themes:: Determine whether loading a Modus themes disables all others 109 * Bold constructs:: Toggle bold constructs in code 110 * Italic constructs:: Toggle italic font constructs in code 111 * Option for which themes to toggle:: 112 * Mixed fonts:: Toggle mixing of font families 113 * Command prompts:: Control the style of command prompts 114 * Completion UIs:: Choose among several styles for completion UIs 115 * Org mode blocks:: Choose among plain, gray, or tinted backgrounds 116 * Heading styles:: Choose among several styles, also per heading level 117 * UI typeface:: Toggle the use of variable-pitch across the User Interface 118 * Palette overrides:: Refashion color values and/or semantic color mappings 119 120 Use colors from the Modus themes palette 121 122 * Get a single color from the palette with modus-themes-get-color-value:: 123 * Use theme colors in code with modus-themes-with-colors:: 124 125 Advanced customization 126 127 * DIY Palette override presets:: 128 * DIY Stylistic variants using palette overrides:: 129 * DIY More accurate colors in terminal emulators:: 130 * DIY Range of color with terminal emulators:: 131 * DIY Per-theme customization settings:: 132 * DIY Do not extend the region background:: 133 * DIY Add padding to the mode line:: 134 * DIY Remap face with local value:: 135 * DIY Font configurations for Org and others:: 136 * DIY Configure bold and italic faces:: 137 * DIY Custom Org todo keyword and priority faces:: 138 * DIY Custom Org emphasis faces:: 139 * DIY Use colored Org source blocks per language:: 140 * DIY Measure color contrast:: 141 * DIY Load theme depending on time of day:: 142 * DIY Backdrop for pdf-tools:: 143 * DIY Toggle themes without reloading them:: 144 * DIY Use more spacious margins or padding in Emacs frames:: 145 * DIY Custom hl-todo colors:: 146 * DIY Add support for solaire-mode:: 147 * DIY Use a hook at the post-load-theme phase:: 148 149 DIY Stylistic variants using palette overrides 150 151 * DIY Make the mode line borderless:: 152 * DIY Make the active mode line colorful:: 153 * DIY Make the tab bar more or less colorful:: 154 * DIY Make the fringe invisible or another color:: 155 * DIY Make links use subtle or no underlines:: 156 * DIY Make prompts more or less colorful:: 157 * DIY Make completion matches more or less colorful:: 158 * DIY Make comments yellow and strings green:: 159 * DIY Make code syntax use the old alt-syntax style:: 160 * DIY Make use of alternative styles for code syntax:: 161 * DIY Make matching parenthesis more or less intense:: 162 * DIY Make box buttons more or less gray:: 163 * DIY Make TODO and DONE more or less intense:: 164 * DIY Make headings more or less colorful:: 165 * DIY Make Org block colors more or less colorful:: 166 * DIY Make Org agenda more or less colorful:: 167 * DIY Make inline code in prose use alternative styles:: 168 * DIY Make mail citations and headers more or less colorful:: 169 * DIY Make the region preserve text colors, plus other styles: DIY Make the region preserve text colors plus other styles. 170 * DIY Make mouse highlights more or less colorful:: 171 * DIY Make language underlines less colorful:: 172 * DIY Make line numbers use alternative styles:: 173 * DIY Make diffs use only a foreground:: 174 * DIY Make deuteranopia diffs red and blue instead of yellow and blue:: 175 176 DIY Use a hook at the post-load-theme phase 177 178 * DIY A theme-agnostic hook for theme loading:: 179 180 Face coverage 181 182 * Supported packages:: Full list of covered face groups 183 * Indirectly covered packages:: 184 185 Notes on individual packages 186 187 * Note on calendar.el weekday and weekend colors: Note on calendarel weekday and weekend colors. 188 * Note on git-gutter in Doom Emacs:: 189 * Note on php-mode multiline comments:: 190 * Note on underlines in compilation buffers:: 191 * Note on inline Latex in Org buffers:: 192 * Note on dimmer.el: Note on dimmerel. 193 * Note on display-fill-column-indicator-mode:: 194 * Note on highlight-parentheses.el: Note on highlight-parenthesesel. 195 * Note on mmm-mode.el background colors: Note on mmm-modeel background colors. 196 * Note for prism:: 197 * Note on company-mode overlay pop-up:: 198 * Note on ERC escaped color sequences:: 199 * Note on powerline or spaceline:: 200 * Note on SHR colors:: 201 * Note on SHR fonts:: 202 * Note on Ement colors and fonts:: 203 * Note on pdf-tools link hints:: 204 * Note on the Notmuch logo:: 205 * Note on goto-address-mode faces:: 206 207 Frequently Asked Questions 208 209 * Is the contrast ratio about adjacent colors?:: 210 * What does it mean to avoid exaggerations?:: 211 * Why are colors mostly variants of blue, magenta, cyan?: Why are colors mostly variants of blue magenta cyan?. 212 * What is the best setup for legibility?:: 213 * Are these color schemes?:: 214 * Port the Modus themes to other platforms?:: 215 216 Contributing 217 218 * Sources of the themes:: 219 * Issues you can help with:: 220 * Patches require copyright assignment to the FSF:: 221 222 Indices 223 224 * Function index:: 225 * Variable index:: 226 * Concept index:: 227 228 229 230 File: docv6TKvo.info, Node: Overview, Next: Installation, Prev: Top, Up: Top 231 232 1 Overview 233 ********** 234 235 The Modus themes are designed for accessible readability. They conform 236 with the highest standard for color contrast between combinations of 237 background and foreground values. For small sized text, this 238 corresponds to the WCAG AAA standard, which specifies a minimum rate of 239 distance in relative luminance of 7:1. 240 241 The Modus themes consist of eight themes, divided into four 242 subgroups. 243 244 Main themes 245 ‘modus-operandi’ is the project’s main light theme, while 246 ‘modus-vivendi’ is its dark counterpart. These two themes are part 247 of the project since its inception. They are designed to cover a 248 broad range of needs and are, in the opinion of the author, the 249 reference for what a highly legible “default” theme should look 250 like. 251 252 Tinted themes 253 ‘modus-operandi-tinted’ and ‘modus-vivendi-tinted’ are variants of 254 the two main themes. They slightly tone down the intensity of the 255 background and provide a bit more color variety. 256 ‘modus-operandi-tinted’ has a set of base tones that are shades of 257 light ochre (earthly colors), while ‘modus-vivendi-tinted’ gives a 258 night sky impression. 259 260 Deuteranopia themes 261 ‘modus-operandi-deuteranopia’ and its companion 262 ‘modus-vivendi-deuteranopia’ are optimized for users with red-green 263 color deficiency. This means that they do not use red and green 264 hues for color-coding purposes, such as for diff removed and added 265 lines. Instead, they implement colors that are discernible by 266 users with deueteranopia or deuteranomaly (mostly yellow and blue 267 hues). 268 269 Tritanopia themes 270 ‘modus-operandi-tritanopia’ and its counterpart 271 ‘modus-vivendi-tritanopia’ are optimized for users with blue-yellow 272 color deficiency. The idea is the same as with the deuteranopia 273 variants: color coding relies only on hues that are accessible to 274 people with tritanopia or tritanomaly, namely, shades of red and 275 cyan. 276 277 To ensure that users have a consistently accessible experience, the 278 themes strive to achieve as close to full face coverage as possible, 279 while still targeting a curated list of well-maintained packages (*note 280 Face coverage::). 281 282 The overarching objective of this project is to always offer 283 accessible color combinations. There shall never be a compromise on 284 this principle. If there arises an inescapable trade-off between 285 usability and stylistic considerations, we will always opt for the 286 former. 287 288 Starting with version 0.12.0 and onwards, the themes are built into 289 GNU Emacs. 290 291 * Menu: 292 293 * How do the themes look like:: 294 * Learn about the latest changes:: 295 296 297 File: docv6TKvo.info, Node: How do the themes look like, Next: Learn about the latest changes, Up: Overview 298 299 1.1 How do the themes look like 300 =============================== 301 302 Check the web page with the screen shots 303 (https://protesilaos.com/emacs/modus-themes-pictures/). Note that the 304 themes are highly customizable (*note Customization options::). 305 306 307 File: docv6TKvo.info, Node: Learn about the latest changes, Prev: How do the themes look like, Up: Overview 308 309 1.2 Learn about the latest changes 310 ================================== 311 312 Please refer to the web page with the change log 313 (https://protesilaos.com/emacs/modus-themes-changelog). It is 314 comprehensive and covers everything that goes into every tagged release 315 of the themes. 316 317 318 File: docv6TKvo.info, Node: Installation, Next: Enable and load, Prev: Overview, Up: Top 319 320 2 Installation 321 ************** 322 323 The Modus themes are distributed with Emacs starting with version 28.1. 324 On older versions of Emacs, they can be installed using Emacs’ package 325 manager or manually from their code repository. There also exist 326 packages for distributions of GNU/Linux. 327 328 Emacs 28 ships with ‘modus-themes’ version ‘1.6.0’. Emacs 29 329 includes version ‘3.0.0’. Emacs 30 provides a newer, refactored version 330 that thoroughly refashions how the themes are implemented and 331 customized. Such major versions are not backward-compatible due to the 332 limited resources at the maintainer’s disposal to support multiple 333 versions of Emacs and of the themes across the years. 334 335 * Menu: 336 337 * Install manually from source:: 338 * Install from the archives:: 339 * Install on GNU/Linux:: 340 * Dealing with byte compilation errors:: 341 342 343 File: docv6TKvo.info, Node: Install manually from source, Next: Install from the archives, Up: Installation 344 345 2.1 Install manually from source 346 ================================ 347 348 In the following example, we are assuming that your Emacs files are 349 stored in ‘~/.emacs.d’ and that you want to place the Modus themes in 350 ‘~/.emacs.d/modus-themes’. 351 352 1. Get the source and store it in the desired path by running the 353 following in the command line shell: 354 355 $ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes 356 357 1. Add that path to your known Elisp libraries’ list, by placing this 358 snippet of Emacs Lisp in your init file (e.g. ‘init.el’): 359 360 (add-to-list 'load-path "~/.emacs.d/modus-themes") 361 362 The themes are now ready to be used: *note Enable and load::. 363 364 365 File: docv6TKvo.info, Node: Install from the archives, Next: Install on GNU/Linux, Prev: Install manually from source, Up: Installation 366 367 2.2 Install from the archives 368 ============================= 369 370 The ‘modus-themes’ package is available from the GNU ELPA archive, which 371 is configured by default. 372 373 Prior to querying any package archive, make sure to update the index, 374 with ‘M-x package-refresh-contents’. Then all you need to do is type 375 ‘M-x package-install’ and specify the ‘modus-themes’. 376 377 Once installed, the themes are ready to be used: *note Enable and 378 load::. 379 380 381 File: docv6TKvo.info, Node: Install on GNU/Linux, Next: Dealing with byte compilation errors, Prev: Install from the archives, Up: Installation 382 383 2.3 Install on GNU/Linux 384 ======================== 385 386 The themes are also available from the archives of some distributions of 387 GNU/Linux. These should correspond to a tagged release rather than 388 building directly from the latest Git commit. It all depends on the 389 distro’s packaging policies. 390 391 * Menu: 392 393 * Debian 11 Bullseye:: 394 * GNU Guix:: 395 396 397 File: docv6TKvo.info, Node: Debian 11 Bullseye, Next: GNU Guix, Up: Install on GNU/Linux 398 399 2.3.1 Debian 11 Bullseye 400 ------------------------ 401 402 The themes are part of Debian 11 Bullseye. Get them with: 403 404 sudo apt install elpa-modus-themes 405 406 They are now ready to be used: *note Enable and load::. 407 408 NOTE that Debian’s package is severely out-of-date as of this writing 409 2022-07-24 09:57 +0300. 410 411 412 File: docv6TKvo.info, Node: GNU Guix, Prev: Debian 11 Bullseye, Up: Install on GNU/Linux 413 414 2.3.2 GNU Guix 415 -------------- 416 417 Users of Guix can get the themes with this command: 418 419 guix package -i emacs-modus-themes 420 421 They are now ready to be used: *note Enable and load::. 422 423 424 File: docv6TKvo.info, Node: Dealing with byte compilation errors, Prev: Install on GNU/Linux, Up: Installation 425 426 2.4 Dealing with byte compilation errors 427 ======================================== 428 429 From time to time, we receive bug reports pertaining to errors with byte 430 compilation. These seldom have to do with faulty code in the themes: it 431 might be a shortcoming of ‘package.el’, some regression in the current 432 development target of Emacs, a misconfiguration in an otherwise exotic 433 setup, and the like. 434 435 The common solution with a stable version of Emacs is to: 436 437 1. Delete the ‘modus-themes’ package. 438 2. Close the current Emacs session. 439 3. Install the ‘modus-themes’ again. 440 441 For those building Emacs directly from source, the solution may 442 involve reverting to an earlier commit in emacs.git. 443 444 At any rate, if you encounter such an issue please report it: we will 445 either fix the bug on our end if it is truly ours, or help forward it to 446 the relevant upstream maintainer. Whatever you do, please understand 447 that a build failure does not mean we are necessarily doing something 448 wrong. 449 450 *note Issues you can help with::. 451 452 453 File: docv6TKvo.info, Node: Enable and load, Next: Customization options, Prev: Installation, Up: Top 454 455 3 Enable and load 456 ***************** 457 458 NOTE that Emacs can load multiple themes, which typically produces 459 undesirable results and undoes the work of the designer. Use the 460 ‘disable-theme’ command if you are trying other themes beside the Modus 461 collection (*note Option for disabling other themes while loading Modus: 462 Disable other themes.). 463 464 Users of the built-in themes cannot ‘require’ the package as usual 465 because there is no package to speak of. Instead, things are simpler as 466 built-in themes are considered safe. All one needs is to load the theme 467 of their preference by adding either form to their init file: 468 469 (load-theme 'modus-operandi) ; Light theme 470 (load-theme 'modus-vivendi) ; Dark theme 471 472 Remember that there are multiple Modus themes (*note Overview::). 473 Adapt the above snippet accordingly. 474 475 Users of packaged variants of the themes must add a few more lines to 476 ensure that everything works as intended. First, one has to require the 477 main library before loading one of the themes: 478 479 (require 'modus-themes) 480 481 One can activate a theme with something like the following 482 expression, replacing ‘modus-operandi’ with their preferred Modus theme: 483 484 (load-theme 'modus-operandi :no-confirm) 485 486 Changes to the available customization options must always be 487 evaluated before loading a theme (*note Customization Options: 488 Customization options.). Reload a theme for new changes to take effect. 489 490 This is how a basic setup could look like (*note The require-theme 491 for built-in Emacs themes: The require-theme for built-in Emacs 492 themes.): 493 494 ;;; For the built-in themes which cannot use `require'. 495 (require-theme 'modus-themes) 496 497 ;; Add all your customizations prior to loading the themes. 498 (setq modus-themes-italic-constructs t 499 modus-themes-bold-constructs nil) 500 501 ;; Load the theme of your choice. 502 (load-theme 'modus-operandi) 503 504 ;; Optionally define a key to switch between Modus themes. Also check 505 ;; the user option `modus-themes-to-toggle'. 506 (define-key global-map (kbd "<f5>") #'modus-themes-toggle) 507 508 509 510 ;;; For packaged versions which must use `require'. 511 512 (require 'modus-themes) 513 514 ;; Add all your customizations prior to loading the themes 515 (setq modus-themes-italic-constructs t 516 modus-themes-bold-constructs nil) 517 518 ;; Load the theme of your choice. 519 (load-theme 'modus-operandi :no-confirm) 520 521 (define-key global-map (kbd "<f5>") #'modus-themes-toggle) 522 523 *note Sample configuration with and without use-package::. 524 525 To disable other themes before loading a Modus theme, use something 526 like this: 527 528 (mapc #'disable-theme custom-enabled-themes) 529 (load-theme 'modus-operandi :no-confirm) 530 531 Instead of using the basic ‘load-theme’ function, users can rely on 532 the ‘modus-themes-load-theme’. It accepts a single argument, which is a 533 symbol representing the Modus theme of choice, such as: 534 535 (modus-themes-load-theme 'modus-operandi) 536 537 The ‘modus-themes-load-theme’ takes care to disable other themes, if 538 the user opts in (*note Option for disabling other themes while loading 539 Modus: Disable other themes.). After loading the theme of choice, this 540 function calls the hook ‘modus-themes-after-load-theme-hook’ (alias 541 ‘modus-themes-post-load-hook’). Users can add their own functions to 542 this hook to make further customizations (*note Advanced 543 customization::). 544 545 The commands ‘modus-themes-toggle’ and ‘modus-themes-select’ use 546 ‘modus-themes-load-theme’ internally (*note Option for which themes to 547 toggle::). The aforementioned hold true for them as well. 548 549 * Menu: 550 551 * The require-theme for built-in Emacs themes:: 552 * Sample configuration with and without use-package:: 553 * Differences between loading and enabling:: 554 555 556 File: docv6TKvo.info, Node: The require-theme for built-in Emacs themes, Next: Sample configuration with and without use-package, Up: Enable and load 557 558 3.1 The ‘require-theme’ for built-in Emacs themes 559 ================================================= 560 561 The version of the Modus themes that is included in Emacs CANNOT use the 562 standard ‘require’. This is because the built-in themes are not 563 included in the ‘load-path’ (not my decision). The ‘require-theme’ 564 function must be used in this case as a replacement. For example: 565 566 (require-theme 'modus-themes) 567 568 ;; All customizations here 569 (setq modus-themes-bold-constructs t 570 modus-themes-italic-constructs t) 571 572 ;; Maybe define some palette overrides, such as by using our presets 573 (setq modus-themes-common-palette-overrides 574 modus-themes-preset-overrides-intense) 575 576 ;; Load the theme of choice (built-in themes are always "safe" so they 577 ;; do not need the `no-require' argument of `load-theme'). 578 (load-theme 'modus-operandi) 579 580 (define-key global-map (kbd "<f5>") #'modus-themes-toggle) 581 582 583 File: docv6TKvo.info, Node: Sample configuration with and without use-package, Next: Differences between loading and enabling, Prev: The require-theme for built-in Emacs themes, Up: Enable and load 584 585 3.2 Sample configuration with and without use-package 586 ===================================================== 587 588 What follows is a variant of what we demonstrate in the previous section 589 (*note Enable and load::). 590 591 It is common for Emacs users to rely on ‘use-package’ for declaring 592 package configurations in their setup. We use this as an example: 593 594 ;;; For the built-in themes which cannot use `require'. 595 (use-package emacs 596 :config 597 (require-theme 'modus-themes) ; `require-theme' is ONLY for the built-in Modus themes 598 599 ;; Add all your customizations prior to loading the themes 600 (setq modus-themes-italic-constructs t 601 modus-themes-bold-constructs nil) 602 603 ;; Maybe define some palette overrides, such as by using our presets 604 (setq modus-themes-common-palette-overrides 605 modus-themes-preset-overrides-intense) 606 607 ;; Load the theme of your choice. 608 (load-theme 'modus-operandi) 609 610 (define-key global-map (kbd "<f5>") #'modus-themes-toggle)) 611 612 613 614 ;;; For packaged versions which must use `require'. 615 (use-package modus-themes 616 :ensure t 617 :config 618 ;; Add all your customizations prior to loading the themes 619 (setq modus-themes-italic-constructs t 620 modus-themes-bold-constructs nil) 621 622 ;; Maybe define some palette overrides, such as by using our presets 623 (setq modus-themes-common-palette-overrides 624 modus-themes-preset-overrides-intense) 625 626 ;; Load the theme of your choice. 627 (load-theme 'modus-operandi) 628 629 (define-key global-map (kbd "<f5>") #'modus-themes-toggle)) 630 631 The same without ‘use-package’: 632 633 (require 'modus-themes) ; OR for the built-in themes: (require-theme 'modus-themes) 634 635 ;; Add all your customizations prior to loading the themes 636 (setq modus-themes-italic-constructs t 637 modus-themes-bold-constructs nil) 638 639 ;; Maybe define some palette overrides, such as by using our presets 640 (setq modus-themes-common-palette-overrides 641 modus-themes-preset-overrides-intense) 642 643 ;; Load the theme of your choice: 644 (load-theme 'modus-operandi :no-confirm) 645 646 (define-key global-map (kbd "<f5>") #'modus-themes-toggle) 647 648 *note Differences between loading and enabling::. 649 650 Note: make sure not to customize the variable 651 ‘custom-theme-load-path’ or ‘custom-theme-directory’ after the themes’ 652 package declaration. That will lead to failures in loading the files. 653 If either or both of those variables need to be changed, their values 654 should be defined before the package declaration of the themes. 655 656 657 File: docv6TKvo.info, Node: Differences between loading and enabling, Prev: Sample configuration with and without use-package, Up: Enable and load 658 659 3.3 Differences between loading and enabling 660 ============================================ 661 662 The reason we recommend ‘load-theme’ instead of the other option of 663 ‘enable-theme’ is that the former does a kind of “reset” on the face 664 specs. It quite literally loads (or reloads) the theme. Whereas the 665 ‘enable-theme’ function simply puts an already loaded theme to the top 666 of the list of enabled items, re-using whatever state was last loaded. 667 668 As such, ‘load-theme’ reads all customizations that may happen during 669 any given Emacs session: even after the initial setup of a theme. 670 Examples are calls to ‘custom-set-faces’, as well as new values assigned 671 to the options the Modus themes provide (*note Customization Options: 672 Customization options.). 673 674 Our tests show that ‘enable-theme’ does not read such variables anew, 675 so it might appear to the unsuspecting user that the themes are somehow 676 broken whenever they try to assign a new value to a customization option 677 or some face. 678 679 This “reset” that ‘load-theme’ brings about does, however, come at 680 the cost of being somewhat slower than ‘enable-theme’. Users who have a 681 stable setup and who seldom update their variables during a given Emacs 682 session, are better off using something like this: 683 684 (require 'modus-themes) 685 686 ;; Activate your desired themes here 687 (load-theme 'modus-operandi t t) 688 (load-theme 'modus-vivendi t t) 689 690 ;; Enable the preferred one 691 (enable-theme 'modus-operandi) 692 693 *note Toggle themes without reloading them: DIY Toggle themes without 694 reloading them. 695 696 *note Sample configuration with and without use-package::. 697 698 With the above granted, other sections of the manual discuss how to 699 configure custom faces, where ‘load-theme’ is expected, though 700 ‘enable-theme’ could still apply in stable setups: 701 702 *note Use theme colors in code with modus-themes-with-colors: Use 703 theme colors in code with modus-themes-with-colors. 704 705 706 File: docv6TKvo.info, Node: Customization options, Next: Preview theme colors, Prev: Enable and load, Up: Top 707 708 4 Customization options 709 *********************** 710 711 The Modus themes are highly configurable, though they should work well 712 without any further tweaks. We provide a variety of user options. The 713 following code block provides an overview. In addition to those 714 variables, the themes support a comprehensive system of overrides: it 715 can be used to make thoroughgoing changes to the looks of the themes 716 (*note Option for palette overrides: Palette overrides.). We document 717 everything at length in the pages of this manual and also provide 718 ready-to-use code samples. 719 720 Remember that all customization options must be evaluated before 721 loading a theme (*note Enable and load::). If the theme is already 722 active, it must be reloaded for changes to take effect. 723 724 ;; In all of the following, WEIGHT is a symbol such as `semibold', 725 ;; `light', `bold', or anything mentioned in `modus-themes-weights'. 726 (setq modus-themes-italic-constructs t 727 modus-themes-bold-constructs nil 728 modus-themes-mixed-fonts t 729 modus-themes-variable-pitch-ui nil 730 modus-themes-custom-auto-reload t 731 modus-themes-disable-other-themes t 732 733 ;; Options for `modus-themes-prompts' are either nil (the 734 ;; default), or a list of properties that may include any of those 735 ;; symbols: `italic', `WEIGHT' 736 modus-themes-prompts '(italic bold) 737 738 ;; The `modus-themes-completions' is an alist that reads two 739 ;; keys: `matches', `selection'. Each accepts a nil value (or 740 ;; empty list) or a list of properties that can include any of 741 ;; the following (for WEIGHT read further below): 742 ;; 743 ;; `matches' :: `underline', `italic', `WEIGHT' 744 ;; `selection' :: `underline', `italic', `WEIGHT' 745 modus-themes-completions 746 '((matches . (extrabold)) 747 (selection . (semibold italic text-also))) 748 749 modus-themes-org-blocks 'gray-background ; {nil,'gray-background,'tinted-background} 750 751 ;; The `modus-themes-headings' is an alist: read the manual's 752 ;; node about it or its doc string. Basically, it supports 753 ;; per-level configurations for the optional use of 754 ;; `variable-pitch' typography, a height value as a multiple of 755 ;; the base font size (e.g. 1.5), and a `WEIGHT'. 756 modus-themes-headings 757 '((1 . (variable-pitch 1.5)) 758 (2 . (1.3)) 759 (agenda-date . (1.3)) 760 (agenda-structure . (variable-pitch light 1.8)) 761 (t . (1.1)))) 762 763 ;; Remember that more (MUCH MORE) can be done with overrides, which we 764 ;; document extensively in this manual. 765 766 * Menu: 767 768 * Custom reload theme:: Toggle auto-reload of the theme when setting custom variables 769 * Disable other themes:: Determine whether loading a Modus themes disables all others 770 * Bold constructs:: Toggle bold constructs in code 771 * Italic constructs:: Toggle italic font constructs in code 772 * Option for which themes to toggle:: 773 * Mixed fonts:: Toggle mixing of font families 774 * Command prompts:: Control the style of command prompts 775 * Completion UIs:: Choose among several styles for completion UIs 776 * Org mode blocks:: Choose among plain, gray, or tinted backgrounds 777 * Heading styles:: Choose among several styles, also per heading level 778 * UI typeface:: Toggle the use of variable-pitch across the User Interface 779 * Palette overrides:: Refashion color values and/or semantic color mappings 780 781 782 File: docv6TKvo.info, Node: Custom reload theme, Next: Disable other themes, Up: Customization options 783 784 4.1 Option for reloading the theme on custom change 785 =================================================== 786 787 Brief: Toggle reloading of the active theme when an option is changed 788 through the Custom UI. 789 790 Symbol: ‘modus-themes-custom-auto-reload’ (‘boolean’ type) 791 792 Possible values: 793 794 1. ‘nil’ 795 2. ‘t’ (default) 796 797 All theme user options take effect when a theme is loaded. Any 798 subsequent changes require the theme to be reloaded. 799 800 When this variable has a non-‘nil’ value, any change made via the 801 Custom UI or related functions such as ‘customize-set-variable’ and 802 ‘setopt’ (Emacs 29), will trigger a reload automatically. 803 804 With a ‘nil’ value, changes to user options have no further 805 consequences: the user must manually reload the theme (*note Enable and 806 load::). 807 808 809 File: docv6TKvo.info, Node: Disable other themes, Next: Bold constructs, Prev: Custom reload theme, Up: Customization options 810 811 4.2 Option for disabling other themes while loading Modus 812 ========================================================= 813 814 Brief: Disable all other themes when loading a Modus theme. 815 816 Symbol: ‘modus-themes-disable-other-themes’ (‘boolean’ type) 817 818 Possible values: 819 820 1. ‘nil’ 821 2. ‘t’ (default) 822 823 When the value is non-‘nil’, the commands ‘modus-themes-toggle’ and 824 ‘modus-themes-select’, as well as the ‘modus-themes-load-theme’ 825 function, will disable all other themes while loading the specified 826 Modus theme (*note Option for which themes to toggle::). This is done 827 to ensure that Emacs does not blend two or more themes: such blends lead 828 to awkward results that undermine the work of the designer. 829 830 When the value is ‘nil’, the aforementioned commands and function 831 will only disable other themes within the Modus collection. 832 833 This option is provided because Emacs themes are not necessarily 834 limited to colors/faces: they can consist of an arbitrary set of 835 customizations. Users who use such customization bundles must set this 836 variable to a ‘nil’ value. 837 838 839 File: docv6TKvo.info, Node: Bold constructs, Next: Italic constructs, Prev: Disable other themes, Up: Customization options 840 841 4.3 Option for more bold constructs 842 =================================== 843 844 Brief: Use bold for code syntax highlighting and related. 845 846 Symbol: ‘modus-themes-bold-constructs’ (‘boolean’ type) 847 848 Possible values: 849 850 1. ‘nil’ (default) 851 2. ‘t’ 852 853 The default is to use a bold typographic weight only when it is 854 required. 855 856 With a non-‘nil’ value (‘t’) display several syntactic constructs in 857 bold weight. This concerns keywords and other important aspects of code 858 syntax. It also affects certain mode line indicators and command 859 prompts. 860 861 Advanced users may also want to configure the exact attributes of the 862 ‘bold’ face. 863 864 *note Configure bold and italic faces: DIY Configure bold and italic 865 faces. 866 867 868 File: docv6TKvo.info, Node: Italic constructs, Next: Option for which themes to toggle, Prev: Bold constructs, Up: Customization options 869 870 4.4 Option for more italic constructs 871 ===================================== 872 873 Brief: Use italics for code syntax highlighting and related. 874 875 Symbol: ‘modus-themes-italic-constructs’ (‘boolean’ type) 876 877 Possible values: 878 879 1. ‘nil’ (default) 880 2. ‘t’ 881 882 The default is to not use slanted text forms (italics) unless it is 883 absolutely necessary. 884 885 With a non-‘nil’ value (‘t’) choose to render more faces in italics. 886 This typically affects documentation strings and code comments. 887 888 Advanced users may also want to configure the exact attributes of the 889 ‘italic’ face. 890 891 *note Configure bold and italic faces: DIY Configure bold and italic 892 faces. 893 894 895 File: docv6TKvo.info, Node: Option for which themes to toggle, Next: Mixed fonts, Prev: Italic constructs, Up: Customization options 896 897 4.5 Option for which themes to toggle 898 ===================================== 899 900 Brief: Choose to Modus themes to toggle between 901 902 Symbol: ‘modus-themes-to-toggle’ (‘list’ type) 903 904 Default value: ‘'(modus-operandi modus-vivendi)’ 905 906 Possible values: 907 908 • ‘modus-operandi’ 909 • ‘modus-vivendi’ 910 • ‘modus-operandi-tinted’ 911 • ‘modus-vivendi-tinted’ 912 • ‘modus-operandi-deuteranopia’ 913 • ‘modus-vivendi-deuteranopia’ 914 • ‘modus-operandi-tritanopia’ 915 • ‘modus-vivendi-tritanopia’ 916 917 Specify two themes to toggle between using the command 918 ‘modus-themes-toggle’. 919 920 921 File: docv6TKvo.info, Node: Mixed fonts, Next: Command prompts, Prev: Option for which themes to toggle, Up: Customization options 922 923 4.6 Option for font mixing 924 ========================== 925 926 Brief: Toggle the use of monospaced fonts for spacing-sensitive 927 constructs (affects font families). 928 929 Symbol: ‘modus-themes-mixed-fonts’ (‘boolean’ type) 930 931 Possible values: 932 933 1. ‘nil’ (default) 934 2. ‘t’ 935 936 When set to non-‘nil’ (‘t’), configure some spacing-sensitive faces 937 like Org tables and code blocks to always inherit from the ‘fixed-pitch’ 938 face. This is to ensure that certain constructs like code blocks and 939 tables remain monospaced even when users opt for a mode that remaps 940 typeface families, such as the built-in ‘M-x variable-pitch-mode’. 941 Otherwise the layout can appear broken, due to how spacing is done. 942 943 For a consistent experience, user may need to specify the font family 944 of the ‘fixed-pitch’ face. 945 946 *note Font configurations for Org and others: DIY Font configurations 947 for Org and others. 948 949 950 File: docv6TKvo.info, Node: Command prompts, Next: Completion UIs, Prev: Mixed fonts, Up: Customization options 951 952 4.7 Option for command prompt styles 953 ==================================== 954 955 Brief: Control the style of command prompts (e.g. minibuffer, shell, 956 IRC clients). 957 958 Symbol: ‘modus-themes-prompts’ (‘choice’ type, list of properties) 959 960 Possible values are expressed as a list of properties (default is 961 ‘nil’ or an empty list). The list can include any of the following 962 symbols: 963 964 • ‘italic’ 965 • ‘italic’ 966 • A font weight, which must be supported by the underlying typeface: 967 • ‘thin’ 968 • ‘ultralight’ 969 • ‘extralight’ 970 • ‘light’ 971 • ‘semilight’ 972 • ‘regular’ 973 • ‘medium’ 974 • ‘semibold’ 975 • ‘bold’ 976 • ‘heavy’ 977 • ‘extrabold’ 978 • ‘ultrabold’ 979 980 The default (a ‘nil’ value or an empty list) means to only use a 981 subtle colored foreground color. 982 983 The ‘italic’ property adds a slant to the font’s forms (italic or 984 oblique forms, depending on the typeface). 985 986 The symbol of a font weight attribute such as ‘light’, ‘semibold’, et 987 cetera, adds the given weight to links. Valid symbols are defined in 988 the variable ‘modus-themes-weights’. The absence of a weight means that 989 the one of the underlying text will be used. 990 991 Combinations of any of those properties are expressed as a list, like 992 in these examples: 993 994 (bold italic) 995 (italic semibold) 996 997 The order in which the properties are set is not significant. 998 999 In user configuration files the form may look like this: 1000 1001 (setq modus-themes-prompts '(extrabold italic)) 1002 1003 *note Make prompts more or less colorful: DIY Make prompts more or 1004 less colorful. 1005 1006 1007 File: docv6TKvo.info, Node: Completion UIs, Next: Org mode blocks, Prev: Command prompts, Up: Customization options 1008 1009 4.8 Option for completion framework aesthetics 1010 ============================================== 1011 1012 Brief: Set the overall style of completion framework interfaces. 1013 1014 Symbol: ‘modus-themes-completions’ (‘alist’ type properties) 1015 1016 This affects Company, Corfu, Flx, Icomplete/Fido, Ido, Ivy, 1017 Orderless, Vertico, and the standard ‘*Completions*’ buffer. The value 1018 is an alist of expressions, each of which takes the form of ‘(KEY . 1019 LIST-OF-PROPERTIES)’. ‘KEY’ is a symbol, while ‘PROPERTIES’ is a list. 1020 Here is a sample, followed by a description of the particularities: 1021 1022 (setq modus-themes-completions 1023 '((matches . (extrabold underline)) 1024 (selection . (semibold italic)))) 1025 1026 The ‘matches’ key refers to the highlighted characters that 1027 correspond to the user’s input. When its properties are ‘nil’ or an 1028 empty list, matching characters in the user interface will have a bold 1029 weight and a colored foreground. The list of properties may include any 1030 of the following symbols regardless of the order they may appear in: 1031 1032 • ‘underline’ to draw a line below the characters; 1033 1034 • ‘italic’ to use a slanted font (italic or oblique forms); 1035 1036 • The symbol of a font weight attribute such as ‘light’, ‘semibold’, 1037 et cetera. Valid symbols are defined in the variable 1038 ‘modus-themes-weights’. The absence of a weight means that bold 1039 will be used. 1040 1041 The ‘selection’ key applies to the current line or currently matched 1042 candidate, depending on the specifics of the user interface. When its 1043 properties are ‘nil’ or an empty list, it has a subtle gray background, 1044 a bold weight, and the base foreground value for the text. The list of 1045 properties it accepts is as follows (order is not significant): 1046 1047 • ‘underline’ to draw a line below the characters; 1048 1049 • ‘italic’ to use a slanted font (italic or oblique forms); 1050 1051 • The symbol of a font weight attribute such as ‘light’, ‘semibold’, 1052 et cetera. Valid symbols are defined in the variable 1053 ‘modus-themes-weights’. The absence of a weight means that bold 1054 will be used. 1055 1056 Apart from specifying each key separately, a catch-all list is 1057 accepted. This is only useful when the desired aesthetic is the same 1058 across all keys that are not explicitly referenced. For example, this: 1059 1060 (setq modus-themes-completions 1061 '((t . (extrabold underline)))) 1062 1063 Is the same as: 1064 1065 (setq modus-themes-completions 1066 '((matches . (extrabold underline)) 1067 (selection . (extrabold underline)))) 1068 1069 *note Make completion matches more or less colorful: DIY Make 1070 completion matches more or less colorful. 1071 1072 1073 File: docv6TKvo.info, Node: Org mode blocks, Next: Heading styles, Prev: Completion UIs, Up: Customization options 1074 1075 4.9 Option for org-mode block styles 1076 ==================================== 1077 1078 As part of version ‘4.4.0’, the ‘modus-themes-org-blocks’ is no more. 1079 Users can apply palette overrides to set a style that fits their 1080 preference (purple, blue, yellow, green, etc.). It is more flexible and 1081 more powerful (*note DIY Make Org block colors more or less colorful::) 1082 1083 For the option to change the background of Org source blocks, we 1084 provide the relevant setup (*note DIY Use colored Org source blocks per 1085 language::). 1086 1087 1088 File: docv6TKvo.info, Node: Heading styles, Next: UI typeface, Prev: Org mode blocks, Up: Customization options 1089 1090 4.10 Option for the headings’ overall style 1091 =========================================== 1092 1093 Brief: Heading styles with optional list of values per heading level. 1094 1095 Symbol: ‘modus-themes-headings’ (‘alist’ type, multiple properties) 1096 1097 This is an alist that accepts a ‘(KEY . LIST-OF-VALUES)’ combination. 1098 The ‘KEY’ is either a number, representing the heading’s level (0 1099 through 8) or ‘t’, which pertains to the fallback style. The named keys 1100 ‘agenda-date’ and ‘agenda-structure’ apply to the Org agenda. 1101 1102 Level 0 is a special heading: it is used for what counts as a 1103 document title or equivalent, such as the ‘#+title’ construct we find in 1104 Org files. Levels 1-8 are regular headings. 1105 1106 The ‘LIST-OF-VALUES’ covers symbols that refer to properties, as 1107 described below. Here is a complete sample with various stylistic 1108 combinations, followed by a presentation of all available properties: 1109 1110 (setq modus-themes-headings 1111 '((1 . (variable-pitch 1.5)) 1112 (2 . (1.3)) 1113 (agenda-date . (1.3)) 1114 (agenda-structure . (variable-pitch light 1.8)) 1115 (t . (1.1)))) 1116 1117 Properties: 1118 1119 • A font weight, which must be supported by the underlying typeface: 1120 • ‘thin’ 1121 • ‘ultralight’ 1122 • ‘extralight’ 1123 • ‘light’ 1124 • ‘semilight’ 1125 • ‘regular’ 1126 • ‘medium’ 1127 • ‘semibold’ 1128 • ‘bold’ (default) 1129 • ‘heavy’ 1130 • ‘extrabold’ 1131 • ‘ultrabold’ 1132 • A floating point as a height multiple of the default or a cons cell 1133 in the form of ‘(height . FLOAT)’. 1134 1135 By default (a ‘nil’ value for this variable), all headings have a 1136 bold typographic weight and use a desaturated text color. 1137 1138 A ‘variable-pitch’ property changes the font family of the heading to 1139 that of the ‘variable-pitch’ face (normally a proportionately spaced 1140 typeface). 1141 1142 The symbol of a weight attribute adjusts the font of the heading 1143 accordingly, such as ‘light’, ‘semibold’, etc. Valid symbols are 1144 defined in the variable ‘modus-themes-weights’. The absence of a weight 1145 means that bold will be used by virtue of inheriting the ‘bold’ face. 1146 1147 *note Configure bold and italic faces: DIY Configure bold and italic 1148 faces. 1149 1150 A number, expressed as a floating point (e.g. 1.5), adjusts the 1151 height of the heading to that many times the base font size. The 1152 default height is the same as 1.0, though it need not be explicitly 1153 stated. Instead of a floating point, an acceptable value can be in the 1154 form of a cons cell like ‘(height . FLOAT)’ or ‘(height FLOAT)’, where 1155 FLOAT is the given number. 1156 1157 Combinations of any of those properties are expressed as a list, like 1158 in these examples: 1159 1160 (semibold) 1161 (variable-pitch semibold 1.3) 1162 (variable-pitch semibold (height 1.3)) ; same as above 1163 (variable-pitch semibold (height . 1.3)) ; same as above 1164 1165 The order in which the properties are set is not significant. 1166 1167 In user configuration files the form may look like this: 1168 1169 (setq modus-themes-headings 1170 '((1 . (variable-pitch 1.5)) 1171 (2 . (1.3)) 1172 (agenda-date . (1.3)) 1173 (agenda-structure . (variable-pitch light 1.8)) 1174 (t . (1.1)))) 1175 1176 When defining the styles per heading level, it is possible to pass a 1177 non-‘nil’ value (‘t’) instead of a list of properties. This will retain 1178 the original aesthetic for that level. For example: 1179 1180 (setq modus-themes-headings 1181 '((1 . t) ; keep the default style 1182 (2 . (semibold 1.2)) 1183 (t . (rainbow)))) ; style for all other headings 1184 1185 (setq modus-themes-headings 1186 '((1 . (variable-pitch 1.5)) 1187 (2 . (semibold)) 1188 (t . t))) ; default style for all other levels 1189 1190 Note that the text color of headings, of their background, and 1191 overline can all be set via the overrides. It is possible to have any 1192 color combination for any heading level (something that could not be 1193 done in older versions of the themes). 1194 1195 *note Option for palette overrides: Palette overrides. 1196 1197 *note Make headings more or less colorful: DIY Make headings more or 1198 less colorful. 1199 1200 1201 File: docv6TKvo.info, Node: UI typeface, Next: Palette overrides, Prev: Heading styles, Up: Customization options 1202 1203 4.11 Option for variable-pitch font in UI elements 1204 ================================================== 1205 1206 Brief: Toggle the use of proportionately spaced (‘variable-pitch’) fonts 1207 in the User Interface. 1208 1209 Symbol: ‘modus-themes-variable-pitch-ui’ (‘boolean’ type) 1210 1211 Possible values: 1212 1213 1. ‘nil’ (default) 1214 2. ‘t’ 1215 1216 This option concerns User Interface elements that are under the 1217 direct control of Emacs. In particular: the mode line, header line, tab 1218 bar, and tab line. 1219 1220 The default is to use the same font as the rest of Emacs, which 1221 usually is a monospaced family. 1222 1223 With a non-‘nil’ value (‘t’) apply a proportionately spaced typeface. 1224 This is done by assigning the ‘variable-pitch’ face to the relevant 1225 items. 1226 1227 *note Font configurations for Org and others: DIY Font configurations 1228 for Org and others. 1229 1230 1231 File: docv6TKvo.info, Node: Palette overrides, Prev: UI typeface, Up: Customization options 1232 1233 4.12 Option for palette overrides 1234 ================================= 1235 1236 This section describes palette overrides in detail. For a simpler 1237 alternative, use the presets we provide (*note Palette override presets: 1238 DIY Palette override presets.). 1239 1240 Each Modus theme specifies a color palette that declares named color 1241 values and semantic color mappings: 1242 1243 • Named colors consist of a symbol and a string that specifies a 1244 hexadecimal RGB value. For example: ‘(blue-warmer "#354fcf")’. 1245 1246 • The semantic color mappings associate an abstract construct with a 1247 given named color from the palette, like ‘(heading-2 1248 yellow-faint)’. Both elements of the list are symbols, though the 1249 ‘cadr’ (value) can be a string that specifies a color, such as 1250 ‘(heading-2 "#354fcf")’. 1251 1252 Both of those subsets can be overridden, thus refashioning the theme. 1253 Overrides are either shared, by being stored in the user option 1254 ‘modus-themes-common-palette-overrides’, or they are specific to the 1255 theme they name. In the latter case, the naming scheme of each palette 1256 variable is ‘THEME-NAME-palette-overrides’, thus yielding: 1257 1258 • ‘modus-operandi-palette-overrides’ 1259 1260 • ‘modus-operandi-deuteranopia-palette-overrides’ 1261 1262 • ‘modus-operandi-tinted-palette-overrides’ 1263 1264 • ‘modus-operandi-tritanopia-palette-overrides’ 1265 1266 • ‘modus-vivendi-palette-overrides’ 1267 1268 • ‘modus-vivendi-deuteranopia-palette-overrides’ 1269 1270 • ‘modus-vivendi-tinted-palette-overrides’ 1271 1272 • ‘modus-vivendi-tritanopia-palette-overrides’ 1273 1274 Theme-specific overrides take precedence over the shared ones. It is 1275 strongly advised that shared overrides do NOT alter color values, as 1276 those will not be appropriate for both dark and light themes. Common 1277 overrides are best limited to the semantic color mappings as those use 1278 the color value that corresponds to the active theme (e.g. make the 1279 cursor ‘blue-warmer’ in all themes, whatever the value of ‘blue-warmer’ 1280 is in each theme). 1281 1282 The value of any overrides’ variable must mirror a theme’s palette. 1283 Palette variables are named after their theme as ‘THEME-NAME-palette’. 1284 For example, the ‘modus-operandi-palette’ is like this: 1285 1286 (defconst modus-operandi-palette 1287 '( 1288 ;;; Basic values 1289 1290 (bg-main "#ffffff") 1291 (bg-dim "#f0f0f0") 1292 (fg-main "#000000") 1293 1294 ;; ... 1295 1296 (red "#a60000") 1297 (red-warmer "#972500") 1298 (red-cooler "#a0132f") 1299 (red-faint "#7f0000") 1300 (red-intense "#d00000") 1301 1302 ;; ... 1303 1304 ;;;; Mappings 1305 1306 ;; ... 1307 1308 (cursor fg-main) 1309 (builtin magenta-warmer) 1310 (comment fg-dim) 1311 (constant blue-cooler) 1312 (docstring green-faint) 1313 (fnname magenta) 1314 (keyword magenta-cooler) 1315 1316 ;; ... 1317 )) 1318 1319 The ‘modus-operandi-palette-overrides’ targets the entries that need 1320 to be changed. For example, to make the main foreground color a dark 1321 gray instead of pure black, use a shade of red for comments, and apply a 1322 cyan hue to keywords: 1323 1324 (setq modus-operandi-palette-overrides 1325 '((fg-main "#333333") 1326 (comment red-faint) 1327 (keyword cyan-cooler))) 1328 1329 Changes take effect upon theme reload (*note Custom reload theme::). 1330 Overrides are removed by setting their variable to a ‘nil’ value. 1331 1332 The common accented foregrounds in each palette follow a predictable 1333 naming scheme: ‘HUE{,-warmer,-cooler,-faint,-intense}’. ‘HUE’ is one of 1334 the six basic colors: red, green, blue, yellow, magenta, cyan. 1335 1336 Named colors that are meant to be used as backgrounds contain ‘bg’ in 1337 their name, such as ‘bg-red-intense’. While special purpose foregrounds 1338 that are meant to be combined with such backgrounds, contain ‘fg’ in 1339 their name, such as ‘fg-removed’ which complements ‘bg-removed’. 1340 1341 Named colors can be previewed, such as with the command 1342 ‘modus-themes-list-colors’ (*note Preview theme colors::). 1343 1344 For a video tutorial that users of all skill levels can approach, 1345 watch: 1346 <https://protesilaos.com/codelog/2022-12-17-modus-themes-v4-demo/>. 1347 1348 1349 File: docv6TKvo.info, Node: Preview theme colors, Next: Use colors from the Modus themes palette, Prev: Customization options, Up: Top 1350 1351 5 Preview theme colors 1352 ********************** 1353 1354 The command ‘modus-themes-list-colors’ uses minibuffer completion to 1355 select an item from the Modus themes and then produces a buffer with 1356 previews of its color palette entries. The buffer has a naming scheme 1357 that reflects the given choice, like ‘modus-operandi-list-colors’ for 1358 the ‘modus-operandi’ theme. 1359 1360 The command ‘modus-themes-list-colors-current’ skips the minibuffer 1361 selection process and just produces a preview for the current Modus 1362 theme. 1363 1364 When called with a prefix argument (‘C-u’ with the default key 1365 bindings), these commands will show a preview of the palette’s semantic 1366 color mappings instead of the named colors. In this context, “named 1367 colors” are entries that associate a symbol to a string color value, 1368 such as ‘(blue-warmer "#354fcf")’. Whereas “semantic color mappings” 1369 associate a named color to a symbol, like ‘(string blue-warmer)’, thus 1370 making the theme render all string constructs in the ‘blue-warmer’ color 1371 value (*note Option for palette overrides: Palette overrides.). 1372 1373 Aliases for those commands are ‘modus-themes-preview-colors’ and 1374 ‘modus-themes-preview-colors-current’. 1375 1376 Each row shows a foreground and background coloration using the 1377 underlying value it references. For example a line with ‘#a60000’ (a 1378 shade of red) will show red text followed by a stripe with that same 1379 color as a backdrop. 1380 1381 The name of the buffer describes the given Modus theme and what the 1382 contents are, such as ‘*modus-operandi-list-colors*’ for named colors 1383 and ‘=*modus-operandi-list-mappings*’ for the semantic color mappings. 1384 1385 1386 File: docv6TKvo.info, Node: Use colors from the Modus themes palette, Next: Advanced customization, Prev: Preview theme colors, Up: Top 1387 1388 6 Use colors from the Modus themes palette 1389 ****************************************** 1390 1391 The Modus themes provide the means to access the palette of (i) the 1392 active theme or (ii) any theme in the Modus collection. These are 1393 useful for Do-It-Yourself customizations (*note Advanced 1394 customization::), though it can also be helpful in other cases, such as 1395 to reuse a color value in some other application. 1396 1397 Function 1398 *note Get a single color from the palette with 1399 modus-themes-get-color-value:: 1400 Macro 1401 *note Use theme colors in code with modus-themes-with-colors::. 1402 1403 * Menu: 1404 1405 * Get a single color from the palette with modus-themes-get-color-value:: 1406 * Use theme colors in code with modus-themes-with-colors:: 1407 1408 1409 File: docv6TKvo.info, Node: Get a single color from the palette with modus-themes-get-color-value, Next: Use theme colors in code with modus-themes-with-colors, Up: Use colors from the Modus themes palette 1410 1411 6.1 Get a single color from the palette with ‘modus-themes-get-color-value’ 1412 =========================================================================== 1413 1414 The fuction ‘modus-themes-get-color-value’ can be called from Lisp to 1415 return the value of a color from the active Modus theme palette. It 1416 takea a ‘COLOR’ argument and an optional ‘OVERRIDES’. It also accepts a 1417 third ‘THEME’ argument, to get the color from the given theme. 1418 1419 ‘COLOR’ is a symbol that represents a named color entry in the 1420 palette (*note Preview theme colors::). 1421 1422 If the value is the name of another color entry in the palette (so a 1423 mapping), this function recurs until it finds the underlying color 1424 value. 1425 1426 With an optional ‘OVERRIDES’ argument as a non-‘nil’ value, it 1427 accounts for palette overrides. Else it reads only the default palette 1428 (*note Option for palette overrides: Palette overrides.) 1429 1430 With an optional ‘THEME’ as a symbol among the ‘modus-themes-items’ 1431 (alias ‘modus-themes-collection’), it uses the palette of that theme. 1432 Else it uses the current Modus theme. 1433 1434 If ‘COLOR’ is not present in the palette, this function returns the 1435 ‘unspecified’ symbol, which is safe when used as a face attribute’s 1436 value. 1437 1438 An example with ‘modus-operandi’ to show how this function behaves 1439 with/without overrides and when recursive mappings are introduced. 1440 1441 ;; Here we show the recursion of palette mappings. In general, it is 1442 ;; better for the user to specify named colors to avoid possible 1443 ;; confusion with their configuration, though those still work as 1444 ;; expected. 1445 (setq modus-themes-common-palette-overrides 1446 '((cursor red) 1447 (fg-mode-line-active cursor) 1448 (border-mode-line-active fg-mode-line-active))) 1449 1450 ;; Ignore the overrides and get the original value. 1451 (modus-themes-get-color-value 'border-mode-line-active) 1452 ;; => "#5a5a5a" 1453 1454 ;; Read from the overrides and deal with any recursion to find the 1455 ;; underlying value. 1456 (modus-themes-get-color-value 'border-mode-line-active :overrides) 1457 ;; => "#a60000" 1458 1459 1460 File: docv6TKvo.info, Node: Use theme colors in code with modus-themes-with-colors, Prev: Get a single color from the palette with modus-themes-get-color-value, Up: Use colors from the Modus themes palette 1461 1462 6.2 Use theme colors in code with ‘modus-themes-with-colors’ 1463 ============================================================ 1464 1465 [ Note that for common cases the following is not not needed. Just rely 1466 on the comprehensive overrides we provide (*note Option for palette 1467 overrides: Palette overrides.). ] 1468 1469 Advanced users may want to apply many colors from the palette of the 1470 active Modus theme in their custom code. In such a case, retrieving 1471 each value with the function ‘modus-themes-get-color-value’ is 1472 inefficient (*note Get a single color from the palette: Get a single 1473 color from the palette with modus-themes-get-color-value.). The Lisp 1474 macro ‘modus-themes-with-colors’ provides the requisite functionality. 1475 It supplies the current theme’s palette to the code called from inside 1476 of it. For example: 1477 1478 (modus-themes-with-colors 1479 (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4)) 1480 ;; => ("#354fcf" "#531ab6" "#005000" "#884900" "#005e8b" "#721045") 1481 1482 The above return value is for ‘modus-operandi’ when that is the 1483 active theme. Switching to another theme and evaluating this code anew 1484 will return the relevant results for that theme (remember that since 1485 version 4, the Modus themes consist of many items (*note Overview::)). 1486 The same with ‘modus-vivendi’ as the active theme: 1487 1488 (modus-themes-with-colors 1489 (list blue-warmer magenta-cooler fg-added warning variable fg-heading-4)) 1490 ;; => ("#79a8ff" "#b6a0ff" "#a0e0a0" "#fec43f" "#00d3d0" "#feacd0") 1491 1492 The ‘modus-themes-with-colors’ has access to the whole palette of the 1493 active theme, meaning that it can instantiate both (i) named colors like 1494 ‘blue-warmer’ and (ii) semantic color mappings like ‘warning’. We 1495 provide commands to inspect those (*note Preview theme colors::). 1496 1497 Others sections in this manual show how to use the aforementioned 1498 macro (*note Advanced customization::). In practice, the use of a hook 1499 will also be needed (*note DIY Use a hook at the post-load-theme 1500 phase::). 1501 1502 1503 File: docv6TKvo.info, Node: Advanced customization, Next: Face coverage, Prev: Use colors from the Modus themes palette, Up: Top 1504 1505 7 Advanced customization 1506 ************************ 1507 1508 Unlike the predefined customization options which follow a clear pattern 1509 of allowing the user to quickly specify their preference, the themes 1510 also provide a more flexible, albeit a bit more difficult, mechanism to 1511 control things with precision (*note Customization Options: 1512 Customization options.). 1513 1514 This section is of interest only to users who are prepared to 1515 maintain their own local tweaks and who are willing to deal with any 1516 possible incompatibilities between versioned releases of the themes. As 1517 such, they are labeled as “do-it-yourself” or “DIY”. 1518 1519 * Menu: 1520 1521 * DIY Palette override presets:: 1522 * DIY Stylistic variants using palette overrides:: 1523 * DIY More accurate colors in terminal emulators:: 1524 * DIY Range of color with terminal emulators:: 1525 * DIY Per-theme customization settings:: 1526 * DIY Do not extend the region background:: 1527 * DIY Add padding to the mode line:: 1528 * DIY Remap face with local value:: 1529 * DIY Font configurations for Org and others:: 1530 * DIY Configure bold and italic faces:: 1531 * DIY Custom Org todo keyword and priority faces:: 1532 * DIY Custom Org emphasis faces:: 1533 * DIY Use colored Org source blocks per language:: 1534 * DIY Measure color contrast:: 1535 * DIY Load theme depending on time of day:: 1536 * DIY Backdrop for pdf-tools:: 1537 * DIY Toggle themes without reloading them:: 1538 * DIY Use more spacious margins or padding in Emacs frames:: 1539 * DIY Custom hl-todo colors:: 1540 * DIY Add support for solaire-mode:: 1541 * DIY Use a hook at the post-load-theme phase:: 1542 1543 1544 File: docv6TKvo.info, Node: DIY Palette override presets, Next: DIY Stylistic variants using palette overrides, Up: Advanced customization 1545 1546 7.1 DIY Palette override presets 1547 ================================ 1548 1549 This section shows how to refashion the themes by opting in to the 1550 stylistic presets we provide. Those presets override the default color 1551 mappings to amplify, tone down, or refashion the overall coloration of 1552 the themes. 1553 1554 To make almost all aspects of the themes less intense, use this: 1555 1556 ;; Always remember to reload the theme for changes to take effect! 1557 (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-faint) 1558 1559 With ‘modus-themes-preset-overrides-faint’ the grays are toned down, 1560 gray backgrounds are removed from some contexts, and almost all accent 1561 colors are desaturated. It makes the themes less attention-grabbing. 1562 1563 On the opposite end of the stylistic spectrum, we have this 1564 1565 ;; Always remember to reload the theme for changes to take effect! 1566 (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-intense) 1567 1568 The ‘modus-themes-preset-overrides-intense’ makes many background 1569 colors accented instead of gray and increases coloration in a number of 1570 places. Colors stand out more and are made easier to spot. 1571 1572 For some stylistic variation try the “cooler” and “warmer” presets: 1573 1574 ;; This: 1575 (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-cooler) 1576 1577 ;; Or: 1578 (setq modus-themes-common-palette-overrides modus-themes-preset-overrides-warmer) 1579 1580 Note that the user is not limited to those presets. The system of 1581 overrides we provide makes it possible to tweak the value of each 1582 individual named color and to change how values are assigned to semantic 1583 color mappings (*note Option for palette overrides: Palette overrides.). 1584 Subsequent sections provide examples (*note Stylistic variants using 1585 palette overrides: DIY Stylistic variants using palette overrides.). 1586 1587 It is also possible to use those presets as a basis and, for example, 1588 add to them code from the subsequent sections of this manual. This is 1589 the general idea (extra space for didactic purposes): 1590 1591 (setq modus-themes-common-palette-overrides 1592 `( 1593 ;; From the section "Make the mode line borderless" 1594 (border-mode-line-active unspecified) 1595 (border-mode-line-inactive unspecified) 1596 1597 ;; From the section "Make matching parenthesis more or less intense" 1598 (bg-paren-match bg-magenta-intense) 1599 (underline-paren-match fg-main) 1600 1601 ;; And expand the preset here. Note that the ,@ works because 1602 ;; we use the backtick for this list, instead of a straight 1603 ;; quote. 1604 ,@modus-themes-preset-overrides-intense)) 1605 1606 1607 File: docv6TKvo.info, Node: DIY Stylistic variants using palette overrides, Next: DIY More accurate colors in terminal emulators, Prev: DIY Palette override presets, Up: Advanced customization 1608 1609 7.2 DIY Stylistic variants using palette overrides 1610 ================================================== 1611 1612 This section contains practical examples of overriding the palette of 1613 the themes (*note Option for palette overrides: Palette overrides.). 1614 Users can copy the code to their init file, evaluate it, and then 1615 re-load the theme for changes to take effect. To apply overrides at 1616 startup simply define them before the call that loads the theme. 1617 Remember that we also provide presets that are easier to apply (*note 1618 Palette override presets: DIY Palette override presets.). 1619 1620 * Menu: 1621 1622 * DIY Make the mode line borderless:: 1623 * DIY Make the active mode line colorful:: 1624 * DIY Make the tab bar more or less colorful:: 1625 * DIY Make the fringe invisible or another color:: 1626 * DIY Make links use subtle or no underlines:: 1627 * DIY Make prompts more or less colorful:: 1628 * DIY Make completion matches more or less colorful:: 1629 * DIY Make comments yellow and strings green:: 1630 * DIY Make code syntax use the old alt-syntax style:: 1631 * DIY Make use of alternative styles for code syntax:: 1632 * DIY Make matching parenthesis more or less intense:: 1633 * DIY Make box buttons more or less gray:: 1634 * DIY Make TODO and DONE more or less intense:: 1635 * DIY Make headings more or less colorful:: 1636 * DIY Make Org block colors more or less colorful:: 1637 * DIY Make Org agenda more or less colorful:: 1638 * DIY Make inline code in prose use alternative styles:: 1639 * DIY Make mail citations and headers more or less colorful:: 1640 * DIY Make the region preserve text colors, plus other styles: DIY Make the region preserve text colors plus other styles. 1641 * DIY Make mouse highlights more or less colorful:: 1642 * DIY Make language underlines less colorful:: 1643 * DIY Make line numbers use alternative styles:: 1644 * DIY Make diffs use only a foreground:: 1645 * DIY Make deuteranopia diffs red and blue instead of yellow and blue:: 1646 1647 1648 File: docv6TKvo.info, Node: DIY Make the mode line borderless, Next: DIY Make the active mode line colorful, Up: DIY Stylistic variants using palette overrides 1649 1650 7.2.1 DIY Make the mode line borderless 1651 --------------------------------------- 1652 1653 This is one of our practical examples to override the semantic colors of 1654 the Modus themes (*note Stylistic variants using palette overrides: DIY 1655 Stylistic variants using palette overrides.). To hide the border around 1656 the active and inactive mode lines, we need to set their color to that 1657 of the underlying background. 1658 1659 *note Make the active mode line colorful: DIY Make the active mode 1660 line colorful. 1661 1662 *note Add padding to mode line: DIY Add padding to the mode line. 1663 1664 ;; Remove the border 1665 (setq modus-themes-common-palette-overrides 1666 '((border-mode-line-active unspecified) 1667 (border-mode-line-inactive unspecified))) 1668 1669 ;; Keep the border but make it the same color as the background of the 1670 ;; mode line (thus appearing borderless). The difference with the 1671 ;; above is that this version is a bit thicker because the border are 1672 ;; still there. 1673 (setq modus-themes-common-palette-overrides 1674 '((border-mode-line-active bg-mode-line-active) 1675 (border-mode-line-inactive bg-mode-line-inactive))) 1676 1677 Reload the theme for changes to take effect. 1678 1679 1680 File: docv6TKvo.info, Node: DIY Make the active mode line colorful, Next: DIY Make the tab bar more or less colorful, Prev: DIY Make the mode line borderless, Up: DIY Stylistic variants using palette overrides 1681 1682 7.2.2 DIY Make the active mode line colorful 1683 -------------------------------------------- 1684 1685 This is one of our practical examples to override the semantic colors of 1686 the Modus themes (*note Stylistic variants using palette overrides: DIY 1687 Stylistic variants using palette overrides.). Here we show some 1688 snippets that apply different stylistic variants. Of course, it is 1689 possible to use theme-specific overrides to, say, have a blue mode line 1690 for ‘modus-operandi’ and a red one for ‘modus-vivendi’. 1691 1692 *note Make the mode line borderless: DIY Make the mode line 1693 borderless. 1694 1695 *note Add padding to mode line: DIY Add padding to the mode line. 1696 1697 ;; Blue background, neutral foreground, intense blue border 1698 (setq modus-themes-common-palette-overrides 1699 '((bg-mode-line-active bg-blue-intense) 1700 (fg-mode-line-active fg-main) 1701 (border-mode-line-active blue-intense))) 1702 1703 ;; Subtle blue background, neutral foreground, intense blue border 1704 (setq modus-themes-common-palette-overrides 1705 '((bg-mode-line-active bg-blue-subtle) 1706 (fg-mode-line-active fg-main) 1707 (border-mode-line-active blue-intense))) 1708 1709 ;; Sage (green/cyan) background, neutral foreground, slightly distinct green border 1710 (setq modus-themes-common-palette-overrides 1711 '((bg-mode-line-active bg-sage) 1712 (fg-mode-line-active fg-main) 1713 (border-mode-line-active bg-green-intense))) 1714 1715 ;; As above, but with a purple style 1716 (setq modus-themes-common-palette-overrides 1717 '((bg-mode-line-active bg-lavender) 1718 (fg-mode-line-active fg-main) 1719 (border-mode-line-active bg-magenta-intense))) 1720 1721 ;; As above, but with an earthly style 1722 (setq modus-themes-common-palette-overrides 1723 '((bg-mode-line-active bg-ochre) 1724 (fg-mode-line-active fg-main) 1725 (border-mode-line-active bg-yellow-intense))) 1726 1727 Reload the theme for changes to take effect. 1728 1729 1730 File: docv6TKvo.info, Node: DIY Make the tab bar more or less colorful, Next: DIY Make the fringe invisible or another color, Prev: DIY Make the active mode line colorful, Up: DIY Stylistic variants using palette overrides 1731 1732 7.2.3 DIY Make the tab bar more or less colorful 1733 ------------------------------------------------ 1734 1735 This is one of our practical examples to override the semantic colors of 1736 the Modus themes (*note Stylistic variants using palette overrides: DIY 1737 Stylistic variants using palette overrides.). Here we show how to 1738 affect the colors of the built-in ‘tab-bar-mode’ and ‘tab-line-mode’. 1739 1740 For consistent theme-wide results, consider changing the mode line, 1741 fringes, and line numbers. These are shown in other sections of this 1742 manual. 1743 1744 ;; Make the `tab-bar-mode' mode subtle while keepings its original 1745 ;; gray aesthetic. 1746 (setq modus-themes-common-palette-overrides 1747 '((bg-tab-bar bg-main) 1748 (bg-tab-current bg-active) 1749 (bg-tab-other bg-dim))) 1750 1751 ;; Like the above, but the current tab has a colorful background and 1752 ;; the inactive tabs have a slightly more noticeable gray background. 1753 (setq modus-themes-common-palette-overrides 1754 '((bg-tab-bar bg-main) 1755 (bg-tab-current bg-cyan-intense) 1756 (bg-tab-other bg-inactive))) 1757 1758 ;; Make the tabs colorful, using a monochromatic pattern (e.g. shades 1759 ;; of cyan). 1760 (setq modus-themes-common-palette-overrides 1761 '((bg-tab-bar bg-cyan-nuanced) 1762 (bg-tab-current bg-cyan-intense) 1763 (bg-tab-other bg-cyan-subtle))) 1764 1765 ;; Like the above, but with a dichromatic pattern (cyan and magenta). 1766 (setq modus-themes-common-palette-overrides 1767 '((bg-tab-bar bg-cyan-nuanced) 1768 (bg-tab-current bg-magenta-intense) 1769 (bg-tab-other bg-cyan-subtle))) 1770 1771 Reload the theme for changes to take effect. 1772 1773 1774 File: docv6TKvo.info, Node: DIY Make the fringe invisible or another color, Next: DIY Make links use subtle or no underlines, Prev: DIY Make the tab bar more or less colorful, Up: DIY Stylistic variants using palette overrides 1775 1776 7.2.4 DIY Make the fringe invisible or another color 1777 ---------------------------------------------------- 1778 1779 This is one of our practical examples to override the semantic colors of 1780 the Modus themes (*note Stylistic variants using palette overrides: DIY 1781 Stylistic variants using palette overrides.). Here we show how to make 1782 the fringe invisible or how to assign to it a different color. The 1783 “fringe” is a small area to the right and left side of the Emacs window 1784 which shows indicators such as for truncation or continuation lines. 1785 1786 ;; Make the fringe invisible 1787 (setq modus-themes-common-palette-overrides 1788 '((fringe unspecified))) 1789 1790 ;; Make the fringe more intense 1791 (setq modus-themes-common-palette-overrides 1792 '((fringe bg-active))) 1793 1794 ;; Make the fringe colorful, but nuanced 1795 (setq modus-themes-common-palette-overrides 1796 '((fringe bg-blue-nuanced))) 1797 1798 Reload the theme for changes to take effect. 1799 1800 1801 File: docv6TKvo.info, Node: DIY Make links use subtle or no underlines, Next: DIY Make prompts more or less colorful, Prev: DIY Make the fringe invisible or another color, Up: DIY Stylistic variants using palette overrides 1802 1803 7.2.5 DIY Make links use subtle or no underlines 1804 ------------------------------------------------ 1805 1806 This is one of our practical examples to override the semantic colors of 1807 the Modus themes (*note Stylistic variants using palette overrides: DIY 1808 Stylistic variants using palette overrides.). In this example, we 1809 showcase the special use of the ‘unspecified’ symbol that underline 1810 mappings can read correctly. 1811 1812 ;; Subtle underlines 1813 (setq modus-themes-common-palette-overrides 1814 '((underline-link border) 1815 (underline-link-visited border) 1816 (underline-link-symbolic border))) 1817 1818 ;; No underlines 1819 (setq modus-themes-common-palette-overrides 1820 '((underline-link unspecified) 1821 (underline-link-visited unspecified) 1822 (underline-link-symbolic unspecified))) 1823 1824 Reload the theme for changes to take effect. 1825 1826 1827 File: docv6TKvo.info, Node: DIY Make prompts more or less colorful, Next: DIY Make completion matches more or less colorful, Prev: DIY Make links use subtle or no underlines, Up: DIY Stylistic variants using palette overrides 1828 1829 7.2.6 DIY Make prompts more or less colorful 1830 -------------------------------------------- 1831 1832 This section contains practical examples of overriding the palette of 1833 the themes (*note Option for palette overrides: Palette overrides.). In 1834 the following code block we show how to add or remove color from 1835 prompts. 1836 1837 *note Option for command prompt styles: Command prompts. 1838 1839 ;; Keep the background unspecified (like the default), but use a faint 1840 ;; foreground color. 1841 (setq modus-themes-common-palette-overrides 1842 '((fg-prompt cyan-faint) 1843 (bg-prompt unspecified))) 1844 1845 ;; Add a nuanced background to prompts that complements their foreground. 1846 (setq modus-themes-common-palette-overrides 1847 '((fg-prompt cyan) 1848 (bg-prompt bg-cyan-nuanced))) 1849 1850 ;; Add a yellow background and adjust the foreground accordingly. 1851 (setq modus-themes-common-palette-overrides 1852 '((fg-prompt fg-main) 1853 (bg-prompt bg-yellow-subtle))) ; try to replace "subtle" with "intense" 1854 1855 Reload the theme for changes to take effect. 1856 1857 1858 File: docv6TKvo.info, Node: DIY Make completion matches more or less colorful, Next: DIY Make comments yellow and strings green, Prev: DIY Make prompts more or less colorful, Up: DIY Stylistic variants using palette overrides 1859 1860 7.2.7 DIY Make completion matches more or less colorful 1861 ------------------------------------------------------- 1862 1863 This section contains practical examples of overriding the palette of 1864 the themes (*note Option for palette overrides: Palette overrides.). 1865 Here we demonstrate how to activate background coloration for completion 1866 matches. We show three different degrees of intensity. 1867 1868 *note Option for completion framework aesthetics: Completion UIs. 1869 1870 ;; Add a nuanced background color to completion matches, while keeping 1871 ;; their foreground intact (foregrounds do not need to be specified in 1872 ;; this case, but we do it for didactic purposes). 1873 (setq modus-themes-common-palette-overrides 1874 '((fg-completion-match-0 blue) 1875 (fg-completion-match-1 magenta-warmer) 1876 (fg-completion-match-2 cyan) 1877 (fg-completion-match-3 red) 1878 (bg-completion-match-0 bg-blue-nuanced) 1879 (bg-completion-match-1 bg-magenta-nuanced) 1880 (bg-completion-match-2 bg-cyan-nuanced) 1881 (bg-completion-match-3 bg-red-nuanced))) 1882 1883 ;; Add intense background colors to completion matches and adjust the 1884 ;; foregrounds accordingly. 1885 (setq modus-themes-common-palette-overrides 1886 '((fg-completion-match-0 fg-main) 1887 (fg-completion-match-1 fg-main) 1888 (fg-completion-match-2 fg-main) 1889 (fg-completion-match-3 fg-main) 1890 (bg-completion-match-0 bg-blue-intense) 1891 (bg-completion-match-1 bg-yellow-intense) 1892 (bg-completion-match-2 bg-cyan-intense) 1893 (bg-completion-match-3 bg-red-intense))) 1894 1895 ;; Like the above, but with subtle backgrounds. 1896 (setq modus-themes-common-palette-overrides 1897 '((fg-completion-match-0 fg-main) 1898 (fg-completion-match-1 fg-main) 1899 (fg-completion-match-2 fg-main) 1900 (fg-completion-match-3 fg-main) 1901 (bg-completion-match-0 bg-blue-subtle) 1902 (bg-completion-match-1 bg-yellow-subtle) 1903 (bg-completion-match-2 bg-cyan-subtle) 1904 (bg-completion-match-3 bg-red-subtle))) 1905 1906 Adding to the above, it is possible to, say, reduce the number of 1907 colors to two: 1908 1909 ;; No backgrounds (like the default) and just use two colors. 1910 (setq modus-themes-common-palette-overrides 1911 '((fg-completion-match-0 blue) 1912 (fg-completion-match-1 yellow) 1913 (fg-completion-match-2 blue) 1914 (fg-completion-match-3 yellow) 1915 (bg-completion-match-0 unspecified) 1916 (bg-completion-match-1 unspecified) 1917 (bg-completion-match-2 unspecified) 1918 (bg-completion-match-3 unspecified))) 1919 1920 ;; Again, a two-color style but this time with backgrounds 1921 (setq modus-themes-common-palette-overrides 1922 '((fg-completion-match-0 blue) 1923 (fg-completion-match-1 yellow) 1924 (fg-completion-match-2 blue) 1925 (fg-completion-match-3 yellow) 1926 (bg-completion-match-0 bg-blue-nuanced) 1927 (bg-completion-match-1 bg-yellow-nuanced) 1928 (bg-completion-match-2 bg-blue-nuanced) 1929 (bg-completion-match-3 bg-yellow-nuanced))) 1930 1931 The user can mix and match to their liking. 1932 1933 Reload the theme for changes to take effect. 1934 1935 1936 File: docv6TKvo.info, Node: DIY Make comments yellow and strings green, Next: DIY Make code syntax use the old alt-syntax style, Prev: DIY Make completion matches more or less colorful, Up: DIY Stylistic variants using palette overrides 1937 1938 7.2.8 DIY Make comments yellow and strings green 1939 ------------------------------------------------ 1940 1941 This is one of our practical examples to override the semantic colors of 1942 the Modus themes (*note Stylistic variants using palette overrides: DIY 1943 Stylistic variants using palette overrides.). In previous versions of 1944 the themes, we provided an option for yellow-ish comments and green-ish 1945 strings. For some users, those were still not good enough, as the exact 1946 values were hardcoded. Here we show how to reproduce the effect, but 1947 also how to tweak it to one’s liking. 1948 1949 *note Make code syntax use the old alt-syntax style: DIY Make code 1950 syntax use the old alt-syntax style. 1951 1952 *note Make use of alternative styles for code syntax: DIY Make use of 1953 alternative styles for code syntax. 1954 1955 ;; Yellow comments and green strings like older versions of the Modus 1956 ;; themes 1957 (setq modus-themes-common-palette-overrides 1958 '((comment yellow-cooler) 1959 (string green-cooler))) 1960 1961 ;; Faint yellow comments and a different shade of green for strings 1962 (setq modus-themes-common-palette-overrides 1963 '((comment yellow-faint) 1964 (string green-warmer))) 1965 1966 ;; Green comments and yellow strings, because now the user has the 1967 ;; freedom to do it 1968 (setq modus-themes-common-palette-overrides 1969 '((comment green) 1970 (string yellow-cooler))) 1971 1972 Reload the theme for changes to take effect. 1973 1974 1975 File: docv6TKvo.info, Node: DIY Make code syntax use the old alt-syntax style, Next: DIY Make use of alternative styles for code syntax, Prev: DIY Make comments yellow and strings green, Up: DIY Stylistic variants using palette overrides 1976 1977 7.2.9 DIY Make code syntax use the old alt-syntax style 1978 ------------------------------------------------------- 1979 1980 This is one of our practical examples to override the semantic colors of 1981 the Modus themes (*note Stylistic variants using palette overrides: DIY 1982 Stylistic variants using palette overrides.). In this section we show 1983 how to reproduce what previous versions of the Modus themes provided as 1984 a stylistic alternative for code syntax. The upside of using overrides 1985 for this purpose is that we can tweak the style to our liking, but first 1986 let’s start with its recreation: 1987 1988 ;; The old "alt-syntax" (before version 4.0.0 of the Modus themes) 1989 (setq modus-themes-common-palette-overrides 1990 '((builtin magenta) 1991 (comment fg-dim) 1992 (constant magenta-cooler) 1993 (docstring magenta-faint) 1994 (docmarkup green-faint) 1995 (fnname magenta-warmer) 1996 (keyword cyan) 1997 (preprocessor cyan-cooler) 1998 (string red-cooler) 1999 (type magenta-cooler) 2000 (variable blue-warmer) 2001 (rx-construct magenta-warmer) 2002 (rx-backslash blue-cooler))) 2003 2004 The “alt-syntax” could optionally use green strings and yellow 2005 comments (*note Make comments yellow and strings green: DIY Make 2006 comments yellow and strings green.): 2007 2008 ;; Same as above, but with yellow comments and green strings 2009 (setq modus-themes-common-palette-overrides 2010 '((builtin magenta) 2011 (comment yellow-faint) 2012 (constant magenta-cooler) 2013 (docstring green-faint) 2014 (docmarkup magenta-faint) 2015 (fnname magenta-warmer) 2016 (keyword cyan) 2017 (preprocessor cyan-cooler) 2018 (string green-cooler) 2019 (type magenta-cooler) 2020 (variable blue-warmer) 2021 (rx-construct magenta-warmer) 2022 (rx-backslash blue-cooler))) 2023 2024 The standard “alt-syntax” has red strings. As such, it is 2025 interesting to experiment with faintly red colored comments: 2026 2027 ;; Like the old "alt-syntax" but with faint red comments 2028 (setq modus-themes-common-palette-overrides 2029 '((builtin magenta) 2030 (comment red-faint) 2031 (constant magenta-cooler) 2032 (docstring magenta-faint) 2033 (docmarkup green-faint) 2034 (fnname magenta-warmer) 2035 (keyword cyan) 2036 (preprocessor cyan-cooler) 2037 (string red-cooler) 2038 (type magenta-cooler) 2039 (variable blue-warmer) 2040 (rx-construct magenta-warmer) 2041 (rx-backslash blue-cooler))) 2042 2043 The user can always mix and match styles to their liking. 2044 2045 *note Make use of alternative styles for code syntax: DIY Make use of 2046 alternative styles for code syntax. 2047 2048 Reload the theme for changes to take effect. 2049 2050 2051 File: docv6TKvo.info, Node: DIY Make use of alternative styles for code syntax, Next: DIY Make matching parenthesis more or less intense, Prev: DIY Make code syntax use the old alt-syntax style, Up: DIY Stylistic variants using palette overrides 2052 2053 7.2.10 DIY Make use of alternative styles for code syntax 2054 --------------------------------------------------------- 2055 2056 This is one of our practical examples to override the semantic colors of 2057 the Modus themes (*note Stylistic variants using palette overrides: DIY 2058 Stylistic variants using palette overrides.). The idea here is to 2059 change how named colors are mapped to code syntax. Each of the 2060 following snippets give the ‘modus-themes’ a different feel while 2061 editing code. 2062 2063 Note that my ‘modus-themes’ and ‘ef-themes’ do not use the same 2064 palettes, so some things are different. If you copy from the latter to 2065 the former, double-check that the entries exist in the given Modus theme 2066 palette. 2067 2068 *note Make comments yellow and strings green: DIY Make comments 2069 yellow and strings green. 2070 2071 *note Make code syntax use the old alt-syntax style: DIY Make code 2072 syntax use the old alt-syntax style. 2073 2074 ;; Mimic `ef-night' theme (from my `ef-themes') for code syntax 2075 ;; highlighting, while still using the Modus colors (and other 2076 ;; mappings). 2077 (setq modus-themes-common-palette-overrides 2078 '((builtin green-cooler) 2079 (comment yellow-faint) 2080 (constant magenta-cooler) 2081 (fnname cyan-cooler) 2082 (keyword blue-warmer) 2083 (preprocessor red-warmer) 2084 (docstring cyan-faint) 2085 (string blue-cooler) 2086 (type magenta-cooler) 2087 (variable cyan))) 2088 2089 ;; Mimic `ef-summer' theme (from my `ef-themes') for code syntax 2090 ;; highlighting, while still using the Modus colors (and other 2091 ;; mappings). 2092 (setq modus-themes-common-palette-overrides 2093 '((builtin magenta) 2094 (comment yellow-faint) 2095 (constant red-cooler) 2096 (fnname magenta-warmer) 2097 (keyword magenta-cooler) 2098 (preprocessor green-warmer) 2099 (docstring cyan-faint) 2100 (string yellow-warmer) 2101 (type cyan-warmer) 2102 (variable blue-warmer))) 2103 2104 ;; Mimic `ef-bio' theme (from my `ef-themes') for code syntax 2105 ;; highlighting, while still using the Modus colors (and other 2106 ;; mappings). 2107 (setq modus-themes-common-palette-overrides 2108 '((builtin green) 2109 (comment yellow-faint) 2110 (constant blue) 2111 (fnname green-warmer) 2112 (keyword green-cooler) 2113 (preprocessor green) 2114 (docstring green-faint) 2115 (string magenta-cooler) 2116 (type cyan-warmer) 2117 (variable blue-warmer))) 2118 2119 ;; Mimic `ef-trio-light' theme (from my `ef-themes') for code syntax 2120 ;; highlighting, while still using the Modus colors (and other 2121 ;; mappings). 2122 (setq modus-themes-common-palette-overrides 2123 '((builtin magenta-cooler) 2124 (comment yellow-faint) 2125 (constant magenta-warmer) 2126 (fnname blue-warmer) 2127 (keyword magenta) 2128 (preprocessor red-cooler) 2129 (docstring magenta-faint) 2130 (string green-cooler) 2131 (type cyan-cooler) 2132 (variable cyan-warmer))) 2133 2134 Reload the theme for changes to take effect. 2135 2136 2137 File: docv6TKvo.info, Node: DIY Make matching parenthesis more or less intense, Next: DIY Make box buttons more or less gray, Prev: DIY Make use of alternative styles for code syntax, Up: DIY Stylistic variants using palette overrides 2138 2139 7.2.11 DIY Make matching parenthesis more or less intense 2140 --------------------------------------------------------- 2141 2142 This is one of our practical examples to override the semantic colors of 2143 the Modus themes (*note Stylistic variants using palette overrides: DIY 2144 Stylistic variants using palette overrides.). In this code block we 2145 show how to change the background of matching delimiters when 2146 ‘show-paren-mode’ is enabled. We also demonstrate how to enable 2147 underlines for those highlights. 2148 2149 ;; Change the background to a shade of magenta 2150 (setq modus-themes-common-palette-overrides 2151 '((bg-paren-match bg-magenta-intense))) 2152 2153 ;; Enable underlines by applying a color to them 2154 (setq modus-themes-common-palette-overrides 2155 '((bg-paren-match bg-magenta-intense) 2156 (underline-paren-match fg-main))) 2157 2158 ;; Do not use any background color and instead apply an intense red 2159 ;; foreground. 2160 (setq modus-themes-common-palette-overrides 2161 '((bg-paren-match unspecified) 2162 (fg-paren-match red-intense))) 2163 2164 Reload the theme for changes to take effect. 2165 2166 2167 File: docv6TKvo.info, Node: DIY Make box buttons more or less gray, Next: DIY Make TODO and DONE more or less intense, Prev: DIY Make matching parenthesis more or less intense, Up: DIY Stylistic variants using palette overrides 2168 2169 7.2.12 DIY Make box buttons more or less gray 2170 --------------------------------------------- 2171 2172 This is one of our practical examples to override the semantic colors of 2173 the Modus themes (*note Stylistic variants using palette overrides: DIY 2174 Stylistic variants using palette overrides.). By default, the boxed 2175 buttons that appear in ‘M-x customize’ and related are distinct shades 2176 of gray. The following set of overrides removes the gray from the 2177 active buttons and amplifies it for the inactive ones. 2178 2179 (setq modus-themes-common-palette-overrides 2180 '((bg-button-active bg-main) 2181 (fg-button-active fg-main) 2182 (bg-button-inactive bg-inactive) 2183 (fg-button-inactive "gray50"))) 2184 2185 Reload the theme for changes to take effect. 2186 2187 2188 File: docv6TKvo.info, Node: DIY Make TODO and DONE more or less intense, Next: DIY Make headings more or less colorful, Prev: DIY Make box buttons more or less gray, Up: DIY Stylistic variants using palette overrides 2189 2190 7.2.13 DIY Make TODO and DONE more or less intense 2191 -------------------------------------------------- 2192 2193 This is one of our practical examples to override the semantic colors of 2194 the Modus themes (*note Stylistic variants using palette overrides: DIY 2195 Stylistic variants using palette overrides.). Here we show how to 2196 affect just the ‘TODO’ and ‘DONE’ keywords that we encounter in Org 2197 buffers. The idea is to make those pop out more or to subdue them. 2198 2199 *note Make headings more or less colorful: DIY Make headings more or 2200 less colorful. 2201 2202 *note Make inline code in prose use alternative styles: DIY Make 2203 inline code in prose use alternative styles. 2204 2205 ;; Increase intensity 2206 (setq modus-themes-common-palette-overrides 2207 '((prose-done green-intense) 2208 (prose-todo red-intense))) 2209 2210 ;; Tone down intensity 2211 (setq modus-themes-common-palette-overrides 2212 '((prose-done green-faint) ; OR replace `green-faint' with `olive' 2213 (prose-todo red-faint))) ; OR replace `red-faint' with `rust' 2214 2215 ;; Keep TODO at its default (so no override for it), but make DONE 2216 ;; gray. 2217 (setq modus-themes-common-palette-overrides 2218 '((prose-done fg-dim))) 2219 2220 Reload the theme for changes to take effect. 2221 2222 2223 File: docv6TKvo.info, Node: DIY Make headings more or less colorful, Next: DIY Make Org block colors more or less colorful, Prev: DIY Make TODO and DONE more or less intense, Up: DIY Stylistic variants using palette overrides 2224 2225 7.2.14 DIY Make headings more or less colorful 2226 ---------------------------------------------- 2227 2228 This is one of our practical examples to override the semantic colors of 2229 the Modus themes (*note Stylistic variants using palette overrides: DIY 2230 Stylistic variants using palette overrides.). Here we show how to alter 2231 the looks of headings, such as in Org mode. Using overrides here offers 2232 far more flexibility than what we could achieve with previous versions 2233 of the themes: the user can mix and match styles at will. 2234 2235 *note Make TODO and DONE more intense: DIY Make TODO and DONE more or 2236 less intense. 2237 2238 ;; Apply more colorful foreground to some headings (headings 0-8). 2239 ;; Level 0 is for Org #+title and related. 2240 (setq modus-themes-common-palette-overrides 2241 '((fg-heading-1 blue-warmer) 2242 (fg-heading-2 yellow-cooler) 2243 (fg-heading-3 cyan-cooler))) 2244 2245 ;; Like the above, but with gradient colors 2246 (setq modus-themes-common-palette-overrides 2247 '((fg-heading-1 blue) 2248 (fg-heading-2 cyan) 2249 (fg-heading-3 green))) 2250 2251 ;; Add color to level 1 heading, but use the main foreground for 2252 ;; others 2253 (setq modus-themes-common-palette-overrides 2254 '((fg-heading-1 blue) 2255 (fg-heading-2 fg-main) 2256 (fg-heading-3 fg-main))) 2257 2258 ;; Apply colorful foreground, background, and overline (headings 0-8) 2259 (setq modus-themes-common-palette-overrides 2260 '((fg-heading-1 blue-warmer) 2261 (bg-heading-1 bg-blue-nuanced) 2262 (overline-heading-1 blue))) 2263 2264 ;; Apply gray scale foreground, background, and overline (headings 0-8) 2265 (setq modus-themes-common-palette-overrides 2266 '((fg-heading-1 fg-main) 2267 (bg-heading-1 bg-dim) 2268 (overline-heading-1 border))) 2269 2270 Reload the theme for changes to take effect. 2271 2272 2273 File: docv6TKvo.info, Node: DIY Make Org block colors more or less colorful, Next: DIY Make Org agenda more or less colorful, Prev: DIY Make headings more or less colorful, Up: DIY Stylistic variants using palette overrides 2274 2275 7.2.15 DIY Make Org block colors more or less colorful 2276 ------------------------------------------------------ 2277 2278 This is one of our practical examples to override the semantic colors of 2279 the Modus themes (*note Stylistic variants using palette overrides: DIY 2280 Stylistic variants using palette overrides.). Here we show how to 2281 change the presentation of Org blocks (and other such blocks like 2282 Markdown fenced code sections, though the exact presentation depends on 2283 each major mode). 2284 2285 The default style of Org blocks is a subtle gray background for the 2286 contents and for the delimiter lines (the ‘#+begin_’ and ‘#+end_’ 2287 parts). The text of the delimiter lines is a subtle gray foreground 2288 color. 2289 2290 *note Make inline code in prose use alternative styles: DIY Make 2291 inline code in prose use alternative styles. 2292 2293 ;; Make code blocks (in Org, for example) use a more colorful style 2294 ;; for their delimiter lines as well as their contents. Give this a 2295 ;; purple feel. Make the delimiter lines distinct from the contents. 2296 (setq modus-themes-common-palette-overrides 2297 '((bg-prose-block-contents bg-magenta-nuanced) 2298 (bg-prose-block-delimiter bg-lavender) 2299 (fg-prose-block-delimiter fg-main))) 2300 2301 ;; As above, but with a more blue feel. 2302 (setq modus-themes-common-palette-overrides 2303 '((bg-prose-block-contents bg-blue-nuanced) 2304 (bg-prose-block-delimiter bg-lavender) 2305 (fg-prose-block-delimiter fg-main))) 2306 2307 ;; As above, but with a green feel. 2308 (setq modus-themes-common-palette-overrides 2309 '((bg-prose-block-contents bg-green-nuanced) 2310 (bg-prose-block-delimiter bg-sage) 2311 (fg-prose-block-delimiter fg-main))) 2312 2313 ;; As above, but with a yellow/gold feel. 2314 (setq modus-themes-common-palette-overrides 2315 '((bg-prose-block-contents bg-yellow-nuanced) 2316 (bg-prose-block-delimiter bg-ochre) 2317 (fg-prose-block-delimiter fg-main))) 2318 2319 ;; As above, but with a slightly more red feel. 2320 (setq modus-themes-common-palette-overrides 2321 '((bg-prose-block-contents bg-red-nuanced) 2322 (bg-prose-block-delimiter bg-ochre) 2323 (fg-prose-block-delimiter fg-main))) 2324 2325 The previous examples differentiate the delimiter lines from the 2326 block’s contents. Though we can mimic the default aesthetic of a 2327 uniform background, while changing the applicable colors. Here are some 2328 nice combinations: 2329 2330 ;; Solid green style. 2331 (setq modus-themes-common-palette-overrides 2332 '((bg-prose-block-contents bg-green-nuanced) 2333 (bg-prose-block-delimiter bg-green-nuanced) 2334 (fg-prose-block-delimiter green-warmer))) 2335 2336 ;; Solid yellow style. 2337 (setq modus-themes-common-palette-overrides 2338 '((bg-prose-block-contents bg-yellow-nuanced) 2339 (bg-prose-block-delimiter bg-yellow-nuanced) 2340 (fg-prose-block-delimiter yellow-cooler))) 2341 2342 ;; Solid cyan style. 2343 (setq modus-themes-common-palette-overrides 2344 '((bg-prose-block-contents bg-cyan-nuanced) 2345 (bg-prose-block-delimiter bg-cyan-nuanced) 2346 (fg-prose-block-delimiter cyan-cooler))) 2347 2348 [ Combine the above with a suitable mode line style for maximum 2349 effect (*note DIY Make the active mode line colorful::). ] 2350 2351 Finally, the following makes code blocks have no distinct background. 2352 The minimal styles are applied to the delimiter lines, which only use a 2353 subtle gray foreground. This was the default for the Modus themes up 2354 until version 4.3.0. 2355 2356 ;; Make code blocks more minimal, so that (i) the delimiter lines have 2357 ;; no background, (ii) the delimiter foreground is a subtle gray, and 2358 ;; (iii) the block contents have no distinct background either. This 2359 ;; was the default in versions of the Modus themes before 4.4.0 2360 (setq modus-themes-common-palette-overrides 2361 '((bg-prose-block-contents unspecified) 2362 (bg-prose-block-delimiter unspeficied) 2363 (fg-prose-block-delimiter fg-dim))) 2364 2365 *note DIY Use colored Org source blocks per language::. 2366 2367 2368 File: docv6TKvo.info, Node: DIY Make Org agenda more or less colorful, Next: DIY Make inline code in prose use alternative styles, Prev: DIY Make Org block colors more or less colorful, Up: DIY Stylistic variants using palette overrides 2369 2370 7.2.16 DIY Make Org agenda more or less colorful 2371 ------------------------------------------------ 2372 2373 This is one of our practical examples to override the semantic colors of 2374 the Modus themes (*note Stylistic variants using palette overrides: DIY 2375 Stylistic variants using palette overrides.). Here we provide three 2376 distinct code blocks. The first adds alternative and more varied colors 2377 to the Org agenda (and related). The second uses faint coloration. The 2378 third makes the agenda use various shades of blue. Mix and match at 2379 will, while also combining these styles with what we show in the other 2380 chapters with practical stylistic variants. 2381 2382 ;; Make the Org agenda use alternative and varied colors. 2383 (setq modus-themes-common-palette-overrides 2384 '((date-common cyan) ; default value (for timestamps and more) 2385 (date-deadline red-warmer) 2386 (date-event magenta-warmer) 2387 (date-holiday blue) ; for M-x calendar 2388 (date-now yellow-warmer) 2389 (date-scheduled magenta-cooler) 2390 (date-weekday cyan-cooler) 2391 (date-weekend blue-faint))) 2392 2393 An example with faint coloration: 2394 2395 ;; Make the Org agenda use faint colors. 2396 (setq modus-themes-common-palette-overrides 2397 '((date-common cyan-faint) ; for timestamps and more 2398 (date-deadline red-faint) 2399 (date-event fg-alt) ; default 2400 (date-holiday magenta) ; default (for M-x calendar) 2401 (date-now fg-main) ; default 2402 (date-scheduled yellow-faint) 2403 (date-weekday fg-alt) 2404 (date-weekend fg-dim))) 2405 2406 A third example that makes the agenda more blue: 2407 2408 ;; Make the Org agenda use more blue instead of yellow and red. 2409 (setq modus-themes-common-palette-overrides 2410 '((date-common cyan) ; default value (for timestamps and more) 2411 (date-deadline blue-cooler) 2412 (date-event blue-faint) 2413 (date-holiday blue) ; for M-x calendar 2414 (date-now blue-faint) 2415 (date-scheduled blue) 2416 (date-weekday fg-main) 2417 (date-weekend fg-dim))) 2418 2419 Yet another example that also affects ‘DONE’ and ‘TODO’ keywords: 2420 2421 ;; Change dates to a set of more subtle combinations. Deadlines are a 2422 ;; shade of magenta, scheduled dates are a shade of green that 2423 ;; complements that of the deadlines, weekday headings use the main 2424 ;; foreground color while weekends are a shade of gray. The DONE 2425 ;; keyword is a faint blue-gray while TODO is yellow. 2426 (setq modus-themes-common-palette-overrides 2427 '((date-deadline magenta-warmer) 2428 (date-scheduled green-cooler) 2429 (date-weekday fg-main) 2430 (date-event fg-dim) 2431 (date-now blue) 2432 (prose-done fg-alt) 2433 (prose-todo yellow))) 2434 2435 Reload the theme for changes to take effect. 2436 2437 2438 File: docv6TKvo.info, Node: DIY Make inline code in prose use alternative styles, Next: DIY Make mail citations and headers more or less colorful, Prev: DIY Make Org agenda more or less colorful, Up: DIY Stylistic variants using palette overrides 2439 2440 7.2.17 DIY Make inline code in prose use alternative styles 2441 ----------------------------------------------------------- 2442 2443 This is one of our practical examples to override the semantic colors of 2444 the Modus themes (*note Stylistic variants using palette overrides: DIY 2445 Stylistic variants using palette overrides.). In the following code 2446 block we show how to affect constructs such as Org’s verbatim, code, and 2447 macro entries. We also provide mappings for tables, property drawers, 2448 tags, and code block delimiters, though we do not show every possible 2449 permutation. 2450 2451 • *note Make TODO and DONE more or less intense: DIY Make TODO and 2452 DONE more or less intense. 2453 • *note DIY Make Org block colors more or less colorful::. 2454 2455 ;; A nuanced accented background, combined with a suitable foreground. 2456 (setq modus-themes-common-palette-overrides 2457 '((bg-prose-code bg-green-nuanced) 2458 (fg-prose-code green-cooler) 2459 2460 (bg-prose-verbatim bg-magenta-nuanced) 2461 (fg-prose-verbatim magenta-warmer) 2462 2463 (bg-prose-macro bg-blue-nuanced) 2464 (fg-prose-macro magenta-cooler))) 2465 2466 ;; A more noticeable accented background, combined with a suitable foreground. 2467 (setq modus-themes-common-palette-overrides 2468 '((bg-prose-code bg-sage) 2469 (fg-prose-code green-faint) 2470 2471 (bg-prose-verbatim bg-ochre) 2472 (fg-prose-verbatim red-faint) 2473 2474 (bg-prose-macro bg-lavender) 2475 (fg-prose-macro blue-faint))) 2476 2477 ;; Leave the backgrounds without a color and simply make the foregrounds more intense. 2478 (setq modus-themes-common-palette-overrides 2479 '((bg-prose-code unspecified) 2480 (fg-prose-code green-intense) 2481 2482 (bg-prose-verbatim unspecified) 2483 (fg-prose-verbatim magenta-intense) 2484 2485 (bg-prose-macro unspecified) 2486 (fg-prose-macro cyan-intense))) 2487 2488 Reload the theme for changes to take effect. 2489 2490 2491 File: docv6TKvo.info, Node: DIY Make mail citations and headers more or less colorful, Next: DIY Make the region preserve text colors plus other styles, Prev: DIY Make inline code in prose use alternative styles, Up: DIY Stylistic variants using palette overrides 2492 2493 7.2.18 DIY Make mail citations and headers more or less colorful 2494 ---------------------------------------------------------------- 2495 2496 This is one of our practical examples to override the semantic colors of 2497 the Modus themes (*note Stylistic variants using palette overrides: DIY 2498 Stylistic variants using palette overrides.). In this section we show 2499 how to change the coloration of email message headers and citations. 2500 Before we show the code, this is the anatomy of a message: 2501 2502 From: Protesilaos <info@protesilaos.com> 2503 To: Modus-Themes Development <~protesilaos/modus-themes@lists.sr.ht> 2504 Subject: Test subject 2505 --- Headers above this line; message and citations below --- 2506 This is some sample text 2507 2508 > > Older quote 2509 > Newer quote 2510 2511 We thus have the following: 2512 2513 ;; Reduce the intensity of mail citations and headers 2514 (setq modus-themes-common-palette-overrides 2515 '((mail-cite-0 cyan-faint) 2516 (mail-cite-1 yellow-faint) 2517 (mail-cite-2 green-faint) 2518 (mail-cite-3 red-faint) 2519 (mail-part olive) 2520 (mail-recipient indigo) 2521 (mail-subject maroon) 2522 (mail-other slate))) 2523 2524 ;; Make mail citations more intense; adjust the headers accordingly 2525 (setq modus-themes-common-palette-overrides 2526 '((mail-cite-0 blue) 2527 (mail-cite-1 yellow) 2528 (mail-cite-2 green) 2529 (mail-cite-3 magenta) 2530 (mail-part magenta-cooler) 2531 (mail-recipient cyan) 2532 (mail-subject red-warmer) 2533 (mail-other cyan-cooler))) 2534 2535 ;; Make all citations faint and neutral; make most headers green but 2536 ;; use red for the subject lie so that it stands out 2537 (setq modus-themes-common-palette-overrides 2538 '((mail-cite-0 fg-dim) 2539 (mail-cite-1 fg-alt) 2540 (mail-cite-2 fg-dim) 2541 (mail-cite-3 fg-alt) 2542 (mail-part yellow-cooler) 2543 (mail-recipient green-cooler) 2544 (mail-subject red-cooler) 2545 (mail-other green))) 2546 2547 Reload the theme for changes to take effect. 2548 2549 2550 File: docv6TKvo.info, Node: DIY Make the region preserve text colors plus other styles, Next: DIY Make mouse highlights more or less colorful, Prev: DIY Make mail citations and headers more or less colorful, Up: DIY Stylistic variants using palette overrides 2551 2552 7.2.19 DIY Make the region preserve text colors, plus other styles 2553 ------------------------------------------------------------------ 2554 2555 This is one of our practical examples to override the semantic colors of 2556 the Modus themes (*note Stylistic variants using palette overrides: DIY 2557 Stylistic variants using palette overrides.). Here we show how to make 2558 the region respect the underlying text colors or how to make the 2559 background more/less intense while combining it with an appropriate 2560 foreground value. 2561 2562 *note Do not extend the region background: DIY Do not extend the 2563 region background. 2564 2565 ;; A background with no specific foreground (use foreground of 2566 ;; underlying text) 2567 (setq modus-themes-common-palette-overrides 2568 '((bg-region bg-ochre) ; try to replace `bg-ochre' with `bg-lavender', `bg-sage' 2569 (fg-region unspecified))) 2570 2571 ;; Subtle gray with a prominent blue foreground 2572 (setq modus-themes-common-palette-overrides 2573 '((bg-region bg-dim) 2574 (fg-region blue-cooler))) 2575 2576 ;; Intense magenta background combined with the main foreground 2577 (setq modus-themes-common-palette-overrides 2578 '((bg-region bg-magenta-intense) 2579 (fg-region fg-main))) 2580 2581 Reload the theme for changes to take effect. 2582 2583 2584 File: docv6TKvo.info, Node: DIY Make mouse highlights more or less colorful, Next: DIY Make language underlines less colorful, Prev: DIY Make the region preserve text colors plus other styles, Up: DIY Stylistic variants using palette overrides 2585 2586 7.2.20 DIY Make mouse highlights more or less colorful 2587 ------------------------------------------------------ 2588 2589 This is one of our practical examples to override the semantic colors of 2590 the Modus themes (*note Stylistic variants using palette overrides: DIY 2591 Stylistic variants using palette overrides.). In the following code 2592 block we show how to affect the semantic color mapping that covers mouse 2593 hover effects and related highlights: 2594 2595 ;; Make the background an intense yellow 2596 (setq modus-themes-common-palette-overrides 2597 '((bg-hover bg-yellow-intense))) 2598 2599 ;; Make the background subtle green 2600 (setq modus-themes-common-palette-overrides 2601 '((bg-hover bg-green-subtle))) 2602 2603 Reload the theme for changes to take effect. 2604 2605 2606 File: docv6TKvo.info, Node: DIY Make language underlines less colorful, Next: DIY Make line numbers use alternative styles, Prev: DIY Make mouse highlights more or less colorful, Up: DIY Stylistic variants using palette overrides 2607 2608 7.2.21 DIY Make language underlines less colorful 2609 ------------------------------------------------- 2610 2611 This is one of our practical examples to override the semantic colors of 2612 the Modus themes (*note Stylistic variants using palette overrides: DIY 2613 Stylistic variants using palette overrides.). Here we show how to 2614 affect the color of the underlines that are used by code linters and 2615 prose spell checkers. 2616 2617 ;; Make the underlines less intense 2618 (setq modus-themes-common-palette-overrides 2619 '((underline-err red-faint) 2620 (underline-warning yellow-faint) 2621 (underline-note cyan-faint))) 2622 2623 ;; Change the color-coding of the underlines 2624 (setq modus-themes-common-palette-overrides 2625 '((underline-err yellow-intense) 2626 (underline-warning magenta-intense) 2627 (underline-note green-intense))) 2628 2629 Reload the theme for changes to take effect. 2630 2631 2632 File: docv6TKvo.info, Node: DIY Make line numbers use alternative styles, Next: DIY Make diffs use only a foreground, Prev: DIY Make language underlines less colorful, Up: DIY Stylistic variants using palette overrides 2633 2634 7.2.22 DIY Make line numbers use alternative styles 2635 --------------------------------------------------- 2636 2637 This is one of our practical examples to override the semantic colors of 2638 the Modus themes (*note Stylistic variants using palette overrides: DIY 2639 Stylistic variants using palette overrides.). In this section we show 2640 how to affect the ‘display-line-numbers-mode’. 2641 2642 ;; Make line numbers less intense 2643 (setq modus-themes-common-palette-overrides 2644 '((fg-line-number-inactive "gray50") 2645 (fg-line-number-active fg-main) 2646 (bg-line-number-inactive unspecified) 2647 (bg-line-number-active unspecified))) 2648 2649 ;; Like the above, but use a shade of red for the current line number 2650 (setq modus-themes-common-palette-overrides 2651 '((fg-line-number-inactive "gray50") 2652 (fg-line-number-active red-cooler) 2653 (bg-line-number-inactive unspecified) 2654 (bg-line-number-active unspecified))) 2655 2656 ;; Make all numbers more intense, use a more pronounce gray 2657 ;; background, and make the current line have a colored background 2658 (setq modus-themes-common-palette-overrides 2659 '((fg-line-number-inactive fg-main) 2660 (fg-line-number-active fg-main) 2661 (bg-line-number-inactive bg-inactive) 2662 (bg-line-number-active bg-cyan-intense))) 2663 2664 Reload the theme for changes to take effect. 2665 2666 2667 File: docv6TKvo.info, Node: DIY Make diffs use only a foreground, Next: DIY Make deuteranopia diffs red and blue instead of yellow and blue, Prev: DIY Make line numbers use alternative styles, Up: DIY Stylistic variants using palette overrides 2668 2669 7.2.23 DIY Make diffs use only a foreground 2670 ------------------------------------------- 2671 2672 This is one of our practical examples to override the semantic colors of 2673 the Modus themes (*note Stylistic variants using palette overrides: DIY 2674 Stylistic variants using palette overrides.). In this section we show 2675 how to change diff buffers (e.g. in ‘magit’) to only use color-coded 2676 text without any added background. What we basically do is to disable 2677 the applicable backgrounds and then intensify the foregrounds. Since 2678 the deuteranopia-optimized themes do not use the red-green color coding, 2679 we make an extra set of adjustments for them by overriding their 2680 palettes directly instead of just using the “common” overrides. 2681 2682 ;; Diffs with only foreground colors. Word-wise ("refined") diffs 2683 ;; have a gray background to draw attention to themselves. 2684 (setq modus-themes-common-palette-overrides 2685 '((bg-added unspecified) 2686 (bg-added-faint unspecified) 2687 (bg-added-refine bg-inactive) 2688 (fg-added green) 2689 (fg-added-intense green-intense) 2690 2691 (bg-changed unspecified) 2692 (bg-changed-faint unspecified) 2693 (bg-changed-refine bg-inactive) 2694 (fg-changed yellow) 2695 (fg-changed-intense yellow-intense) 2696 2697 (bg-removed unspecified) 2698 (bg-removed-faint unspecified) 2699 (bg-removed-refine bg-inactive) 2700 (fg-removed red) 2701 (fg-removed-intense red-intense) 2702 2703 (bg-diff-context unspecified))) 2704 2705 ;; Because deuteranopia cannot use the typical red-yellow-green 2706 ;; combination, we need to arrange for a yellow-purple-blue sequence. 2707 ;; Notice that the above covers the "common" overrides, so we do not 2708 ;; need to reproduce the whole list of them. 2709 (setq modus-operandi-deuteranopia-palette-overrides 2710 '((fg-added blue) 2711 (fg-added-intense blue-intense) 2712 2713 (fg-changed magenta-cooler) 2714 (fg-changed-intense magenta-intense) 2715 2716 (fg-removed yellow-warmer) 2717 (fg-removed-intense yellow-intense))) 2718 2719 (setq modus-vivendi-deuteranopia-palette-overrides 2720 '((fg-added blue) 2721 (fg-added-intense blue-intense) 2722 2723 (fg-changed magenta-cooler) 2724 (fg-changed-intense magenta-intense) 2725 2726 (fg-removed yellow) 2727 (fg-removed-intense yellow-intense))) 2728 2729 Reload the theme for changes to take effect. 2730 2731 2732 File: docv6TKvo.info, Node: DIY Make deuteranopia diffs red and blue instead of yellow and blue, Prev: DIY Make diffs use only a foreground, Up: DIY Stylistic variants using palette overrides 2733 2734 7.2.24 DIY Make deuteranopia diffs red and blue instead of yellow and blue 2735 -------------------------------------------------------------------------- 2736 2737 This is one of our practical examples to override the semantic colors of 2738 the Modus themes (*note Stylistic variants using palette overrides: DIY 2739 Stylistic variants using palette overrides.). In this section we show 2740 how to implement a red+blue color coding for diffs in the themes 2741 ‘modus-operandi-deuteranopia’ and ‘modus-vivendi-deuteranopia’. As 2742 those themes are optimized for users with red-green color deficiency, 2743 they do not use the typical red+green color coding for diffs, defaulting 2744 instead to yellow+blue which are discernible. Users with deuteranomaly 2745 or, generally, those who like a different aesthetic, can use the 2746 following to make diffs use the red+yellow+blue color coding for 2747 removed, changed, and added lines respectively. This is achieved by 2748 overriding the “changed” and “removed” entries to use the colors of 2749 regular ‘modus-operandi’ and ‘modus-vivendi’. 2750 2751 (setq modus-operandi-deuteranopia-palette-overrides 2752 '((bg-changed "#ffdfa9") 2753 (bg-changed-faint "#ffefbf") 2754 (bg-changed-refine "#fac090") 2755 (bg-changed-fringe "#d7c20a") 2756 (fg-changed "#553d00") 2757 (fg-changed-intense "#655000") 2758 2759 (bg-removed "#ffd8d5") 2760 (bg-removed-faint "#ffe9e9") 2761 (bg-removed-refine "#f3b5af") 2762 (bg-removed-fringe "#d84a4f") 2763 (fg-removed "#8f1313") 2764 (fg-removed-intense "#aa2222"))) 2765 2766 (setq modus-vivendi-deuteranopia-palette-overrides 2767 '((bg-changed "#363300") 2768 (bg-changed-faint "#2a1f00") 2769 (bg-changed-refine "#4a4a00") 2770 (bg-changed-fringe "#8a7a00") 2771 (fg-changed "#efef80") 2772 (fg-changed-intense "#c0b05f") 2773 2774 (bg-removed "#4f1119") 2775 (bg-removed-faint "#380a0f") 2776 (bg-removed-refine "#781a1f") 2777 (bg-removed-fringe "#b81a1f") 2778 (fg-removed "#ffbfbf") 2779 (fg-removed-intense "#ff9095"))) 2780 2781 Reload the theme for changes to take effect. 2782 2783 2784 File: docv6TKvo.info, Node: DIY More accurate colors in terminal emulators, Next: DIY Range of color with terminal emulators, Prev: DIY Stylistic variants using palette overrides, Up: Advanced customization 2785 2786 7.3 DIY More accurate colors in terminal emulators 2787 ================================================== 2788 2789 [ This is based on partial information. Please help verify and/or 2790 expand these findings. ] 2791 2792 The graphical version of Emacs can reproduce color values accurately. 2793 Whereas things get more tricky when Emacs is used in a terminal 2794 emulator, because the terminals’ own capabilities determine the number 2795 of colors that may be displayed: the Modus themes don’t look as good in 2796 that case. 2797 2798 There is, however, a way to instruct supported terminal emulators to 2799 use more accurate colors. In a shell prompt type ‘toe -a | grep direct’ 2800 to get a list of relevant terminfo entries. There should be items such 2801 as ‘xterm-direct’, ‘alacritty-direct’, ‘kitty-direct’. Once you find 2802 the one that corresponds to your terminal, call Emacs with an 2803 environment variable like ‘TERM=xterm-direct’. Example that can be 2804 adapted to shell aliases: 2805 2806 TERM=xterm-direct emacsclient -nw 2807 2808 Another example that can be bound to a key: 2809 2810 TERM=xterm-direct uxterm -e emacsclient -nw 2811 2812 2813 File: docv6TKvo.info, Node: DIY Range of color with terminal emulators, Next: DIY Per-theme customization settings, Prev: DIY More accurate colors in terminal emulators, Up: Advanced customization 2814 2815 7.4 DIY Range of color with terminal emulators 2816 ============================================== 2817 2818 [ This is based on partial information. Please help verify and/or 2819 expand these findings. ] 2820 2821 When Emacs runs in a non-windowed session its color reproduction 2822 capacity is framed or determined by the underlying terminal emulator 2823 (*note More accurate colors in terminal emulators: DIY More accurate 2824 colors in terminal emulators.). Emacs cannot produce a color that lies 2825 outside the range of what the terminal’s color palette renders possible. 2826 2827 This is immediately noticeable when the terminal’s first 16 codes do 2828 not include a pure black value for the ‘termcol0’ entry and a pure white 2829 for ‘termcol15’. Emacs cannot set the correct background (white for 2830 ‘modus-operandi’; black for ‘modus-vivendi’) or foreground (inverse of 2831 the background). It thus falls back to the closest approximation, which 2832 seldom is appropriate for the purposes of the Modus themes. 2833 2834 In such a case, the user is expected to update their terminal’s color 2835 palette such as by adapting these resources (*note Preview theme 2836 colors::): 2837 2838 ! Theme: modus-operandi 2839 ! Description: XTerm port of modus-operandi (Modus themes for GNU Emacs) 2840 ! Author: Protesilaos Stavrou, <https://protesilaos.com> 2841 xterm*background: #ffffff 2842 xterm*foreground: #000000 2843 xterm*color0: #000000 2844 xterm*color1: #a60000 2845 xterm*color2: #005e00 2846 xterm*color3: #813e00 2847 xterm*color4: #0031a9 2848 xterm*color5: #721045 2849 xterm*color6: #00538b 2850 xterm*color7: #bfbfbf 2851 xterm*color8: #595959 2852 xterm*color9: #972500 2853 xterm*color10: #315b00 2854 xterm*color11: #70480f 2855 xterm*color12: #2544bb 2856 xterm*color13: #5317ac 2857 xterm*color14: #005a5f 2858 xterm*color15: #ffffff 2859 2860 ! Theme: modus-vivendi 2861 ! Description: XTerm port of modus-vivendi (Modus themes for GNU Emacs) 2862 ! Author: Protesilaos Stavrou, <https://protesilaos.com> 2863 xterm*background: #000000 2864 xterm*foreground: #ffffff 2865 xterm*color0: #000000 2866 xterm*color1: #ff8059 2867 xterm*color2: #44bc44 2868 xterm*color3: #d0bc00 2869 xterm*color4: #2fafff 2870 xterm*color5: #feacd0 2871 xterm*color6: #00d3d0 2872 xterm*color7: #bfbfbf 2873 xterm*color8: #595959 2874 xterm*color9: #ef8b50 2875 xterm*color10: #70b900 2876 xterm*color11: #c0c530 2877 xterm*color12: #79a8ff 2878 xterm*color13: #b6a0ff 2879 xterm*color14: #6ae4b9 2880 xterm*color15: #ffffff 2881 2882 2883 File: docv6TKvo.info, Node: DIY Per-theme customization settings, Next: DIY Do not extend the region background, Prev: DIY Range of color with terminal emulators, Up: Advanced customization 2884 2885 7.5 DIY Per-theme customization settings 2886 ======================================== 2887 2888 If you prefer to maintain different customization options between the 2889 two themes, it is best you write your own functions that first set those 2890 options and then load the relevant theme. The following code does 2891 exactly that by simply differentiating the two themes on the choice of 2892 bold constructs in code syntax (enabled for one, disabled for the 2893 other). 2894 2895 (defun my-demo-modus-operandi () 2896 (interactive) 2897 (setq modus-themes-bold-constructs t) ; ENABLE bold 2898 (modus-themes-load-theme 'modus-operandi)) 2899 2900 (defun my-demo-modus-vivendi () 2901 (interactive) 2902 (setq modus-themes-bold-constructs nil) ; DISABLE bold 2903 (modus-themes-load-theme 'modus-vivendi)) 2904 2905 (defun my-demo-modus-themes-toggle () 2906 (if (eq (car custom-enabled-themes) 'modus-operandi) 2907 (my-demo-modus-vivendi) 2908 (my-demo-modus-operandi))) 2909 2910 Then assign ‘my-demo-modus-themes-toggle’ to a key instead of the 2911 equivalent the themes provide. 2912 2913 For a more elaborate design, it is better to inspect the source code 2914 of ‘modus-themes-toggle’ and relevant functions. 2915 2916 Reload the theme for changes to take effect. 2917 2918 2919 File: docv6TKvo.info, Node: DIY Do not extend the region background, Next: DIY Add padding to the mode line, Prev: DIY Per-theme customization settings, Up: Advanced customization 2920 2921 7.6 DIY Do not extend the region background 2922 =========================================== 2923 2924 By the default, the background of the ‘region’ face extends from the end 2925 of the line to the edge of the window. To limit it to the end of the 2926 line, we need to override the face’s ‘:extend’ attribute. Adding this 2927 to the Emacs configuration file will suffice: 2928 2929 ;; Do not extend `region' background past the end of the line. 2930 (custom-set-faces 2931 '(region ((t :extend nil)))) 2932 2933 *note Make the region preserve text colors, plus other styles: DIY 2934 Make the region preserve text colors plus other styles. 2935 2936 2937 File: docv6TKvo.info, Node: DIY Add padding to the mode line, Next: DIY Remap face with local value, Prev: DIY Do not extend the region background, Up: Advanced customization 2938 2939 7.7 DIY Add padding to the mode line 2940 ==================================== 2941 2942 [ Consider using the ‘spacious-padding’ package from GNU ELPA (by 2943 Protesilaos) for more than just the mode line. ] 2944 2945 Emacs faces do not have a concept of “padding” for the space between 2946 the text and its box boundaries. We can approximate the effect by 2947 adding a ‘:box’ attribute, making its border several pixels thick, and 2948 using the mode line’s background color for it. This way the thick 2949 border will not stand out and will appear as a continuation of the mode 2950 line. 2951 2952 *note Use theme colors in code with modus-themes-with-colors: Use 2953 theme colors in code with modus-themes-with-colors. 2954 2955 (defun my-modus-themes-custom-faces (&rest _) 2956 (modus-themes-with-colors 2957 (custom-set-faces 2958 ;; Add "padding" to the mode lines 2959 `(mode-line ((,c :box (:line-width 10 :color ,bg-mode-line-active)))) 2960 `(mode-line-inactive ((,c :box (:line-width 10 :color ,bg-mode-line-inactive))))))) 2961 2962 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) 2963 2964 *note Using a hook at the post-load-theme phase: DIY Use a hook at 2965 the post-load-theme phase. 2966 2967 The above has the effect of removing the border around the mode 2968 lines. In older versions of the themes, we provided the option for a 2969 padded mode line which could also have borders around it. Those were 2970 not real border, however, but an underline and an overline. Adjusting 2971 the above: 2972 2973 (defun my-modus-themes-custom-faces (&rest _) 2974 (modus-themes-with-colors 2975 (custom-set-faces 2976 ;; Add "padding" to the mode lines 2977 `(mode-line ((,c :underline ,border-mode-line-active 2978 :overline ,border-mode-line-active 2979 :box (:line-width 10 :color ,bg-mode-line-active)))) 2980 `(mode-line-inactive ((,c :underline ,border-mode-line-inactive 2981 :overline ,border-mode-line-inactive 2982 :box (:line-width 10 :color ,bg-mode-line-inactive))))))) 2983 2984 ;; ESSENTIAL to make the underline move to the bottom of the box: 2985 (setq x-underline-at-descent-line t) 2986 2987 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) 2988 2989 The reason we no longer provide this option is because it depends on 2990 a non-‘nil’ value for ‘x-underline-at-descent-line’. That variable 2991 affects ALL underlines, including those of links. The effect is 2992 intrusive and looks awkard in prose. 2993 2994 As such, the Modus themes no longer provide that option but instead 2995 offer this piece of documentation to make the user fully aware of the 2996 state of affairs. 2997 2998 Reload the theme for changes to take effect. 2999 3000 3001 File: docv6TKvo.info, Node: DIY Remap face with local value, Next: DIY Font configurations for Org and others, Prev: DIY Add padding to the mode line, Up: Advanced customization 3002 3003 7.8 DIY Remap face with local value 3004 =================================== 3005 3006 There are cases where we need to change the buffer-local attributes of a 3007 face. This might be because we have our own minor mode that re-uses a 3008 face for a particular purpose, such as a line selection tool that 3009 activates ‘hl-line-mode’, but we wish to keep it distinct from other 3010 buffers. This is where ‘face-remap-add-relative’ can be applied and may 3011 be combined with ‘modus-themes-with-colors’ to deliver consistent 3012 results. 3013 3014 *note Use theme colors in code with modus-themes-with-colors: Use 3015 theme colors in code with modus-themes-with-colors. 3016 3017 In this example we will write a simple interactive function that 3018 adjusts the background color of the ‘region’ face. This is the sample 3019 code: 3020 3021 (defvar my-rainbow-region-colors 3022 (modus-themes-with-colors 3023 `((red . ,bg-red-subtle) 3024 (green . ,bg-green-subtle) 3025 (yellow . ,bg-yellow-subtle) 3026 (blue . ,bg-blue-subtle) 3027 (magenta . ,bg-magenta-subtle) 3028 (cyan . ,bg-cyan-subtle))) 3029 "Sample list of color values for `my-rainbow-region'.") 3030 3031 (defun my-rainbow-region (color) 3032 "Remap buffer-local attribute of `region' using COLOR." 3033 (interactive 3034 (list 3035 (completing-read "Pick a color: " my-rainbow-region-colors))) 3036 (face-remap-add-relative 3037 'region 3038 `( :background ,(alist-get (intern color) my-rainbow-region-colors) 3039 :foreground ,(face-attribute 'default :foreground)))) 3040 3041 When ‘my-rainbow-region’ is called interactively, it prompts for a 3042 color to use. The list of candidates is drawn from the car of each 3043 association in ‘my-rainbow-region-colors’ (so “red”, “green”, etc.). 3044 3045 To extend this principle, we may write wrapper functions that pass a 3046 color directly. Those can be useful in tandem with hooks. Consider 3047 this example: 3048 3049 (defun my-rainbow-region-magenta () 3050 (my-rainbow-region 'magenta)) 3051 3052 (add-hook 'diff-mode-hook #'my-rainbow-region-magenta) 3053 3054 Whenever we enter a ‘diff-mode’ buffer, we now get a magenta-colored 3055 region. 3056 3057 Perhaps you may wish to generalize those findings in to a set of 3058 functions that also accept an arbitrary face. We shall leave the 3059 experimentation up to you. 3060 3061 Reload the theme for changes to take effect. 3062 3063 3064 File: docv6TKvo.info, Node: DIY Font configurations for Org and others, Next: DIY Configure bold and italic faces, Prev: DIY Remap face with local value, Up: Advanced customization 3065 3066 7.9 DIY Font configurations for Org and others 3067 ============================================== 3068 3069 [ Consider using the ‘fontaine’ package from GNU ELPA (by Protesilaos) 3070 for all font-related configurations. ] 3071 3072 The themes are designed to optionally cope well with mixed font 3073 configurations. This mostly concerns ‘org-mode’ and ‘markdown-mode’, 3074 though expect to find it elsewhere like in ‘Info-mode’. 3075 3076 *note Option for font mixing: Mixed fonts. 3077 3078 In practice it means that the user can safely opt for a more 3079 prose-friendly proportionately spaced typeface as their default, while 3080 spacing-sensitive elements like tables and inline code always use a 3081 monospaced font, by inheriting from the ‘fixed-pitch’ face. 3082 3083 Users can try the built-in ‘M-x variable-pitch-mode’ to see the 3084 effect in action. 3085 3086 To make everything use your desired font families, you need to 3087 configure the ‘variable-pitch’ (proportional spacing) and ‘fixed-pitch’ 3088 (monospaced) faces respectively. It may also be convenient to set your 3089 main typeface by configuring the ‘default’ face the same way. 3090 3091 Put something like this in your initialization file (also consider 3092 reading the doc string of ‘set-face-attribute’): 3093 3094 ;; Main typeface 3095 (set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 110) 3096 3097 ;; Proportionately spaced typeface 3098 (set-face-attribute 'variable-pitch nil :family "DejaVu Serif" :height 1.0) 3099 3100 ;; Monospaced typeface 3101 (set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.5) 3102 3103 Or employ the ‘face-attribute’ function to read an existing value, 3104 such as if you want to make ‘fixed-pitch’ use the font family of the 3105 ‘default’ face: 3106 3107 (set-face-attribute 'fixed-pitch nil :family (face-attribute 'default :family)) 3108 3109 The next section shows how to make those work in a more elaborate 3110 setup that is robust to changes between the Modus themes. 3111 3112 *note Configure bold and italic faces: DIY Configure bold and italic 3113 faces. 3114 3115 Note the differences in the ‘:height’ property. The ‘default’ face 3116 must specify an absolute value, which is the point size × 10. So if you 3117 want to use a font at point size ‘11’, you set the height to ‘110’.(1) 3118 Whereas every other face must either not specify a height or have a 3119 value that is relative to the default, represented as a floating point. 3120 If you use an integer, then that means an absolute height. This is of 3121 paramount importance: it ensures that all fonts can scale gracefully 3122 when using something like the ‘text-scale-adjust’ command which only 3123 operates on the base font size (i.e. the ‘default’ face’s absolute 3124 height). 3125 3126 *note Note for EWW and Elfeed fonts: Note on SHR fonts. 3127 3128 ---------- Footnotes ---------- 3129 3130 (1) ‘:height’ values do not need to be rounded to multiples of ten: 3131 the likes of ‘115’ are perfectly valid—some typefaces will change to 3132 account for those finer increments. 3133 3134 3135 File: docv6TKvo.info, Node: DIY Configure bold and italic faces, Next: DIY Custom Org todo keyword and priority faces, Prev: DIY Font configurations for Org and others, Up: Advanced customization 3136 3137 7.10 DIY Configure bold and italic faces 3138 ======================================== 3139 3140 [ Consider using the ‘fontaine’ package from GNU ELPA (by Protesilaos) 3141 for all font-related configurations. ] 3142 3143 The Modus themes do not hardcode a ‘:weight’ or ‘:slant’ attribute in 3144 the thousands of faces they cover. Instead, they configure the generic 3145 faces called ‘bold’ and ‘italic’ to use the appropriate styles and then 3146 instruct all relevant faces that require emphasis to inherit from them. 3147 3148 This practically means that users can change the particularities of 3149 what it means for a construct to be bold/italic, by tweaking the ‘bold’ 3150 and ‘italic’ faces. Cases where that can be useful include: 3151 3152 • The default typeface does not have a variant with slanted glyphs 3153 (e.g. Fira Mono/Code as of this writing on 2021-07-07), so the 3154 user wants to add another family for the italics, such as Hack. 3155 3156 • The typeface of choice provides a multitude of weights and the user 3157 prefers the light one by default. To prevent the bold weight from 3158 being too heavy compared to the light one, they opt to make ‘bold’ 3159 use a semibold weight. 3160 3161 • The typeface distinguishes between oblique and italic forms by 3162 providing different font variants (the former are just slanted 3163 versions of the upright forms, while the latter have distinguishing 3164 features as well). In this case, the user wants to specify the 3165 font that applies to the ‘italic’ face. 3166 3167 To achieve those effects, one must first be sure that the fonts they 3168 use have support for those features. It then is a matter of following 3169 the instructions for all typeface tweaks. 3170 3171 *note Font configurations for Org and others: DIY Font configurations 3172 for Org and others. 3173 3174 In this example, we set the default font family to Fira Code, while 3175 we choose to render italics in the Hack typeface (obviously you need to 3176 pick fonts that work well together): 3177 3178 (set-face-attribute 'default nil :family "Fira Code" :height 110) 3179 (set-face-attribute 'italic nil :family "Hack") 3180 3181 And here we play with different weights, using Source Code Pro: 3182 3183 (set-face-attribute 'default nil :family "Source Code Pro" :height 110 :weight 'light) 3184 (set-face-attribute 'bold nil :weight 'semibold) 3185 3186 To reset the font family, one can use this: 3187 3188 (set-face-attribute 'italic nil :family 'unspecified) 3189 3190 To ensure that the effects persist after switching between the Modus 3191 themes (such as with ‘M-x modus-themes-toggle’), the user needs to write 3192 their configurations to a function and pass it to the 3193 ‘modus-themes-after-load-theme-hook’ (*note Enable and load::). This is 3194 necessary because themes set the styles of faces upon activation, 3195 overriding prior values where conflicts occur between the previous and 3196 the current states (otherwise changing themes would not be possible). 3197 3198 *note A theme-agnostic hook for theme loading: DIY A theme-agnostic 3199 hook for theme loading. 3200 3201 This is a minimal setup to preserve font configurations across theme 3202 load phases. For a more permanent setup, it is better to rely on the 3203 ‘custom-set-faces’ function: ‘set-face-attribute’ works just fine, 3204 though it probably is better suited for quick previews or for smaller 3205 scale operations (‘custom-set-faces’ follows the format used in the 3206 source code of the themes, which can make it easier to redefine faces in 3207 bulk). 3208 3209 ;; our generic function 3210 (defun my-modes-themes-bold-italic-faces (&rest _) 3211 (set-face-attribute 'default nil :family "Source Code Pro" :height 110) 3212 (set-face-attribute 'bold nil :weight 'semibold)) 3213 3214 ;; or use this if you configure a lot of face and attributes and 3215 ;; especially if you plan to use `modus-themes-with-colors', as shown 3216 ;; elsewhere in the manual 3217 (defun my-modes-themes-bold-italic-faces (&rest _) 3218 (custom-set-faces 3219 '(default ((t :family "Source Code Pro" :height 110))) 3220 '(bold ((t :weight semibold))))) 3221 3222 ;; and here is the hook 3223 (add-hook 'modus-themes-after-load-theme-hook #'my-modes-themes-bold-italic-faces) 3224 3225 *note Use theme colors in code with modus-themes-with-colors: Use 3226 theme colors in code with modus-themes-with-colors. 3227 3228 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3229 the post-load-theme phase. 3230 3231 Reload the theme for changes to take effect. 3232 3233 3234 File: docv6TKvo.info, Node: DIY Custom Org todo keyword and priority faces, Next: DIY Custom Org emphasis faces, Prev: DIY Configure bold and italic faces, Up: Advanced customization 3235 3236 7.11 DIY Custom Org todo keyword and priority faces 3237 =================================================== 3238 3239 Users of ‘org-mode’ have the option to configure various keywords and 3240 priority cookies to better match their workflow. User options are 3241 ‘org-todo-keyword-faces’ and ‘org-priority-faces’. 3242 3243 As those are meant to be custom faces, it is futile to have the 3244 themes guess what each user wants to use, which keywords to target, and 3245 so on. Instead, we can provide guidelines on how to customize things to 3246 one’s liking with the intent of retaining the overall aesthetic of the 3247 themes. 3248 3249 Please bear in mind that the end result of those is not controlled by 3250 the active Modus theme but by how Org maps faces to its constructs. 3251 Editing those while ‘org-mode’ is active requires re-initialization of 3252 the mode with ‘M-x org-mode-restart’ for changes to take effect. 3253 3254 Let us assume you wish to visually differentiate your keywords. You 3255 have something like this: 3256 3257 (setq org-todo-keywords 3258 '((sequence "TODO(t)" "|" "DONE(D)" "CANCEL(C)") 3259 (sequence "MEET(m)" "|" "MET(M)") 3260 (sequence "STUDY(s)" "|" "STUDIED(S)") 3261 (sequence "WRITE(w)" "|" "WROTE(W)"))) 3262 3263 You could then use a variant of the following to inherit from a face 3264 that uses the styles you want and also to preserve the attributes 3265 applied by the ‘org-todo’ face (in case there is a difference between 3266 the two): 3267 3268 (setq org-todo-keyword-faces 3269 '(("MEET" . (:inherit (bold org-todo))) 3270 ("STUDY" . (:inherit (warning org-todo))) 3271 ("WRITE" . (:inherit (shadow org-todo))))) 3272 3273 This will refashion the keywords you specify, while letting the other 3274 items in ‘org-todo-keywords’ use their original styles, which are 3275 defined in the ‘org-todo’ and ‘org-done’ faces. 3276 3277 If you want back the defaults, try specifying just the ‘org-todo’ 3278 face: 3279 3280 (setq org-todo-keyword-faces 3281 '(("MEET" . org-todo) 3282 ("STUDY" . org-todo) 3283 ("WRITE" . org-todo))) 3284 3285 Or set ‘org-todo-keyword-faces’ to ‘nil’. 3286 3287 When you inherit from multiple faces, you need to do it the way it is 3288 shown further above. The order is significant: the first entry is 3289 applied on top of the second, overriding any attributes that are 3290 explicitly set for both of them: any attribute that is not specified is 3291 not overridden, so, for example, if ‘org-todo’ has a background and a 3292 foreground, while ‘font-lock-type-face’ only has a foreground, the 3293 merged face will include the background of the former and the foreground 3294 of the latter. If you do not want to blend multiple faces, you only 3295 specify one by name without parentheses or an ‘:inherit’ keyword. A 3296 pattern of ‘keyword . face’ will suffice. 3297 3298 Both approaches can be used simultaneously, as illustrated in this 3299 configuration of the priority cookies: 3300 3301 (setq org-priority-faces 3302 '((?A . (:inherit (bold org-priority))) 3303 (?B . org-priority) 3304 (?C . (:inherit (shadow org-priority))))) 3305 3306 To find all the faces that are loaded in your current Emacs session, 3307 use ‘M-x list-faces-display’. Try ‘M-x describe-variable’ as well and 3308 then specify the name of each of those Org variables demonstrated above. 3309 Their documentation strings will offer you further guidance. 3310 3311 Recall that the themes let you retrieve a color from their palette. 3312 Do it if you plan to control face attributes. 3313 3314 *note Check color combinations: DIY Measure color contrast. 3315 3316 3317 File: docv6TKvo.info, Node: DIY Custom Org emphasis faces, Next: DIY Use colored Org source blocks per language, Prev: DIY Custom Org todo keyword and priority faces, Up: Advanced customization 3318 3319 7.12 DIY Custom Org emphasis faces 3320 ================================== 3321 3322 Org provides the user option ‘org-emphasis-alist’ which associates a 3323 character with a face, list of faces, or face attributes. The default 3324 specification of that variable looks like this: 3325 3326 (setq org-emphasis-alist 3327 '(("*" bold) 3328 ("/" italic) 3329 ("_" underline) 3330 ("=" org-verbatim verbatim) 3331 ("~" org-code verbatim) 3332 ("+" (:strike-through t)))) 3333 3334 With the exception of ‘org-verbatim’ and ‘org-code’ faces, everything 3335 else uses the corresponding type of emphasis: a bold typographic weight, 3336 or italicised, underlined, and struck through text. 3337 3338 The best way for users to add some extra attributes, such as a 3339 foreground color, is to define their own faces and assign them to the 3340 given emphasis marker/character. 3341 3342 This is a custom face that extends the standard ‘bold’ face with a 3343 red foreground value (so it colorises the text in addition to the bold 3344 weight): 3345 3346 (defface my-org-emphasis-bold 3347 '((default :inherit bold) 3348 (((class color) (min-colors 88) (background light)) 3349 :foreground "#a60000") 3350 (((class color) (min-colors 88) (background dark)) 3351 :foreground "#ff8059")) 3352 "My bold emphasis for Org.") 3353 3354 This face definition reads as follows: 3355 3356 • Always inherit the ‘bold’ face (*note Configure bold and italic 3357 faces: DIY Configure bold and italic faces.). 3358 • For versions of Emacs that support at least 88 colors (graphical 3359 Emacs, for example) and use a light background, apply the ‘#a60000’ 3360 value. 3361 • For the same kind of Emacs that has a dark background use the 3362 ‘#ff8059’ color instead. 3363 3364 Same principle for how to extend ‘italic’ and ‘underline’ with, for 3365 example, green and yellow hues, respectively: 3366 3367 (defface my-org-emphasis-italic 3368 '((default :inherit italic) 3369 (((class color) (min-colors 88) (background light)) 3370 :foreground "#005e00") 3371 (((class color) (min-colors 88) (background dark)) 3372 :foreground "#44bc44")) 3373 "My italic emphasis for Org.") 3374 3375 (defface my-org-emphasis-underline 3376 '((default :inherit underline) 3377 (((class color) (min-colors 88) (background light)) 3378 :foreground "#813e00") 3379 (((class color) (min-colors 88) (background dark)) 3380 :foreground "#d0bc00")) 3381 "My underline emphasis for Org.") 3382 3383 In the case of a strike-through effect, we have no generic face to 3384 inherit from, so we can write it as follows to also change the 3385 foreground to a more subtle gray: 3386 3387 (defface my-org-emphasis-strike-through 3388 '((default :strike-through t) 3389 (((class color) (min-colors 88) (background light)) 3390 :foreground "#505050") 3391 (((class color) (min-colors 88) (background dark)) 3392 :foreground "#a8a8a8")) 3393 "My strike-through emphasis for Org.") 3394 3395 Or we can just change the color of the line that strikes through the 3396 text to, for example, a shade of red: 3397 3398 (defface my-org-emphasis-strike-through 3399 '((((class color) (min-colors 88) (background light)) 3400 :strike-through "#972500") 3401 (((class color) (min-colors 88) (background dark)) 3402 :strike-through "#ef8b50")) 3403 "My strike-through emphasis for Org.") 3404 3405 It is possible to combine those effects: 3406 3407 (defface my-org-emphasis-strike-through 3408 '((((class color) (min-colors 88) (background light)) 3409 :strike-through "#972500" :foreground "#505050") 3410 (((class color) (min-colors 88) (background dark)) 3411 :strike-through "#ef8b50" :foreground "#a8a8a8")) 3412 "My strike-through emphasis for Org.") 3413 3414 One may inspect the variables ‘modus-themes-operandi-colors’ and 3415 ‘modus-themes-vivendi-colors’ for possible color values. Or call the 3416 command ‘modus-themes-list-colors’ to show a buffer that previews each 3417 entry in the palette. 3418 3419 *note Visualize the active Modus theme’s palette: Preview theme 3420 colors. 3421 3422 Once we have defined the faces we need, we must update the 3423 ‘org-emphasis-alist’. Given that ‘org-verbatim’ and ‘org-code’ are 3424 already styled by the themes, it probably is best not to edit them: 3425 3426 (setq org-emphasis-alist 3427 '(("*" my-org-emphasis-bold) 3428 ("/" my-org-emphasis-italic) 3429 ("_" my-org-emphasis-underline) 3430 ("=" org-verbatim verbatim) 3431 ("~" org-code verbatim) 3432 ("+" my-org-emphasis-strike-through))) 3433 3434 That’s it! For changes to take effect in already visited Org files, 3435 invoke ‘M-x org-mode-restart’. 3436 3437 3438 File: docv6TKvo.info, Node: DIY Use colored Org source blocks per language, Next: DIY Measure color contrast, Prev: DIY Custom Org emphasis faces, Up: Advanced customization 3439 3440 7.13 DIY Use colored Org source blocks per language 3441 =================================================== 3442 3443 *note DIY Make Org block colors more or less colorful::. 3444 3445 In versions of the Modus themes before ‘4.4.0’ there was an option to 3446 change the coloration of Org source blocks so that certain languages 3447 would have a distinctly colored background. This was not flexible 3448 enough, because (i) we cannot cover all languages effectively and (ii) 3449 the user had no choice over the ‘language --> color’ mapping. 3450 3451 As such, the old user option is no more. Users can use the following 3452 to achieve what they want: 3453 3454 [ All this is done by setting the Org user option 3455 ‘org-src-block-faces’, so it is not related to the palette overrides 3456 mechanism provided by the Modus themes. ] 3457 3458 (defun my-modus-themes-org-block-faces (&rest _) 3459 (modus-themes-with-colors 3460 ;; The `org-src-block-faces' does not get re-applied in existing 3461 ;; Org buffers. Do M-x org-mode-restart for changes to take 3462 ;; effect. 3463 (setq org-src-block-faces 3464 `(("emacs-lisp" modus-themes-nuanced-magenta) 3465 ("elisp" modus-themes-nuanced-magenta) 3466 ("clojure" modus-themes-nuanced-magenta) 3467 ("clojurescript" modus-themes-nuanced-magenta) 3468 ("c" modus-themes-nuanced-blue) 3469 ("c++" modus-themes-nuanced-blue) 3470 ("sh" modus-themes-nuanced-yellow) 3471 ("shell" modus-themes-nuanced-yellow) 3472 ("python" modus-themes-nuanced-yellow) 3473 ("ipython" modus-themes-nuanced-yellow) 3474 ("r" modus-themes-nuanced-yellow) 3475 ("html" modus-themes-nuanced-green) 3476 ("xml" modus-themes-nuanced-green) 3477 ("css" modus-themes-nuanced-red) 3478 ("scss" modus-themes-nuanced-red) 3479 ("yaml" modus-themes-nuanced-cyan) 3480 ("conf" modus-themes-nuanced-cyan) 3481 ("docker" modus-themes-nuanced-cyan))))) 3482 3483 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-org-block-faces) 3484 3485 *note DIY Use a hook at the post-load-theme phase::. 3486 3487 Note that the ‘org-src-block-faces’ accepts a named face, as shown 3488 above, as well as a list of face attributes. The latter approach is not 3489 good enough because it hardcodes values in such a way that an 3490 ‘org-mode-restart’ is necessary. Whereas the indirection of the named 3491 face lets the theme change the values while Org buffers continue to show 3492 the right colors. 3493 3494 Still, if a user prefers to hardcode face attributes, here is the 3495 idea: 3496 3497 ;; This is for the sake of completeness. I DO NOT RECOMMEND THIS 3498 ;; method because it hardcodes values and thus requires 3499 ;; `org-mode-restart' every time you change a theme. 3500 (defun my-modus-themes-org-block-faces (&rest _) 3501 (modus-themes-with-colors 3502 (setq org-src-block-faces 3503 `(("emacs-lisp" (:inherit org-block :background ,bg-magenta-nuanced)) 3504 ("elisp" (:inherit org-block :background ,bg-magenta-nuanced)) 3505 ("clojure" (:inherit org-block :background ,bg-magenta-nuanced)) 3506 ("clojurescript" (:inherit org-block :background ,bg-magenta-nuanced)) 3507 ("c" (:inherit org-block :background ,bg-blue-nuanced)) 3508 ("c++" (:inherit org-block :background ,bg-blue-nuanced)) 3509 ("sh" (:inherit org-block :background ,bg-yellow-nuanced)) 3510 ("shell" (:inherit org-block :background ,bg-yellow-nuanced)) 3511 ("python" (:inherit org-block :background ,bg-yellow-nuanced)) 3512 ("ipython" (:inherit org-block :background ,bg-yellow-nuanced)) 3513 ("r" (:inherit org-block :background ,bg-yellow-nuanced)) 3514 ("html" (:inherit org-block :background ,bg-green-nuanced)) 3515 ("xml" (:inherit org-block :background ,bg-green-nuanced)) 3516 ("css" (:inherit org-block :background ,bg-red-nuanced)) 3517 ("scss" (:inherit org-block :background ,bg-red-nuanced)) 3518 ("yaml" (:inherit org-block :background ,bg-cyan-nuanced)) 3519 ("conf" (:inherit org-block :background ,bg-cyan-nuanced)) 3520 ("docker" (:inherit org-block :background ,bg-cyan-nuanced)))))) 3521 3522 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-org-block-faces) 3523 3524 3525 File: docv6TKvo.info, Node: DIY Measure color contrast, Next: DIY Load theme depending on time of day, Prev: DIY Use colored Org source blocks per language, Up: Advanced customization 3526 3527 7.14 DIY Measure color contrast 3528 =============================== 3529 3530 The themes provide the functions ‘modus-themes-wcag-formula’ and 3531 ‘modus-themes-contrast’. The former is a direct implementation of the 3532 WCAG formula: <https://www.w3.org/TR/WCAG20-TECHS/G18.html>. It 3533 calculates the relative luminance of a color value that is expressed in 3534 hexadecimal RGB notation. While the latter function is just a 3535 convenient wrapper for comparing the relative luminance between two 3536 colors. 3537 3538 In practice, one needs to work only with ‘modus-themes-contrast’. It 3539 accepts two color values and returns their contrast ratio. Values range 3540 from 1 to 21 (lowest to highest). The themes are designed to always be 3541 equal or higher than 7 for each combination of background and foreground 3542 that they use (this is the WCAG AAA standard—the most demanding of its 3543 kind). 3544 3545 A couple of examples (rounded numbers): 3546 3547 ;; Pure white with pure green 3548 (modus-themes-contrast "#ffffff" "#00ff00") 3549 ;; => 1.37 3550 ;; That is an outright inaccessible combo 3551 3552 ;; Pure black with pure green 3553 (modus-themes-contrast "#000000" "#00ff00") 3554 ;; => 15.3 3555 ;; That is a highly accessible combo 3556 3557 It does not matter which color value comes first. The ratio is 3558 always the same. 3559 3560 If one does not wish to read all the decimal points, it is possible 3561 to try something like this: 3562 3563 (format "%0.2f" (modus-themes-contrast "#000000" "#00ff00")) 3564 3565 While it is fine to perform such calculations on a case-by-case 3566 basis, it is preferable to implement formulas and tables for more 3567 demanding tasks. Such instruments are provided by ‘org-mode’ or 3568 ‘orgtbl-mode’, both of which are built into Emacs. Below is such a 3569 table that derives the contrast ratio of all colors in the first column 3570 (pure red, green, blue) relative to the color specified in the first row 3571 of the second column (pure white) and rounds the results: 3572 3573 | | #ffffff | 3574 |---------+---------| 3575 | #ff0000 | 4.00 | 3576 | #00ff00 | 1.37 | 3577 | #0000ff | 8.59 | 3578 #+tblfm: $2='(modus-themes-contrast $1 @1$2);%0.2f 3579 3580 To measure color contrast one needs to start from a known value. 3581 This typically is the background. The Modus themes define an expanded 3582 palette in large part because certain colors are only meant to be used 3583 in combination with some others. Consult the source code for the 3584 minutia and relevant commentary. 3585 3586 Such knowledge may prove valuable while attempting to customize the 3587 theme’s color palette. 3588 3589 3590 File: docv6TKvo.info, Node: DIY Load theme depending on time of day, Next: DIY Backdrop for pdf-tools, Prev: DIY Measure color contrast, Up: Advanced customization 3591 3592 7.15 DIY Load theme depending on time of day 3593 ============================================ 3594 3595 While we do provide ‘modus-themes-toggle’ to manually switch between the 3596 themes, users may also set up their system to perform such a task 3597 automatically at sunrise and sunset. 3598 3599 This can be accomplished by specifying the coordinates of one’s 3600 location using the built-in ‘solar.el’ and then configuring the 3601 ‘circadian’ package: 3602 3603 (use-package solar ; built-in 3604 :config 3605 (setq calendar-latitude 35.17 3606 calendar-longitude 33.36)) 3607 3608 (use-package circadian ; you need to install this 3609 :ensure t 3610 :after solar 3611 :config 3612 (setq circadian-themes '((:sunrise . modus-operandi) 3613 (:sunset . modus-vivendi))) 3614 (circadian-setup)) 3615 3616 3617 File: docv6TKvo.info, Node: DIY Backdrop for pdf-tools, Next: DIY Toggle themes without reloading them, Prev: DIY Load theme depending on time of day, Up: Advanced customization 3618 3619 7.16 DIY Backdrop for pdf-tools 3620 =============================== 3621 3622 Most PDF files use a white background for their page, making it 3623 impossible to discern the file’s boundaries in the buffer while using 3624 the Modus Operandi theme. To introduce a distinction between the 3625 buffer’s backdrop and the PDF page’s background, the former must be 3626 rendered as some shade of gray. Ideally, ‘pdf-tools’ would provide a 3627 face that the themes could support directly, though this does not seem 3628 to be the case for the time being. We must thus employ the face 3629 remapping technique that is documented elsewhere in this document to 3630 change the buffer-local value of the ‘default’ face. 3631 3632 *note Remap face with local value: DIY Remap face with local value. 3633 3634 To remap the buffer’s backdrop, we start with a function like this 3635 one: 3636 3637 (defun my-pdf-tools-backdrop (&rest _) 3638 (modus-themes-with-colors 3639 (face-remap-add-relative 3640 'default 3641 `(:background ,bg-dim)))) 3642 3643 (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-backdrop) 3644 3645 The idea is to assign that function to a hook that gets called when 3646 ‘pdf-tools’ renders the document: ‘pdf-tools-enabled-hook’. This is 3647 enough when you only use one theme. However it has the downside of 3648 setting the background color value only at render time. In other words, 3649 the face remapping function does not get evaluated anew whenever the 3650 theme changes, such as upon invoking ‘M-x modus-themes-toggle’ (*note 3651 Option for which themes to toggle::). 3652 3653 To have our face remapping adapt gracefully while switching between 3654 the Modus themes, we need to also account for the current theme and 3655 control the activation of ‘pdf-view-midnight-minor-mode’. To which end 3656 we arrive at something like the following, which builds on the above 3657 example: 3658 3659 (defun my-pdf-tools-backdrop (&rest _) 3660 (modus-themes-with-colors 3661 (face-remap-add-relative 3662 'default 3663 `(:background ,bg-dim)))) 3664 3665 (defun my-pdf-tools-midnight-mode-toggle (&rest _) 3666 (when (derived-mode-p 'pdf-view-mode) 3667 (if (eq (car custom-enabled-themes) 'modus-vivendi) 3668 (pdf-view-midnight-minor-mode 1) 3669 (pdf-view-midnight-minor-mode -1)) 3670 (my-pdf-tools-backdrop))) 3671 3672 (defun my-pdf-tools-themes-toggle (&rest _) 3673 (mapc 3674 (lambda (buf) 3675 (with-current-buffer buf 3676 (my-pdf-tools-midnight-mode-toggle))) 3677 (buffer-list))) 3678 3679 (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-midnight-mode-toggle) 3680 (add-hook 'modus-themes-after-load-theme-hook #'my-pdf-tools-themes-toggle) 3681 3682 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3683 the post-load-theme phase. 3684 3685 With those in place, PDFs have a distinct backdrop for their page, 3686 while buffers with major-mode as ‘pdf-view-mode’ automatically switches 3687 to dark mode when ‘modus-themes-toggle’ is called. 3688 3689 Reload the theme for changes to take effect. 3690 3691 3692 File: docv6TKvo.info, Node: DIY Toggle themes without reloading them, Next: DIY Use more spacious margins or padding in Emacs frames, Prev: DIY Backdrop for pdf-tools, Up: Advanced customization 3693 3694 7.17 DIY Toggle themes without reloading them 3695 ============================================= 3696 3697 Users who have a stable setup and who only ever need to toggle between 3698 the themes without triggering a full reload, are better off defining 3699 their own command which calls ‘enable-theme’ instead of ‘load-theme’: 3700 3701 (defun my-modus-themes-toggle () 3702 "Toggle between `modus-operandi' and `modus-vivendi' themes. 3703 This uses `enable-theme' instead of the standard method of 3704 `load-theme'. The technicalities are covered in the Modus themes 3705 manual." 3706 (interactive) 3707 (pcase (modus-themes--current-theme) 3708 ('modus-operandi (progn (enable-theme 'modus-vivendi) 3709 (disable-theme 'modus-operandi))) 3710 ('modus-vivendi (progn (enable-theme 'modus-operandi) 3711 (disable-theme 'modus-vivendi))) 3712 (_ (error "No Modus theme is loaded; evaluate `modus-themes-load-themes' first")))) 3713 3714 *note Differences between loading and enabling::. 3715 3716 Recall that ‘modus-themes-toggle’ uses ‘load-theme’. 3717 3718 3719 File: docv6TKvo.info, Node: DIY Use more spacious margins or padding in Emacs frames, Next: DIY Custom hl-todo colors, Prev: DIY Toggle themes without reloading them, Up: Advanced customization 3720 3721 7.18 DIY Use more spacious margins or padding in Emacs frames 3722 ============================================================= 3723 3724 [ UPDATE 2023-06-25: Instead of following these instructions, you can 3725 simply install my ‘spacious-padding’ package from GNU ELPA. It 3726 implements the padding and provides relevant user options. ] 3727 3728 By default, Emacs frames try to maximize the number of characters 3729 that fit in the current visible portion of the buffer. Users may prefer 3730 to have some extra padding instead. This can make Emacs frames look 3731 more pleasant, but also make it easier to identify the currently active 3732 window. 3733 3734 The way to implement such padding is two-fold: 3735 3736 1. In the ‘early-init.el’ file instruct Emacs to use a higher value 3737 for the ‘internal-border-width’ of all frames, as well as for the 3738 ‘right-divider-width’. The former concerns the outer boundaries of 3739 Emacs frames, while the latter pertains to dividers between Emacs 3740 windows. 3741 3742 2. Make the relevant faces invisible by changing the value of their 3743 relevant attributes to that of the current theme’s main background. 3744 3745 The parameters of Emacs frames are specified in the variables 3746 ‘initial-frame-alist’ and ‘default-frame-alist’. The “initial frame” 3747 refers to the first frame that appears on Emacs startup. The “default” 3748 refers to the fallback values that apply to all other frames that Emacs 3749 creates (unless those are explicitly overridden by a bespoke 3750 ‘make-frame’ call). 3751 3752 In detail, first we use the same values for the two frame alist 3753 variables: 3754 3755 ;; This must go in the early-init.el so that it applies to the initial 3756 ;; frame. 3757 (dolist (var '(default-frame-alist initial-frame-alist)) 3758 (add-to-list var '(right-divider-width . 20)) 3759 (add-to-list var '(internal-border-width . 20))) 3760 3761 What the ‘dolist’ does is to call ‘add-to-list’ for the two variables 3762 we specify there. This economizes on typing. 3763 3764 Then we define a function that makes the relevant faces invisible. 3765 The reason we do this with a function is so we can hook it to the “post 3766 load” phase of a theme, thus applying the new background value 3767 (otherwise you keep the old background, which likely means that the 3768 faces will no longer be invisible). 3769 3770 (defun my-modus-themes-invisible-dividers (&rest _) 3771 "Make window dividers invisible. 3772 Add this to the `modus-themes-post-load-hook'." 3773 (let ((bg (face-background 'default))) 3774 (custom-set-faces 3775 `(fringe ((t :background ,bg :foreground ,bg))) 3776 `(window-divider ((t :background ,bg :foreground ,bg))) 3777 `(window-divider-first-pixel ((t :background ,bg :foreground ,bg))) 3778 `(window-divider-last-pixel ((t :background ,bg :foreground ,bg)))))) 3779 3780 (add-hook 'modus-themes-post-load-hook #'my-modus-themes-invisible-dividers) 3781 3782 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3783 the post-load-theme phase. 3784 3785 The above will work only for themes that belong to the Modus family. 3786 For users of Emacs version 29 or higher, there exists a theme-agnostic 3787 hook that takes a function with one argument—that of the theme—and calls 3788 in the the “post enable” phase of theme loading. Here is the above 3789 snippet, with the necessary tweaks: 3790 3791 (defun my-modus-themes-invisible-dividers (&rest _) 3792 "Make window dividers for THEME invisible." 3793 (let ((bg (face-background 'default))) 3794 (custom-set-faces 3795 `(fringe ((t :background ,bg :foreground ,bg))) 3796 `(window-divider ((t :background ,bg :foreground ,bg))) 3797 `(window-divider-first-pixel ((t :background ,bg :foreground ,bg))) 3798 `(window-divider-last-pixel ((t :background ,bg :foreground ,bg)))))) 3799 3800 (add-hook 'enable-theme-functions #'my-modus-themes-invisible-dividers) 3801 3802 Users of older versions of Emacs can read the entry herein about 3803 defining their own theme-agnostic hook (*note A theme-agnostic hook for 3804 theme loading: DIY A theme-agnostic hook for theme loading.). 3805 3806 3807 File: docv6TKvo.info, Node: DIY Custom hl-todo colors, Next: DIY Add support for solaire-mode, Prev: DIY Use more spacious margins or padding in Emacs frames, Up: Advanced customization 3808 3809 7.19 DIY Custom hl-todo colors 3810 ============================== 3811 3812 The ‘hl-todo’ package provides the user option ‘hl-todo-keyword-faces’: 3813 it specifies a pair of keyword and corresponding color value. The Modus 3814 themes configure that option in the interest of legibility. While this 3815 works for our purposes, users may still prefer to apply their custom 3816 values, in which case the following approach is necessary: 3817 3818 (defun my-modus-themes-hl-todo-faces (&rest _) 3819 (setq hl-todo-keyword-faces '(("TODO" . "#ff0000") 3820 ("HACK" . "#ffff00") 3821 ("XXX" . "#00ffff") 3822 ("NOTE" . "#ff00ff")))) 3823 3824 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-hl-todo-faces) 3825 3826 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3827 the post-load-theme phase. 3828 3829 Or include a ‘let’ form, if needed: 3830 3831 (defun my-modus-themes-hl-todo-faces (&rest _) 3832 (let ((red "#ff0000") 3833 (blue "#0000ff")) 3834 (setq hl-todo-keyword-faces `(("TODO" . ,blue) 3835 ("HACK" . ,red) 3836 ("XXX" . ,red) 3837 ("NOTE" . ,blue))))) 3838 3839 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-hl-todo-faces) 3840 3841 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3842 the post-load-theme phase. 3843 3844 Normally, we do not touch user options, though this is an exception: 3845 otherwise the defaults are not always legible. 3846 3847 Reload the theme for changes to take effect. 3848 3849 3850 File: docv6TKvo.info, Node: DIY Add support for solaire-mode, Next: DIY Use a hook at the post-load-theme phase, Prev: DIY Custom hl-todo colors, Up: Advanced customization 3851 3852 7.20 DIY Add support for solaire-mode 3853 ===================================== 3854 3855 The ‘solaire-mode’ package dims the background of what it considers 3856 ancillary “UI” buffers, such as the minibuffer and Dired buffers. The 3857 Modus themes used to support Solaire on the premise that the user was 3858 (i) opting in to it, (ii) understood why certain buffers were more gray, 3859 and (iii) knew what other adjustments had to be made to prevent broken 3860 visuals (e.g. the default style of the ‘modus-themes-completions’ uses 3861 a subtle gray background for the selection, which with Solaire becomes 3862 practically invisible). 3863 3864 However, the assumption that users opt in to this feature does not 3865 always hold true. There are cases where it is enabled by defaultsuch as 3866 in the popular Doom Emacs configuration. Thus, the unsuspecting user 3867 who loads ‘modus-operandi’ or ‘modus-vivendi’ without the requisite 3868 customizations is getting a sub-par experience; an experience that we 3869 did not intend and cannot genuinely fix. 3870 3871 Because the Modus themes are meant to work everywhere, we cannot make 3872 an exception for Doom Emacs and/or Solaire users. Furthermore, we shall 3873 not introduce hacks, such as by adding a check in all relevant faces to 3874 be adjusted based on Solaire or whatever other package. Hacks of this 3875 sort are unsustainable and penalize the entire userbase. Besides, the 3876 themes are built into Emacs and we must keep their standard high. 3877 3878 The fundamental constraint with Solaire is that Emacs does not have a 3879 real distinction between “content” and “UI” buffers. For themes to work 3880 with Solaire, they need to be designed around that package. Such is an 3881 arrangement that compromises on our accessibility standards and/or 3882 hinders our efforts to provide the best possible experience while using 3883 the Modus themes. 3884 3885 As such, ‘solaire-mode’ is not—and will not be—supported by the Modus 3886 themes (or any other of my themes, for that matter). Users who want it 3887 must style the faces manually. Below is some sample code, based on what 3888 we cover at length elsewhere in this manual: 3889 3890 *note Advanced customization::. 3891 3892 *note Use theme colors in code with modus-themes-with-colors: Use 3893 theme colors in code with modus-themes-with-colors. 3894 3895 (defun my-modus-themes-custom-faces (&rest _) 3896 (modus-themes-with-colors 3897 (custom-set-faces 3898 `(solaire-default-face ((,c :inherit default :background ,bg-dim :foreground ,fg-dim))) 3899 `(solaire-line-number-face ((,c :inherit solaire-default-face :foreground ,fg-unfocused))) 3900 `(solaire-hl-line-face ((,c :background ,bg-active))) 3901 `(solaire-org-hide-face ((,c :background ,bg-dim :foreground ,bg-dim)))))) 3902 3903 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) 3904 3905 *note Using a hook at the post-load-theme phase: DIY Use a hook at 3906 the post-load-theme phase. 3907 3908 Reload the theme for changes to take effect. 3909 3910 3911 File: docv6TKvo.info, Node: DIY Use a hook at the post-load-theme phase, Prev: DIY Add support for solaire-mode, Up: Advanced customization 3912 3913 7.21 DIY Use a hook at the post-load-theme phase 3914 ================================================ 3915 3916 Many of the Do-It-Yourself (DIY) snippets provided herein make use of a 3917 hook to apply the desired changes. In most examples, this hook is the 3918 ‘modus-themes-after-load-theme-hook’ (alias 3919 ‘modus-themes-post-load-hook’). This hook is provided by the Modus 3920 themes and is called at the end of one the following: 3921 3922 Command ‘modus-themes-toggle’ 3923 *note Option for which themes to toggle::. 3924 3925 Command ‘modus-themes-select’ 3926 Select a Modus theme using minibuffer completion and then load it. 3927 3928 Function ‘modus-themes-load-theme’ 3929 Called only from Lisp, such as in the user’s init file, with the 3930 quoted symbol of a Modus theme as an argument (*note Option for 3931 disabling other themes while loading Modus: Disable other themes.). 3932 This function is used internally by ‘modus-themes-toggle’ and 3933 ‘modus-themes-select’. 3934 3935 Users who switch between themes that are not limited to the Modus 3936 collection cannot benefit from the aforementioned hook: it only works 3937 with the Modus themes. A theme-agnostic hook is needed in such a case. 3938 Before Emacs 29, this had to be set up manually (*note DIY A 3939 theme-agnostic hook for theme loading::). Starting with Emacs 29, the 3940 special hook ‘enable-theme-functions’ works with anything that uses the 3941 basic ‘enable-theme’ function. 3942 3943 To use the ‘enable-theme-functions’ just add the given function to it 3944 the way it is done with every hook: 3945 3946 (add-hook 'enable-theme-functions 'MY-FUNCTION-HERE) 3947 3948 Functions added to ‘enable-theme-functions’ accept a single ‘THEME’ 3949 argument. The examples shown in this manual use the pattern ‘(&rest 3950 _)’, which is how a function accepts one or more arguments but declares 3951 it will not use them (in plain terms, the code works with or without 3952 ‘enable-theme-functions’). 3953 3954 * Menu: 3955 3956 * DIY A theme-agnostic hook for theme loading:: 3957 3958 3959 File: docv6TKvo.info, Node: DIY A theme-agnostic hook for theme loading, Up: DIY Use a hook at the post-load-theme phase 3960 3961 7.21.1 DIY A theme-agnostic hook for theme loading 3962 -------------------------------------------------- 3963 3964 [ NOTE: The following is for versions of Emacs before 29. For Emacs 29 3965 or higher, users can rely on the built-in ‘enable-theme-functions’ 3966 (*note Using a hook at the post-load-theme phase: DIY Use a hook at the 3967 post-load-theme phase.). ] 3968 3969 The themes are designed with the intent to be useful to Emacs users 3970 of varying skill levels, from beginners to experts. This means that we 3971 try to make things easier by not expecting anyone reading this document 3972 to be proficient in Emacs Lisp or programming in general. 3973 3974 Such a case is with the use of ‘modus-themes-after-load-theme-hook’, 3975 which runs after the ‘modus-themes-load-theme’ function (used by the 3976 command ‘modus-themes-toggle’). We recommend using that hook for 3977 advanced customizations, because (1) we know for sure that it is 3978 available once the themes are loaded, and (2) anyone consulting this 3979 manual, especially the sections on enabling and loading the themes, will 3980 be in a good position to benefit from that hook. 3981 3982 Advanced users who have a need to switch between the Modus themes and 3983 other items will find that such a hook does not meet their requirements: 3984 it only works with the Modus themes and only with the aforementioned 3985 functions. 3986 3987 A theme-agnostic setup can be configured thus: 3988 3989 (defvar after-enable-theme-hook nil 3990 "Normal hook run after enabling a theme.") 3991 3992 (defun run-after-enable-theme-hook (&rest _args) 3993 "Run `after-enable-theme-hook'." 3994 (run-hooks 'after-enable-theme-hook)) 3995 3996 (advice-add 'enable-theme :after #'run-after-enable-theme-hook) 3997 3998 This creates the ‘after-enable-theme-hook’ and makes it run after 3999 each call to ‘enable-theme’, which means that it will work for all 4000 themes and also has the benefit that it does not depend on functions 4001 such as ‘modus-themes-toggle’ and the others mentioned above. 4002 ‘enable-theme’ is called internally by ‘load-theme’, so the hook works 4003 everywhere. 4004 4005 The downside of the theme-agnostic hook is that any functions added 4006 to it will likely not be able to benefit from macro calls that read the 4007 active theme, such as ‘modus-themes-with-colors’. Not all Emacs themes 4008 have the same capabilities. 4009 4010 In this document, we cover ‘modus-themes-after-load-theme-hook’ 4011 though the user can replace it with ‘after-enable-theme-hook’ should 4012 they need to (provided they understand the implications). 4013 4014 4015 File: docv6TKvo.info, Node: Face coverage, Next: Notes on individual packages, Prev: Advanced customization, Up: Top 4016 4017 8 Face coverage 4018 *************** 4019 4020 The Modus themes try to provide as close to full face coverage as 4021 possible. This is necessary to ensure a consistently accessible reading 4022 experience across all available interfaces. 4023 4024 * Menu: 4025 4026 * Supported packages:: Full list of covered face groups 4027 * Indirectly covered packages:: 4028 4029 4030 File: docv6TKvo.info, Node: Supported packages, Next: Indirectly covered packages, Up: Face coverage 4031 4032 8.1 Full support for packages or face groups 4033 ============================================ 4034 4035 This list will always be updated to reflect the current state of the 4036 project. The idea is to offer an overview of the known status of all 4037 affected face groups. The items with an appended asterisk ‘*’ tend to 4038 have lots of extensions, so the “full support” may not be 100% true… 4039 4040 • ace-window 4041 • agda2-mode 4042 • all-the-icons 4043 • all-the-icons-dired 4044 • all-the-icons-ibuffer 4045 • annotate 4046 • ansi-color 4047 • anzu 4048 • auctex and TeX 4049 • auto-dim-other-buffers 4050 • avy 4051 • bbdb 4052 • binder 4053 • breadcrumb 4054 • bongo 4055 • boon 4056 • bookmark 4057 • calendar and diary 4058 • centaur-tabs 4059 • change-log and log-view (such as ‘vc-print-log’, 4060 ‘vc-print-root-log’) 4061 • chart 4062 • cider 4063 • circe 4064 • citar 4065 • clojure-mode 4066 • column-enforce-mode 4067 • company-mode* 4068 • compilation-mode 4069 • completions 4070 • consult 4071 • corfu 4072 • corfu-candidate-overlay 4073 • corfu-quick 4074 • counsel* 4075 • cperl-mode 4076 • crontab-mode 4077 • csv-mode 4078 • ctrlf 4079 • custom (what you get with ‘M-x customize’) 4080 • dashboard 4081 • deadgrep 4082 • debbugs 4083 • deft 4084 • denote 4085 • devdocs 4086 • dictionary 4087 • diff-hl 4088 • diff-mode 4089 • dim-autoload 4090 • dired 4091 • dired-async 4092 • dired-git 4093 • dired-git-info 4094 • dired-narrow 4095 • dired-subtree 4096 • diredfl 4097 • disk-usage 4098 • display-fill-column-indicator-mode 4099 • doom-modeline 4100 • ediff 4101 • ein (Emacs IPython Notebook) 4102 • eglot 4103 • el-search 4104 • eldoc-box 4105 • elfeed 4106 • elfeed-score 4107 • elpher 4108 • embark 4109 • ement 4110 • emms 4111 • enh-ruby-mode (enhanced-ruby-mode) 4112 • epa 4113 • erc 4114 • ert 4115 • erts-mode 4116 • eshell 4117 • eshell-fringe-status 4118 • evil* (evil-mode) 4119 • eww 4120 • exwm 4121 • eyebrowse 4122 • flycheck 4123 • flycheck-color-mode-line 4124 • flycheck-indicator 4125 • flymake 4126 • flyspell 4127 • flx 4128 • focus 4129 • fold-this 4130 • font-lock (generic syntax highlighting) 4131 • geiser 4132 • git-commit 4133 • git-gutter (and variants) 4134 • git-rebase 4135 • git-timemachine 4136 • gnus 4137 • gotest 4138 • golden-ratio-scroll-screen 4139 • helpful 4140 • highlight-numbers 4141 • highlight-parentheses (*note Note on highlight-parentheses.el: Note 4142 on highlight-parenthesesel.) 4143 • highlight-thing 4144 • hl-fill-column 4145 • hl-line-mode 4146 • hl-todo 4147 • hydra 4148 • ibuffer 4149 • icomplete 4150 • ido-mode 4151 • iedit 4152 • iflipb 4153 • image-dired 4154 • imenu-list 4155 • indium 4156 • info 4157 • info+ (info-plus) 4158 • info-colors 4159 • ioccur 4160 • isearch, occur, etc. 4161 • ivy* 4162 • ivy-posframe 4163 • japanese-holidays 4164 • jira (org-jira) 4165 • jit-spell 4166 • jinx 4167 • journalctl-mode 4168 • js2-mode 4169 • julia 4170 • kaocha-runner 4171 • keycast 4172 • ledger-mode 4173 • leerzeichen 4174 • line numbers (‘display-line-numbers-mode’ and global variant) 4175 • magit 4176 • make-mode 4177 • man 4178 • marginalia 4179 • markdown-mode 4180 • markup-faces (‘adoc-mode’) 4181 • mct 4182 • messages 4183 • minimap 4184 • mode-line 4185 • mood-line 4186 • mpdel 4187 • mu4e 4188 • multiple-cursors 4189 • nerd-icons 4190 • nerd-icons-completion 4191 • nerd-icons-dired 4192 • nerd-icons-ibuffer 4193 • neotree 4194 • notmuch 4195 • num3-mode 4196 • nxml-mode 4197 • olivetti 4198 • orderless 4199 • org* 4200 • org-journal 4201 • org-noter 4202 • org-pomodoro 4203 • org-recur 4204 • org-roam 4205 • org-superstar 4206 • org-table-sticky-header 4207 • org-tree-slide 4208 • origami 4209 • outline-mode 4210 • outline-minor-faces 4211 • package (what you get with ‘M-x list-packages’) 4212 • page-break-lines 4213 • pandoc-mode 4214 • paren-face 4215 • pass 4216 • pdf-tools 4217 • persp-mode 4218 • perspective 4219 • popup 4220 • powerline 4221 • prism (*note Note for prism.el: Note for prism.) 4222 • prescient 4223 • proced 4224 • prodigy 4225 • pulse 4226 • pyim 4227 • quick-peek 4228 • rainbow-delimiters 4229 • rcirc 4230 • rcirc-color 4231 • recursion-indicator 4232 • regexp-builder (also known as ‘re-builder’) 4233 • rg (rg.el) 4234 • ripgrep 4235 • rmail 4236 • rst-mode 4237 • ruler-mode 4238 • sesman 4239 • shell-script-mode 4240 • shortdoc 4241 • show-paren-mode 4242 • shr 4243 • side-notes 4244 • sieve-mode 4245 • skewer-mode 4246 • slime (slbd) 4247 • sly 4248 • smart-mode-line 4249 • smerge 4250 • speedbar 4251 • spell-fu 4252 • stripes 4253 • suggest 4254 • switch-window 4255 • swiper 4256 • symbol-overlay 4257 • syslog-mode 4258 • tab-bar-mode 4259 • tab-line-mode 4260 • table (built-in ‘table.el’) 4261 • telega 4262 • terraform-mode 4263 • term 4264 • textsec 4265 • transient (pop-up windows such as Magit’s) 4266 • trashed 4267 • tree-sitter 4268 • tty-menu 4269 • tuareg 4270 • typescript 4271 • undo-tree 4272 • vc (‘vc-dir.el’, ‘vc-hooks.el’) 4273 • vertico 4274 • vertico-quick 4275 • vimish-fold 4276 • visible-mark 4277 • visual-regexp 4278 • vterm 4279 • vundo 4280 • wcheck-mode 4281 • web-mode 4282 • wgrep 4283 • which-function-mode 4284 • which-key 4285 • whitespace-mode 4286 • window-divider-mode 4287 • writegood-mode 4288 • woman 4289 • xah-elisp-mode 4290 • xterm-color (and ansi-colors) 4291 • yaml-mode 4292 • yasnippet 4293 • ztree 4294 4295 Plus many other miscellaneous faces that are provided by Emacs. 4296 4297 4298 File: docv6TKvo.info, Node: Indirectly covered packages, Prev: Supported packages, Up: Face coverage 4299 4300 8.2 Indirectly covered packages 4301 =============================== 4302 4303 These do not require any extra styles because they are configured to 4304 inherit from some basic faces or their dependencies which are directly 4305 supported by the themes. 4306 4307 • ag 4308 • apropos 4309 • apt-sources-list 4310 • bbdb 4311 • bm 4312 • breakpoint (provided by the built-in ‘gdb-mi.el’ library) 4313 • buffer-expose 4314 • bufler 4315 • counsel-notmuch 4316 • counsel-org-capture-string 4317 • css-mode 4318 • dashboard (emacs-dashboard) 4319 • define-word 4320 • denote 4321 • disk-usage 4322 • dtache 4323 • dynamic-ruler 4324 • easy-kill 4325 • ebdb 4326 • edit-indirect 4327 • egerrit 4328 • elfeed-summary 4329 • evil-owl 4330 • flyspell-correct 4331 • fortran-mode 4332 • freeze-it 4333 • forge 4334 • git-walktree 4335 • goggles 4336 • highlight-defined 4337 • highlight-escape-sequences (‘hes-mode’) 4338 • icomplete-vertical 4339 • i3wm-config-mode 4340 • lin 4341 • minibuffer-line 4342 • no-emoji 4343 • org-remark 4344 • parrot 4345 • perl-mode 4346 • php-mode 4347 • pulsar 4348 • rjsx-mode 4349 • side-hustle 4350 • spell-fu 4351 • swift-mode 4352 • tab-bar-echo-area 4353 • tide 4354 • undo-hl 4355 • vdiff 4356 • vertico-indexed 4357 • vertico-mouse 4358 • xref 4359 4360 4361 File: docv6TKvo.info, Node: Notes on individual packages, Next: Frequently Asked Questions, Prev: Face coverage, Up: Top 4362 4363 9 Notes on individual packages 4364 ****************************** 4365 4366 This section covers information that may be of interest to users of 4367 individual packages. 4368 4369 * Menu: 4370 4371 * Note on calendar.el weekday and weekend colors: Note on calendarel weekday and weekend colors. 4372 * Note on git-gutter in Doom Emacs:: 4373 * Note on php-mode multiline comments:: 4374 * Note on underlines in compilation buffers:: 4375 * Note on inline Latex in Org buffers:: 4376 * Note on dimmer.el: Note on dimmerel. 4377 * Note on display-fill-column-indicator-mode:: 4378 * Note on highlight-parentheses.el: Note on highlight-parenthesesel. 4379 * Note on mmm-mode.el background colors: Note on mmm-modeel background colors. 4380 * Note for prism:: 4381 * Note on company-mode overlay pop-up:: 4382 * Note on ERC escaped color sequences:: 4383 * Note on powerline or spaceline:: 4384 * Note on SHR colors:: 4385 * Note on SHR fonts:: 4386 * Note on Ement colors and fonts:: 4387 * Note on pdf-tools link hints:: 4388 * Note on the Notmuch logo:: 4389 * Note on goto-address-mode faces:: 4390 4391 4392 File: docv6TKvo.info, Node: Note on calendarel weekday and weekend colors, Next: Note on git-gutter in Doom Emacs, Up: Notes on individual packages 4393 4394 9.1 Note on calendar.el weekday and weekend colors 4395 ================================================== 4396 4397 By default, the ‘M-x calendar’ interface differentiates weekdays from 4398 weekends by applying a gray color to the former and a faint red to the 4399 latter. The idea for this approach is that the weekend should serve as 4400 a subtle warning that no work is supposed to be done on that day, per 4401 the design of traditional calendars. 4402 4403 Users who prefer all days to look the same can configure the variable 4404 ‘calendar-weekend-days’ to either use gray of weekdays or the faint red 4405 of weekends uniformly. 4406 4407 ;; All are treated like weekdays (gray color) 4408 (setq calendar-weekend-days nil) 4409 4410 ;; All are treated like weekends (red-faint color) 4411 (setq calendar-weekend-days (number-sequence 0 6)) 4412 4413 ;; The default marks the Saturday and Sunday as the weekend 4414 (setq calendar-weekend-days '(0 6)) 4415 4416 For changes to take effect, the Calendar buffer needs to be generated 4417 anew. 4418 4419 4420 File: docv6TKvo.info, Node: Note on git-gutter in Doom Emacs, Next: Note on php-mode multiline comments, Prev: Note on calendarel weekday and weekend colors, Up: Notes on individual packages 4421 4422 9.2 Note on git-gutter in Doom Emacs 4423 ==================================== 4424 4425 The ‘git-gutter’ and ‘git-gutter-fr’ packages default to drawing bitmaps 4426 for the indicators they display (e.g. bitmap of a plus sign for added 4427 lines). In Doom Emacs, these bitmaps are replaced with contiguous lines 4428 which may look nicer, but require a change to the foreground of the 4429 relevant faces to yield the desired color combinations. 4430 4431 Since this is Doom-specific, we urge users to apply changes in their 4432 local setup. Below is some sample code, based on what we cover at 4433 length elsewhere in this manual: 4434 4435 *note Advanced customization::. 4436 4437 *note Use theme colors in code with modus-themes-with-colors: Use 4438 theme colors in code with modus-themes-with-colors. 4439 4440 (defun my-modus-themes-custom-faces (&rest _) 4441 (modus-themes-with-colors 4442 (custom-set-faces 4443 ;; Make foreground the same as background for a uniform bar on 4444 ;; Doom Emacs. 4445 ;; 4446 ;; Doom should not be implementing such hacks because themes 4447 ;; cannot support them: 4448 ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>. 4449 `(git-gutter-fr:added ((,c :foreground ,bg-added-fringe))) 4450 `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-fringe))) 4451 `(git-gutter-fr:modified ((,c :foreground ,bg-changed-fringe)))))) 4452 4453 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) 4454 4455 *note Using a hook at the post-load-theme phase: DIY Use a hook at 4456 the post-load-theme phase. 4457 4458 As always, re-load the theme for changes to take effect. 4459 4460 If the above does not work, try this instead: 4461 4462 (after! modus-themes 4463 (modus-themes-with-colors 4464 (custom-set-faces 4465 ;; Make foreground the same as background for a uniform bar on 4466 ;; Doom Emacs. 4467 ;; 4468 ;; Doom should not be implementing such hacks because themes 4469 ;; cannot support them: 4470 ;; <https://protesilaos.com/codelog/2022-08-04-doom-git-gutter-modus-themes/>. 4471 `(git-gutter-fr:added ((,c :foreground ,bg-added-intense))) 4472 `(git-gutter-fr:deleted ((,c :foreground ,bg-removed-intense))) 4473 `(git-gutter-fr:modified ((,c :foreground ,bg-changed-intense)))))) 4474 4475 4476 File: docv6TKvo.info, Node: Note on php-mode multiline comments, Next: Note on underlines in compilation buffers, Prev: Note on git-gutter in Doom Emacs, Up: Notes on individual packages 4477 4478 9.3 Note on php-mode multiline comments 4479 ======================================= 4480 4481 Depending on your build of Emacs and/or the environment it runs in, 4482 multiline comments in PHP with the ‘php-mode’ package use the 4483 ‘font-lock-doc-face’ instead of ‘font-lock-comment-face’. 4484 4485 This seems to make all comments use the appropriate face: 4486 4487 (defun my-multine-comments (&rest _) 4488 (setq-local c-doc-face-name 'font-lock-comment-face)) 4489 4490 (add-hook 'php-mode-hook #'my-multine-comments) 4491 4492 As always, re-load the theme for changes to take effect. 4493 4494 4495 File: docv6TKvo.info, Node: Note on underlines in compilation buffers, Next: Note on inline Latex in Org buffers, Prev: Note on php-mode multiline comments, Up: Notes on individual packages 4496 4497 9.4 Note on underlines in compilation buffers 4498 ============================================= 4499 4500 Various buffers that produce compilation results or run tests on code 4501 apply an underline to the file names they reference or to relevant 4502 messages. Users may consider this unnecessary or excessive. 4503 4504 To outright disable the effect, use this (buffers need to be 4505 generated anew): 4506 4507 (setq compilation-message-face nil) 4508 4509 If some element of differentiation is still desired, a good option is 4510 to render the affected text with the ‘italic’ face: 4511 4512 (setq compilation-message-face 'italic) 4513 4514 *note Configure bold and italic faces: DIY Configure bold and italic 4515 faces. 4516 4517 4518 File: docv6TKvo.info, Node: Note on inline Latex in Org buffers, Next: Note on dimmerel, Prev: Note on underlines in compilation buffers, Up: Notes on individual packages 4519 4520 9.5 Note on inline Latex in Org buffers 4521 ======================================= 4522 4523 Org can work with inline latex and related syntax. To actually fontify 4524 those constructs, set the variable ‘org-highlight-latex-and-related’ to 4525 the desired list of values (per its doc string). For example: 4526 4527 (setq org-highlight-latex-and-related '(latex script)) 4528 4529 Remember to use ‘M-x org-mode-restart’ for changes to take effect. 4530 4531 4532 File: docv6TKvo.info, Node: Note on dimmerel, Next: Note on display-fill-column-indicator-mode, Prev: Note on inline Latex in Org buffers, Up: Notes on individual packages 4533 4534 9.6 Note on dimmer.el 4535 ===================== 4536 4537 The ‘dimmer.el’ library by Neil Okamoto can be configured to 4538 automatically dim the colors of inactive Emacs windows. To guarantee 4539 consistent results with the Modus themes, we suggest some tweaks to the 4540 default styles, such as in this minimal setup: 4541 4542 (use-package dimmer 4543 :config 4544 (setq dimmer-fraction 0.3) 4545 (setq dimmer-adjustment-mode :foreground) 4546 (setq dimmer-use-colorspace :rgb) 4547 4548 (dimmer-mode 1)) 4549 4550 Of the above, we strongly recommend the RGB color space because it is 4551 the one that remains faithful to the hueness of the colors used by the 4552 themes. Whereas the default CIELAB space has a tendency to distort 4553 colors in addition to applying the dim effect, which can be somewhat 4554 disorienting. 4555 4556 The value of the ‘dimmer-fraction’ has been selected empirically. 4557 Users might prefer to tweak it further (increasing it makes the dim 4558 effect more pronounced). 4559 4560 Changing the ‘dimmer-adjustment-mode’ is a matter of preference. 4561 Though because the Modus themes use black and white as their base 4562 colors, any other value for that variable will turn the main background 4563 gray. This inadvertently leads to the opposite of the intended utility 4564 of this package: it draws too much attention to unfocused windows. 4565 4566 4567 File: docv6TKvo.info, Node: Note on display-fill-column-indicator-mode, Next: Note on highlight-parenthesesel, Prev: Note on dimmerel, Up: Notes on individual packages 4568 4569 9.7 Note on display-fill-column-indicator-mode 4570 ============================================== 4571 4572 The ‘display-fill-column-indicator-mode’ uses a typographic character to 4573 draw its line. This has the downside of creating a dashed line. The 4574 dashes are further apart depending on how tall the font’s glyph height 4575 is and what integer the ‘line-spacing’ is set to. 4576 4577 At the theme level we eliminate this effect by making the character 4578 one pixel tall: the line is contiguous. Users who prefer the dashed 4579 line are advised to change the ‘fill-column-indicator’ face, as 4580 explained elsewhere in this document. For example: 4581 4582 (modus-themes-with-colors 4583 (custom-set-faces 4584 `(fill-column-indicator ((,c :foreground ,bg-active))))) 4585 4586 *note Use theme colors in code with modus-themes-with-colors: Use 4587 theme colors in code with modus-themes-with-colors. 4588 4589 To make the line thicker, set the height to be equal to the base font 4590 size instead of the one pixel we use. This is done by specifying a rate 4591 instead of an absolute number, as in ‘:height 1.0’ versus ‘:height 1’. 4592 For example: 4593 4594 (modus-themes-with-colors 4595 (custom-set-faces 4596 `(fill-column-indicator ((,c :height 1.0 :background ,bg-inactive :foreground ,bg-inactive))))) 4597 4598 4599 File: docv6TKvo.info, Node: Note on highlight-parenthesesel, Next: Note on mmm-modeel background colors, Prev: Note on display-fill-column-indicator-mode, Up: Notes on individual packages 4600 4601 9.8 Note on highlight-parentheses.el 4602 ==================================== 4603 4604 The ‘highlight-parentheses’ package provides contextual coloration of 4605 surrounding parentheses, highlighting only those which are around the 4606 point. The package expects users to customize the applicable colors on 4607 their own by configuring certain variables. 4608 4609 To make the Modus themes work as expected with this, we need to use 4610 some of the techniques that are discussed at length in the various 4611 “Do-It-Yourself” (DIY) sections, which provide insight into the more 4612 advanced customization options of the themes. 4613 4614 *note Advanced customization::. 4615 4616 In the following example, we are assuming that the user wants to (i) 4617 re-use color variables provided by the themes, (ii) be able to retain 4618 their tweaks while switching between ‘modus-operandi’ and 4619 ‘modus-vivendi’, and (iii) have the option to highlight either the 4620 foreground of the parentheses or the background as well. 4621 4622 We start by defining our own variable, which will serve as a toggle 4623 between foreground and background coloration styles: 4624 4625 (defvar my-highlight-parentheses-use-background t 4626 "Prefer `highlight-parentheses-background-colors'.") 4627 4628 Then we can update our preference with this: 4629 4630 ;; Set to nil to disable backgrounds. 4631 (setq my-highlight-parentheses-use-background nil) 4632 4633 To re-use colors from the themes, we must wrap our code in the 4634 ‘modus-themes-with-colors’ macro. Our implementation must interface 4635 with the variables ‘highlight-parentheses-background-colors’ and/or 4636 ‘highlight-parentheses-colors’. 4637 4638 So we can have something like this (the doc string of 4639 ‘modus-themes-with-colors’ explains where the names of the colors can be 4640 found): 4641 4642 (modus-themes-with-colors 4643 ;; Our preference for setting either background or foreground 4644 ;; styles, depending on `my-highlight-parentheses-use-background'. 4645 (if my-highlight-parentheses-use-background 4646 4647 ;; Here we set color combinations that involve both a background 4648 ;; and a foreground value. 4649 (setq highlight-parentheses-background-colors (list bg-cyan-intense 4650 bg-magenta-intense 4651 bg-green-intense 4652 bg-yellow-intense) 4653 highlight-parentheses-colors (list cyan 4654 magenta 4655 green 4656 yellow)) 4657 4658 ;; And here we pass only foreground colors while disabling any 4659 ;; backgrounds. 4660 (setq highlight-parentheses-colors (list green-intense 4661 magenta-intense 4662 blue-intense 4663 red-intense) 4664 highlight-parentheses-background-colors nil))) 4665 4666 ;; Include this if you also want to make the parentheses bold: 4667 (set-face-attribute 'highlight-parentheses-highlight nil :inherit 'bold) 4668 4669 ;; Our changes must be evaluated before enabling the relevant mode, so 4670 ;; this comes last. 4671 (global-highlight-parentheses-mode 1) 4672 4673 For our changes to persist while switching between the Modus themes, 4674 we need to include them in a function which can then get passed to 4675 ‘modus-themes-after-load-theme-hook’. This is the complete 4676 implementation: 4677 4678 ;; Configurations for `highlight-parentheses': 4679 (require 'highlight-parentheses) 4680 4681 (defvar my-highlight-parentheses-use-background t 4682 "Prefer `highlight-parentheses-background-colors'.") 4683 4684 (setq my-highlight-parentheses-use-background nil) ; Set to nil to disable backgrounds 4685 4686 (defun my-modus-themes-highlight-parentheses (&rest _) 4687 (modus-themes-with-colors 4688 ;; Our preference for setting either background or foreground 4689 ;; styles, depending on `my-highlight-parentheses-use-background'. 4690 (if my-highlight-parentheses-use-background 4691 4692 ;; Here we set color combinations that involve both a background 4693 ;; and a foreground value. 4694 (setq highlight-parentheses-background-colors (list bg-cyan-intense 4695 bg-magenta-intense 4696 bg-green-intense 4697 bg-yellow-intense) 4698 highlight-parentheses-colors (list cyan 4699 magenta 4700 green 4701 yellow)) 4702 4703 ;; And here we pass only foreground colors while disabling any 4704 ;; backgrounds. 4705 (setq highlight-parentheses-colors (list green-intense 4706 magenta-intense 4707 blue-intense 4708 red-intense) 4709 highlight-parentheses-background-colors nil))) 4710 4711 ;; Include this if you also want to make the parentheses bold: 4712 (set-face-attribute 'highlight-parentheses-highlight nil :inherit 'bold) 4713 4714 ;; Our changes must be evaluated before enabling the relevant mode, so 4715 ;; this comes last. 4716 (global-highlight-parentheses-mode 1)) 4717 4718 (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-highlight-parentheses) 4719 4720 *note Using a hook at the post-load-theme phase: DIY Use a hook at 4721 the post-load-theme phase. 4722 4723 As always, re-load the theme for changes to take effect. 4724 4725 4726 File: docv6TKvo.info, Node: Note on mmm-modeel background colors, Next: Note for prism, Prev: Note on highlight-parenthesesel, Up: Notes on individual packages 4727 4728 9.9 Note on mmm-mode.el background colors 4729 ========================================= 4730 4731 The faces used by ‘mmm-mode.el’ are expected to have a colorful 4732 background, while they should not touch any foreground value. The idea 4733 is that they must not interfere with existing fontification. Those 4734 background colors need to be distinct from each other, such as an 4735 unambiguous red juxtaposed with a clear blue. 4736 4737 While this design may be internally consistent with the raison d’être 4738 of that library, it inevitably produces inaccessible color combinations. 4739 4740 There are two competing goals at play: 4741 4742 1. Legibility of the text, understood as the contrast ratio between 4743 the background and the foreground. 4744 4745 2. Semantic precision of each face which entails faithfulness to 4746 color-coding of the underlying background. 4747 4748 As the Modus themes are designed with the express purpose of 4749 conforming with the first point, we have to forgo the apparent 4750 color-coding of the background elements. Instead we use subtle colors 4751 that do not undermine the legibility of the affected text while they 4752 still offer a sense of added context. 4753 4754 Users who might prefer to fall below the minimum 7:1 contrast ratio 4755 in relative luminance (the accessibility target we conform with), can 4756 opt to configure the relevant faces on their own. 4757 4758 *note Use theme colors in code with modus-themes-with-colors: Use 4759 theme colors in code with modus-themes-with-colors. 4760 4761 This example uses more vivid background colors, though it comes at 4762 the very high cost of degraded legibility. 4763 4764 (modus-themes-with-colors 4765 (custom-set-faces 4766 `(mmm-cleanup-submode-face ((,c :background ,bg-yellow-intense))) 4767 `(mmm-code-submode-face ((,c :background ,bg-inactive))) 4768 `(mmm-comment-submode-face ((,c :background ,bg-blue-intense))) 4769 `(mmm-declaration-submode-face ((,c :background ,bg-cyan-intense))) 4770 `(mmm-default-submode-face ((,c :background ,bg-dim))) 4771 `(mmm-init-submode-face ((,c :background ,bg-magenta-intense))) 4772 `(mmm-output-submode-face ((,c :background ,bg-red-intense))) 4773 `(mmm-special-submode-face ((,c :background ,bg-green-intense))))) 4774 4775 4776 File: docv6TKvo.info, Node: Note for prism, Next: Note on company-mode overlay pop-up, Prev: Note on mmm-modeel background colors, Up: Notes on individual packages 4777 4778 9.10 Note on prism.el 4779 ===================== 4780 4781 This package by Adam Porter, aka “alphapapa” or “github-alphapapa”, 4782 implements an alternative to the typical coloration of code. Instead of 4783 highlighting the syntactic constructs, it applies color to different 4784 levels of depth in the code structure. 4785 4786 As ‘prism.el’ offers a broad range of customizations, we cannot style 4787 it directly at the theme level: that would run contrary to the spirit of 4788 the package. Instead, we may offer preset color schemes. Those should 4789 offer a starting point for users to adapt to their needs. 4790 4791 In the following code snippets, we employ the 4792 ‘modus-themes-with-colors’ macro: *note Use theme colors in code with 4793 modus-themes-with-colors: Use theme colors in code with 4794 modus-themes-with-colors. 4795 4796 These are the minimum recommended settings with 16 colors: 4797 4798 (setq prism-num-faces 16) 4799 4800 (prism-set-colors 4801 :desaturations '(0) ; do not change---may lower the contrast ratio 4802 :lightens '(0) ; same 4803 :colors (modus-themes-with-colors 4804 (list fg-main 4805 magenta 4806 cyan-cooler 4807 magenta-cooler 4808 blue 4809 magenta-warmer 4810 cyan-warmer 4811 red-cooler 4812 green 4813 fg-main 4814 cyan 4815 yellow 4816 blue-warmer 4817 red-warmer 4818 green-cooler 4819 yellow-faint))) 4820 4821 With 8 colors: 4822 4823 (setq prism-num-faces 8) 4824 4825 (prism-set-colors 4826 :desaturations '(0) ; do not change---may lower the contrast ratio 4827 :lightens '(0) ; same 4828 :colors (modus-themes-with-colors 4829 (list blue 4830 magenta 4831 magenta-cooler 4832 cyan-cooler 4833 fg-main 4834 blue-warmer 4835 red-cooler 4836 cyan))) 4837 4838 And this is with 4 colors, which produces results that are the 4839 closest to the themes’ default aesthetic: 4840 4841 (setq prism-num-faces 4) 4842 4843 (prism-set-colors 4844 :desaturations '(0) ; do not change---may lower the contrast ratio 4845 :lightens '(0) ; same 4846 :colors (modus-themes-with-colors 4847 (list blue 4848 magenta 4849 magenta-cooler 4850 green-warmer))) 4851 4852 If you need to apply desaturation and lightening, you can use what 4853 the ‘prism.el’ documentation recommends, like this (adapting to the 4854 examples with the 4, 8, 16 colors): 4855 4856 (prism-set-colors 4857 :desaturations (cl-loop for i from 0 below 16 collect (* i 2.5)) 4858 :lightens (cl-loop for i from 0 below 16 collect (* i 2.5)) 4859 :colors (modus-themes-with-colors 4860 (list fg-main 4861 cyan-cooler 4862 magenta-cooler 4863 magenta))) 4864 4865 4866 File: docv6TKvo.info, Node: Note on company-mode overlay pop-up, Next: Note on ERC escaped color sequences, Prev: Note for prism, Up: Notes on individual packages 4867 4868 9.11 Note on company-mode overlay pop-up 4869 ======================================== 4870 4871 By default, the ‘company-mode’ pop-up that lists completion candidates 4872 is drawn using an overlay. This creates alignment issues every time it 4873 is placed above a piece of text that has a different height than the 4874 default. 4875 4876 The solution recommended by the project’s maintainer is to use an 4877 alternative front-end for drawing the pop-up which draws child frames 4878 instead of overlays.(1)(2) 4879 4880 Also consider the ‘corfu’ package. 4881 4882 ---------- Footnotes ---------- 4883 4884 (1) <https://github.com/company-mode/company-mode/issues/1010> 4885 4886 (2) <https://github.com/tumashu/company-posframe/> 4887 4888 4889 File: docv6TKvo.info, Node: Note on ERC escaped color sequences, Next: Note on powerline or spaceline, Prev: Note on company-mode overlay pop-up, Up: Notes on individual packages 4890 4891 9.12 Note on ERC escaped color sequences 4892 ======================================== 4893 4894 The built-in IRC client ‘erc’ has the ability to colorize any text using 4895 escape sequences that start with ‘^C’ (inserted with ‘C-q C-c’) and are 4896 followed by a number for the foreground and background.(1) Possible 4897 numbers are 0-15, with the first entry being the foreground and the 4898 second the background, separated by a comma. Like this ‘^C1,6’. The 4899 minimum setup is this: 4900 4901 (add-to-list 'erc-modules 'irccontrols) 4902 (setq erc-interpret-controls-p t 4903 erc-interpret-mirc-color t) 4904 4905 As this allows users the chance to make arbitrary combinations, it is 4906 impossible to guarantee a consistently high contrast ratio. All we can 4907 we do is provide guidance on the combinations that satisfy the 4908 accessibility standard of the themes: 4909 4910 Modus Operandi 4911 Use foreground color 1 for all backgrounds from 2-15. Like so: 4912 ‘C-q C-c1’ where ‘N’ is the background. 4913 4914 Modus Vivendi 4915 Use foreground color 0 for all backgrounds from 2-13. Use 4916 foreground ‘1’ for backgrounds 14, 15. 4917 4918 Colors 0 and 1 are white and black respectively. So combine them 4919 together, if you must. 4920 4921 ---------- Footnotes ---------- 4922 4923 (1) This page explains the basics, though it is not specific to 4924 Emacs: <https://www.mirc.com/colors.html> 4925 4926 4927 File: docv6TKvo.info, Node: Note on powerline or spaceline, Next: Note on SHR colors, Prev: Note on ERC escaped color sequences, Up: Notes on individual packages 4928 4929 9.13 Note on powerline or spaceline 4930 =================================== 4931 4932 Both Powerline and Spaceline package users will likely need to use the 4933 command ‘powerline-reset’ whenever they make changes to their themes 4934 and/or mode line setup. 4935 4936 4937 File: docv6TKvo.info, Node: Note on SHR colors, Next: Note on SHR fonts, Prev: Note on powerline or spaceline, Up: Notes on individual packages 4938 4939 9.14 Note on SHR colors 4940 ======================= 4941 4942 Emacs’ HTML rendering library (‘shr.el’) may need explicit configuration 4943 to respect the theme’s colors instead of whatever specifications the 4944 webpage provides. 4945 4946 Consult the doc string of ‘shr-use-colors’. 4947 4948 4949 File: docv6TKvo.info, Node: Note on SHR fonts, Next: Note on Ement colors and fonts, Prev: Note on SHR colors, Up: Notes on individual packages 4950 4951 9.15 Note on SHR fonts 4952 ====================== 4953 4954 By default, packages that build on top of the Simple HTML Remember 4955 (‘shr’) use proportionately spaced fonts. This is controlled by the 4956 user option ‘shr-use-fonts’, which is set to non-‘nil’ by default. To 4957 use the standard font instead, set that variable to ‘nil’. 4958 4959 *note Font configurations for Org and others: DIY Font configurations 4960 for Org and others. 4961 4962 Packages affected by this are: 4963 4964 • elfeed 4965 • ement 4966 • eww 4967 4968 This is a non-exhaustive list. 4969 4970 4971 File: docv6TKvo.info, Node: Note on Ement colors and fonts, Next: Note on pdf-tools link hints, Prev: Note on SHR fonts, Up: Notes on individual packages 4972 4973 9.16 Note on Ement colors and fonts 4974 =================================== 4975 4976 The ‘ement.el’ library by Adam Porter (also known as “alphapapa”) 4977 defaults to a method of colorizing usernames in a rainbow style. This 4978 is controlled by the user option ‘ement-room-prism’ and can be disabled 4979 with: 4980 4981 (setq ement-room-prism nil) 4982 4983 The contrast ratio of these colors is governed by another user 4984 option: ‘ement-room-prism-minimum-contrast’. By default, it is set to 6 4985 which is slightly below our nominal target. Try this instead: 4986 4987 (setq ement-room-prism-minimum-contrast 7) 4988 4989 With regard to fonts, Ement depends on ‘shr’ (*note Note on SHR 4990 fonts::). 4991 4992 Since we are here, here is an excerpt from Ement’s source code: 4993 4994 (defcustom ement-room-prism-minimum-contrast 6 4995 "Attempt to enforce this minimum contrast ratio for user faces. 4996 This should be a reasonable number from, e.g. 0-7 or so." 4997 ;; Prot would almost approve of this default. :) I would go all the way 4998 ;; to 7, but 6 already significantly dilutes the colors in some cases. 4999 :type 'number) 5000 5001 Yes, I do approve of that default. Even a 4.5 (the WCAG AA rating) 5002 would be a good baseline for many themes and/or user configurations. 5003 Our target is the highest of the sort, though we do not demand that 5004 everyone conforms with it. 5005 5006 5007 File: docv6TKvo.info, Node: Note on pdf-tools link hints, Next: Note on the Notmuch logo, Prev: Note on Ement colors and fonts, Up: Notes on individual packages 5008 5009 9.17 Note on pdf-tools link hints 5010 ================================= 5011 5012 Hints are drawn by ImageMagick (https://imagemagick.org/), not Emacs, 5013 i.e., ImageMagick doesn’t know about the hint face unless you tell 5014 ImageMagick about it. By default, only the foreground and background 5015 color attributes are passed. The below snippet adds to those the 5016 various font attributes. As it queries various faces, specifically 5017 ‘pdf-links-read-link’ and the faces it inherits, it needs to be added to 5018 your initialization file after you’ve customized any faces. 5019 5020 (use-package pdf-links 5021 :config 5022 (let ((spec 5023 (apply #'append 5024 (mapcar 5025 (lambda (name) 5026 (list name 5027 (face-attribute 'pdf-links-read-link 5028 name nil 'default))) 5029 '(:family :width :weight :slant))))) 5030 (setq pdf-links-read-link-convert-commands 5031 `("-density" "96" 5032 "-family" ,(plist-get spec :family) 5033 "-stretch" ,(let* ((width (plist-get spec :width)) 5034 (name (symbol-name width))) 5035 (replace-regexp-in-string "-" "" 5036 (capitalize name))) 5037 "-weight" ,(pcase (plist-get spec :weight) 5038 ('ultra-light "Thin") 5039 ('extra-light "ExtraLight") 5040 ('light "Light") 5041 ('semi-bold "SemiBold") 5042 ('bold "Bold") 5043 ('extra-bold "ExtraBold") 5044 ('ultra-bold "Black") 5045 (_weight "Normal")) 5046 "-style" ,(pcase (plist-get spec :slant) 5047 ('italic "Italic") 5048 ('oblique "Oblique") 5049 (_slant "Normal")) 5050 "-pointsize" "%P" 5051 "-undercolor" "%f" 5052 "-fill" "%b" 5053 "-draw" "text %X,%Y '%c'")))) 5054 5055 5056 File: docv6TKvo.info, Node: Note on the Notmuch logo, Next: Note on goto-address-mode faces, Prev: Note on pdf-tools link hints, Up: Notes on individual packages 5057 5058 9.18 Note on the Notmuch logo 5059 ============================= 5060 5061 By default, the “hello” buffer of Notmuch includes a header with the 5062 programs’ logo and a couple of buttons. The logo has the effect of 5063 enlarging the height of the line, which negatively impacts the shape of 5064 those buttons. Disabling the logo fixes the problem: 5065 5066 (setq notmuch-show-logo nil) 5067 5068 5069 File: docv6TKvo.info, Node: Note on goto-address-mode faces, Prev: Note on the Notmuch logo, Up: Notes on individual packages 5070 5071 9.19 Note on goto-address-mode faces 5072 ==================================== 5073 5074 The built-in ‘goto-address-mode’ uses heuristics to identify URLs and 5075 email addresses in the current buffer. It then applies a face to them 5076 to change their style. Some packages, such as ‘notmuch’, use this 5077 minor-mode automatically. 5078 5079 The faces are not declared with ‘defface’, meaning that it is better 5080 that the theme does not modify them. The user is thus encouraged to 5081 consider including (or equivalent) this in their setup: 5082 5083 (setq goto-address-url-face 'link 5084 goto-address-url-mouse-face 'highlight 5085 goto-address-mail-face 'link 5086 goto-address-mail-mouse-face 'highlight) 5087 5088 My personal preference is to set ‘goto-address-mail-face’ to ‘nil’, 5089 as it otherwise adds too much visual noise to the buffer (email 5090 addresses stand out more, due to the use of the uncommon ‘@’ character 5091 but also because they are often enclosed in angled brackets). 5092 5093 5094 File: docv6TKvo.info, Node: Frequently Asked Questions, Next: Contributing, Prev: Notes on individual packages, Up: Top 5095 5096 10 Frequently Asked Questions 5097 ***************************** 5098 5099 In this section we provide answers related to some aspects of the Modus 5100 themes’ design and application. 5101 5102 * Menu: 5103 5104 * Is the contrast ratio about adjacent colors?:: 5105 * What does it mean to avoid exaggerations?:: 5106 * Why are colors mostly variants of blue, magenta, cyan?: Why are colors mostly variants of blue magenta cyan?. 5107 * What is the best setup for legibility?:: 5108 * Are these color schemes?:: 5109 * Port the Modus themes to other platforms?:: 5110 5111 5112 File: docv6TKvo.info, Node: Is the contrast ratio about adjacent colors?, Next: What does it mean to avoid exaggerations?, Up: Frequently Asked Questions 5113 5114 10.1 Is the contrast ratio about adjacent colors? 5115 ================================================= 5116 5117 The minimum contrast ratio in relative luminance that the themes conform 5118 with always refers to any given combination of background and foreground 5119 colors. If we have some blue colored text next to a magenta one, both 5120 against a white background, we do not mean to imply that blue:magenta is 5121 7:1 in terms of relative luminance. Rather, we state that blue:white 5122 and magenta:white each are 7:1 or higher. 5123 5124 The point of reference is always the background. Because colors have 5125 about the same minimum distance in luminance from their backdrop, they 5126 necessarily are fairly close to each other in this measure. A possible 5127 blue:magenta combination would naturally be around 1:1 in contrast of 5128 the sort here considered. 5129 5130 To differentiate between sequential colors, we rely on hueness by 5131 mapping contrasting hues to adjacent constructs, while avoiding 5132 exaggerations. A blue next to a magenta can be told apart regardless of 5133 their respective contrast ratio against their common background. 5134 Exceptions would be tiny characters in arguably not so realistic cases, 5135 such as two dots drawn side-by-side which for some reason would need to 5136 be colored differently. They would still be legible though, which is 5137 the primary objective of the Modus themes. 5138 5139 5140 File: docv6TKvo.info, Node: What does it mean to avoid exaggerations?, Next: Why are colors mostly variants of blue magenta cyan?, Prev: Is the contrast ratio about adjacent colors?, Up: Frequently Asked Questions 5141 5142 10.2 What does it mean to avoid exaggerations? 5143 ============================================== 5144 5145 The Modus themes are designed with restraint, so that their default 5146 looks do not overdo it with the application of color. 5147 5148 *note Customization Options: Customization options. 5149 5150 This is the non-quantifiable aspect of the themes’ design: the 5151 artistic part, if you will. There are a lot of cases where color can be 5152 used inconsiderately, without accounting for layout, typographic, or 5153 other properties of the presentation. For example, two headings with 5154 distinct markers, such as leading asterisks in Org buffers, do not have 5155 to have highly contrasting hues between them in order to be told apart: 5156 the added element of contrast in hueness does not contribute 5157 significantly more to the distinction between the headings than colors 5158 whose hues are relatively closer to each other in the color space. 5159 5160 Exaggerations can be hard to anticipate or identify. Multiple shades 5161 of blue and magenta in the same context may not seem optimal: one might 5162 think that it would be better to use highly contrasting hues to ensure 5163 that all colors stand out, such as by placing blue next to yellow, next 5164 to magenta, and green. That would, however, be a case of design for its 5165 own sake; a case where color is being applied without consideration of 5166 its end results in the given context. Too many contrasting hues in 5167 close proximity force an erratic rate to how the eye jumps from one 5168 piece of text to the next. Whereas multiple shades of, say, blue and 5169 magenta can suffice to tell things apart and avoid excess coloration: a 5170 harmonious rhythm. 5171 5172 5173 File: docv6TKvo.info, Node: Why are colors mostly variants of blue magenta cyan?, Next: What is the best setup for legibility?, Prev: What does it mean to avoid exaggerations?, Up: Frequently Asked Questions 5174 5175 10.3 Why are colors mostly variants of blue, magenta, cyan? 5176 =========================================================== 5177 5178 Due to the innate properties of color, some options are better than 5179 others for the accessibility purposes of the themes, the stylistic 5180 consistency between ‘modus-operandi’ and ‘modus-vivendi’, and the 5181 avoidance of exaggerations in design. 5182 5183 *note What does it mean to avoid exaggerations?:: 5184 5185 What we describe as color is a function of three distinct channels of 5186 light: red, green, blue. In hexadecimal RGB notation, a color value is 5187 read as three pairs of red, green, and blue light: ‘#RRGGBB’. Of those 5188 three, the most luminant is green, while the least luminant is blue. 5189 5190 The three basic colors represent each of the channels of light. They 5191 can be intermixed to give us six colors: red and green derive yellow, 5192 green and blue make cyan, red and blue turn into magenta. 5193 5194 We can test the luminance of each of those against white and black to 5195 get a sense of how not all colors are equally good for accessibility 5196 (white is ‘#ffffff’, which means that all three light channels are fully 5197 luminated, while black is ‘#000000’ meaning that no light is present 5198 (notwithstanding display technology)). 5199 5200 | Name | | #ffffff | #000000 | 5201 |---------+---------+---------+---------| 5202 | red | #ff0000 | 4.00 | 5.25 | 5203 | yellow | #ffff00 | 1.07 | 19.56 | 5204 | green | #00ff00 | 1.37 | 15.30 | 5205 | cyan | #00ffff | 1.25 | 16.75 | 5206 | blue | #0000ff | 8.59 | 2.44 | 5207 | magenta | #ff00ff | 3.14 | 6.70 | 5208 5209 *note Measure color contrast: DIY Measure color contrast. 5210 5211 By reading this table we learn that every color that has a high level 5212 of green light (green, yellow, cyan) is virtually unreadable against a 5213 white background and, conversely, can be easily read against black. 5214 5215 We can then infer that red and blue, in different combinations, with 5216 green acting as calibrator for luminance, will give us fairly moderate 5217 colors that pass the 7:1 target. Blue with a bit of green produce 5218 appropriate variants of cyan. Similarly, blue combined with some red 5219 and hints of green give us suitable shades of purple. 5220 5221 Due to the need of maintaining some difference in hueness between 5222 adjacent colors, it is not possible to make red, green, and yellow the 5223 main colors, because blue cannot be used to control their luminance and, 5224 thus the relevant space will shrink considerably. 5225 5226 *note Is the contrast ratio about adjacent colors?:: 5227 5228 This phenomenon is best illustrated by the following table that 5229 measures the relative luminance of shades of red, yellow, magenta 5230 against white: 5231 5232 | | #ffffff | 5233 |---------+---------| 5234 | #990000 | 8.92 | 5235 | #995500 | 5.75 | 5236 | #990099 | 7.46 | 5237 5238 We notice that equal values of red and blue light in ‘#990099’ 5239 (magenta shade) do not lead to a considerable change in luminance 5240 compared with ‘#990000’ (red variant). Whereas less amount of green 5241 light in ‘#995500’ leads to a major drop in luminance relative to white. 5242 It follows that using the green channel of light to calibrate the 5243 luminance of colors is more effective than trying to do the same with 5244 either red or blue (the latter is the least effective in that regard). 5245 5246 When we need to work with several colors, it is always better to have 5247 sufficient manoeuvring space, especially since we cannot pick arbitrary 5248 colors but only those that satisfy the accessibility objectives of the 5249 themes. 5250 5251 As for why we do not mostly use green, yellow, cyan for the dark 5252 theme, it is because those colors are far more luminant than their 5253 counterparts on the other side of the spectrum, so to ensure that they 5254 all have about the same contrast ratios we would have to alter their 5255 hueness considerably. In short, the effect would not be optimal as it 5256 would lead to exaggerations. Plus, it would make ‘modus-vivendi’ look 5257 completely different than ‘modus-operandi’, to the effect that the two 5258 could not be properly considered part of the same project. 5259 5260 5261 File: docv6TKvo.info, Node: What is the best setup for legibility?, Next: Are these color schemes?, Prev: Why are colors mostly variants of blue magenta cyan?, Up: Frequently Asked Questions 5262 5263 10.4 What is the best setup for legibility? 5264 =========================================== 5265 5266 The Modus themes can be conceptually simplified as combinations of color 5267 values that account for relative luminance and inner harmony. Those 5268 qualities do not guarantee that every end-user will have the same 5269 experience, due to differences between people, but also because of 5270 variances in hardware capabilities and configurations. For the purposes 5271 of this document, we may only provide suggestions pertaining to the 5272 latter case. 5273 5274 ‘modus-operandi’ is best used outdoors or in a room that either gets 5275 direct sunlight or has plenty of light. Whereas ‘modus-vivendi’ works 5276 better when there is not a lot of sunshine or the room has a source of 5277 light that is preferably a faint and/or warm one. It is possible to use 5278 ‘modus-operandi’ at night and ‘modus-vivendi’ during the day, though 5279 that will depend on several variables, such as one’s overall perception 5280 of color, the paint on the walls and how that contributes to the 5281 impression of lightness in the room, the sense of space within the eye’s 5282 peripheral vision, hardware specifications, and environmental factors. 5283 5284 In general, an additional source of light other than that of the 5285 monitor can help reduce eye strain: the eyes are more relaxed when they 5286 do not have to focus on one point to gather light. 5287 5288 The monitor’s display settings must be accounted for. Gamma values, 5289 in particular, need to be calibrated to neither amplify nor distort the 5290 perception of black. Same principle for sharpness, brightness, and 5291 contrast as determined by the hardware, which all have an effect on how 5292 text is read on the screen. 5293 5294 There are software level methods on offer, such as the XrandR utility 5295 for the X Window System (X.org), which can make gamma corrections for 5296 each of the three channels of light (red, green, blue). For example: 5297 5298 xrandr --output LVDS1 --brightness 1.0 --gamma 0.76:0.75:0.68 5299 5300 Typography is another variable. Some font families are blurry at 5301 small point sizes. Others may have a regular weight that is lighter 5302 (thiner) than that of their peers which may, under certain 5303 circumstances, cause a halo effect around each glyph. 5304 5305 The gist is that legibility cannot be fully solved at the theme 5306 level. The color combinations may have been optimized for 5307 accessibility, though the remaining contributing factors in each case 5308 need to be considered in full. 5309 5310 5311 File: docv6TKvo.info, Node: Are these color schemes?, Next: Port the Modus themes to other platforms?, Prev: What is the best setup for legibility?, Up: Frequently Asked Questions 5312 5313 10.5 Are these color schemes? 5314 ============================= 5315 5316 No, the Modus themes are not color schemes. 5317 5318 A color scheme is a collection of colors. A good color scheme is a 5319 combination of colors with an inner logic or abstract structure. 5320 5321 A theme is a set of patterns that are applied across different 5322 contexts. A good theme is one that does so with consistency, though not 5323 uniformity. 5324 5325 In practical terms, a color scheme is what one uses when, for 5326 example, they replace the first sixteen escape sequences of a terminal 5327 emulator with color values of their preference. The terminal offers the 5328 option to choose, say, the exact value of what counts as “red”, but does 5329 not provide the means to control where that is mapped to and whether it 5330 should also have other qualities such as a bold weight for the 5331 underlying text or an added background color. In contradistinction, 5332 Emacs uses constructs known as “faces” which allow the user/developer to 5333 specify where a given color will be used and whether it should be 5334 accompanied by other typographic or stylistic attributes. 5335 5336 By configuring the multitude of faces on offer we thus control both 5337 which colors are applied and how they appear in their context. When a 5338 package wants to render each instance of “foo” with the “bar” face, it 5339 is not requesting a specific color, which makes things considerably more 5340 flexible as we can treat “bar” in its own right without necessarily 5341 having to use some color value that we hardcoded somewhere. 5342 5343 Which brings us to the distinction between consistency and uniformity 5344 where our goal is always the former: we want things to look similar 5345 across all interfaces, but we must never force a visual identity where 5346 that runs contrary to the functionality of the given interface. For 5347 instance, all links are underlined by default yet there are cases such 5348 as when viewing listings of emails in Gnus (and Mu4e, Notmuch) where (i) 5349 it is already understood that one must follow the indicator or headline 5350 to view its contents and (ii) underlining everything would make the 5351 interface virtually unusable. 5352 5353 Again, one must exercise judgement in order to avoid discrimination, 5354 where “discrimination” refers to: 5355 5356 • The treatment of substantially different magnitudes as if they were 5357 of the same class. 5358 • Or the treatment of the same class of magnitudes as if they were of 5359 a different class. 5360 5361 (To treat similar things differently; to treat dissimilar things 5362 alike.) 5363 5364 If, in other words, one is to enforce uniformity without accounting 5365 for the particular requirements of each case—the contextual demands for 5366 usability beyond matters of color—they are making a not-so-obvious error 5367 of treating different cases as if they were the same. 5368 5369 The Modus themes prioritize “thematic consistency” over abstract 5370 harmony or regularity among their applicable colors. In concrete terms, 5371 we do not claim that, say, our yellows are the best complements for our 5372 blues because we generally avoid using complementary colors 5373 side-by-side, so it is wrong to optimize for a decontextualised 5374 blue+yellow combination. Not to imply that our colors do not work well 5375 together because they do, just to clarify that consistency of context is 5376 what themes must strive for, and that requires widening the scope of the 5377 design beyond the particularities of a color scheme. 5378 5379 Long story short: color schemes and themes have different 5380 requirements. Please do not conflate the two. 5381 5382 5383 File: docv6TKvo.info, Node: Port the Modus themes to other platforms?, Prev: Are these color schemes?, Up: Frequently Asked Questions 5384 5385 10.6 Port the Modus themes to other platforms? 5386 ============================================== 5387 5388 There is no plan to port the themes to other platforms or text editors. 5389 I (Protesilaos) only use GNU Emacs and thus cannot maintain code that 5390 targets software I am either not familiar with or am not using on a 5391 daily basis. 5392 5393 While it is possible to produce a simulacrum based on a given 5394 template, doing so would run contrary to how this project is maintained 5395 where details matter greatly. 5396 5397 Each program has its own requirements so it won’t always be 5398 possible—or indeed desirable—to have 1:1 correspondence between what 5399 applies to Emacs and what should be done elsewhere. No port should ever 5400 strive to be a copy of the Emacs implementation, as no other program is 5401 an Emacs equivalent, but instead try to follow the spirit of the design. 5402 For example, some of the customization options accept a list as their 5403 value, or an alist, which may not be possible to reproduce on other 5404 platforms. 5405 5406 *note Customization options::. 5407 5408 In other words, if something must be done differently on a certain 5409 editor then that is acceptable so long as (i) the accessibility 5410 standards are not compromised and (ii) the overall character of the 5411 themes remains consistent. 5412 5413 The former criterion should be crystal clear as it pertains to the 5414 scientific foundations of the themes: high legibility and taking care of 5415 the needs of users with red-green/blue-yellow color deficiency 5416 (deuteranopia and tritanopia) by avoiding red+green color coding 5417 paradigms and/or by providing yellow+blue variants for deuteranopia and 5418 red+cyan for tritanopia (*note Overview::). 5419 5420 The latter criterion is the “je ne sais quoi” of the artistic aspect 5421 of the themes, which is partially fleshed out in this manual. 5422 5423 *note Frequently Asked Questions::. 5424 5425 With regard to the artistic aspect (where “art” qua skill may amount 5426 to an imprecise science), there is no hard-and-fast rule in effect as it 5427 requires one to exercize discretion and make decisions based on 5428 context-dependent information or constraints. As is true with most 5429 things in life, when in doubt, do not cling on to the letter of the law 5430 but try to understand its spirit. 5431 5432 For a trivial example: the curly underline that Emacs draws for 5433 spelling errors is thinner than, e.g., what a graphical web browser has, 5434 so if I was to design for an editor than has a thicker curly underline I 5435 would make the applicable colors less intense to counterbalance the 5436 typographic intensity of the added thickness. 5437 5438 With those granted, if anyone is willing to develop a port of the 5439 themes, they are welcome to contact me and I will do my best to help 5440 them in their efforts. 5441 5442 5443 File: docv6TKvo.info, Node: Contributing, Next: Acknowledgements, Prev: Frequently Asked Questions, Up: Top 5444 5445 11 Contributing 5446 *************** 5447 5448 This section documents the canonical sources of the themes and the ways 5449 in which you can contribute to their ongoing development. 5450 5451 * Menu: 5452 5453 * Sources of the themes:: 5454 * Issues you can help with:: 5455 * Patches require copyright assignment to the FSF:: 5456 5457 5458 File: docv6TKvo.info, Node: Sources of the themes, Next: Issues you can help with, Up: Contributing 5459 5460 11.1 Sources of the themes 5461 ========================== 5462 5463 • Package name (GNU ELPA): ‘modus-themes’ 5464 • Official manual: <https://protesilaos.com/emacs/modus-themes> 5465 • Change log: <https://protesilaos.com/emacs/modus-themes-changelog> 5466 • Color palette: <https://protesilaos.com/emacs/modus-themes-colors> 5467 • Sample pictures: 5468 <https://protesilaos.com/emacs/modus-themes-pictures> 5469 • Git repo on SourceHut: 5470 <https://git.sr.ht/~protesilaos/modus-themes> 5471 • Mirrors: 5472 • GitHub: <https://github.com/protesilaos/modus-themes> 5473 • GitLab: <https://gitlab.com/protesilaos/modus-themes> 5474 • Mailing list: <https://lists.sr.ht/~protesilaos/modus-themes> 5475 • Backronym: My Old Display Unexpectedly Sharpened ... themes 5476 5477 5478 File: docv6TKvo.info, Node: Issues you can help with, Next: Patches require copyright assignment to the FSF, Prev: Sources of the themes, Up: Contributing 5479 5480 11.2 Issues you can help with 5481 ============================= 5482 5483 A few tasks you can help with by sending an email to the general 5484 modus-themes public mailing list 5485 (https://lists.sr.ht/~protesilaos/modus-themes). 5486 5487 • Suggest refinements to packages that are covered. 5488 • Report packages not covered thus far. 5489 • Report bugs, inconsistencies, shortcomings. 5490 • Help expand the documentation of covered-but-not-styled packages. 5491 • Suggest refinements to the color palette. 5492 • Help expand this document or any other piece of documentation. 5493 • Send patches for code refinements (if you need, ask me for help 5494 with Git—we all start out as beginners). 5495 5496 *note Patches require copyright assignment to the FSF::. 5497 5498 It is preferable that your feedback includes some screenshots, GIFs, 5499 or short videos, as well as further instructions to reproduce a given 5500 setup. Though this is not a requirement. 5501 5502 Whatever you do, bear in mind the overarching objective of the Modus 5503 themes: to keep a contrast ratio that is greater or equal to 7:1 between 5504 background and foreground colors. If a compromise is ever necessary 5505 between aesthetics and accessibility, it shall always be made in the 5506 interest of the latter. 5507 5508 5509 File: docv6TKvo.info, Node: Patches require copyright assignment to the FSF, Prev: Issues you can help with, Up: Contributing 5510 5511 11.3 Patches require copyright assignment to the FSF 5512 ==================================================== 5513 5514 Code contributions are most welcome. For any major edit (more than 15 5515 lines, or so, in aggregate per person), you need to make a copyright 5516 assignment to the Free Software Foundation. This is necessary because 5517 the themes are part of the upstream Emacs distribution: the FSF must at 5518 all times be in a position to enforce the GNU General Public License. 5519 5520 Copyright assignment is a simple process. Check the request form 5521 below (please adapt it accordingly). You must write an email to the 5522 address mentioned in the form and then wait for the FSF to send you a 5523 legal agreement. Sign the document and file it back to them. This 5524 could all happen via email and take about a week. You are encouraged to 5525 go through this process. You only need to do it once. It will allow 5526 you to make contributions to Emacs in general. 5527 5528 Please email the following information to assign@gnu.org, and we 5529 will send you the assignment form for your past and future changes. 5530 5531 Please use your full legal name (in ASCII characters) as the subject 5532 line of the message. 5533 5534 REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES 5535 5536 [What is the name of the program or package you're contributing to?] 5537 5538 GNU Emacs 5539 5540 [Did you copy any files or text written by someone else in these changes? 5541 Even if that material is free software, we need to know about it.] 5542 5543 Copied a few snippets from the same files I edited. Their author, 5544 Protesilaos Stavrou, has already assigned copyright to the Free Software 5545 Foundation. 5546 5547 [Do you have an employer who might have a basis to claim to own 5548 your changes? Do you attend a school which might make such a claim?] 5549 5550 5551 [For the copyright registration, what country are you a citizen of?] 5552 5553 5554 [What year were you born?] 5555 5556 5557 [Please write your email address here.] 5558 5559 5560 [Please write your postal address here.] 5561 5562 5563 5564 5565 5566 [Which files have you changed so far, and which new files have you written 5567 so far?] 5568 5569 5570 5571 File: docv6TKvo.info, Node: Acknowledgements, Next: GNU Free Documentation License, Prev: Contributing, Up: Top 5572 5573 12 Acknowledgements 5574 ******************* 5575 5576 The Modus themes are a collective effort. Every bit of work matters. 5577 5578 Author/maintainer 5579 Protesilaos Stavrou. 5580 5581 Contributions to code or documentation 5582 Aleksei Gusev, Alex Griffin, Anders Johansson, Antonio Ruiz, Basil 5583 L. Contovounesios, Björn Lindström, Carlo Zancanaro, Christian 5584 Tietze, Daniel Mendler, David Edmondson, Eli Zaretskii, Fritz 5585 Grabo, Gautier Ponsinet, Illia Ostapyshyn, Kévin Le Gouguec, Koen 5586 van Greevenbroek, Kostadin Ninev, Madhavan Krishnan, Manuel Giraud, 5587 Markus Beppler, Matthew Stevenson, Mauro Aranda, Nacho Barrientos, 5588 Niall Dooley, Nicolas De Jaeghere, Paul David, Philip Kaludercic, 5589 Pierre Téchoueyres, Rudolf Adamkovič, Sergey Nichiporchik, Shreyas 5590 Ragavan, Stefan Kangas, Stephen Berman, Stephen Gildea, Steve 5591 Downey, Tomasz Hołubowicz, Utkarsh Singh, Vincent Murphy, Xinglu 5592 Chen, Yuanchen Xie, fluentpwn, okamsn. 5593 5594 Ideas and user feedback 5595 Aaron Jensen, Adam Porter, Adam Spiers, Adrian Manea, Aleksei 5596 Pirogov, Alex Griffin, Alex Koen, Alex Peitsinis, Alexey Shmalko, 5597 Alok Singh, Anders Johansson, André Alexandre Gomes, Andrew Tropin, 5598 Antonio Hernández Blas, Arif Rezai, Augusto Stoffel, Basil L. 5599 Contovounesios, Bernd Rellermeyer, Burgess Chang, Charlotte Van 5600 Petegem, Christian Tietze, Christopher Dimech, Christopher League, 5601 Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, 5602 Davor Rotim, Divan Santana, Eliraz Kedmi, Emanuele Michele Alberto 5603 Monterosso, Farasha Euker, Feng Shu, Gautier Ponsinet, Gerry 5604 Agbobada, Gianluca Recchia, Gonçalo Marrafa, Guilherme Semente, 5605 Gustavo Barros, Hörmetjan Yiltiz, Ilja Kocken, Imran Khan, Iris 5606 Garcia, Ivan Popovych, James Ferguson, Jeremy Friesen, Jerry Zhang, 5607 Johannes Grødem, John Haman, John Wick, Jonas Collberg, Jorge 5608 Morais, Joshua O’Connor, Julio C. Villasante, Kenta Usami, Kevin 5609 Fleming, Kévin Le Gouguec, Kevin Kainan Li, Kostadin Ninev, Laith 5610 Bahodi, Lasse Lindner, Len Trigg, Lennart C. Karssen, Luis Miguel 5611 Castañeda, Magne Hov, Manuel Giraud, Manuel Uberti, Mark Bestley, 5612 Mark Burton, Mark Simpson, Marko Kocic, Markus Beppler, Matt 5613 Armstrong, Matthias Fuchs, Mattias Engdegård, Mauro Aranda, Maxime 5614 Tréca, Michael Goldenberg, Morgan Smith, Morgan Willcock, Murilo 5615 Pereira, Nicky van Foreest, Nicolas De Jaeghere, Nicolas Semrau, 5616 Olaf Meeuwissen, Oliver Epper, Pablo Stafforini, Paul Poloskov, 5617 Pengji Zhang, Pete Kazmier, Peter Wu, Philip Kaludercic, Pierre 5618 Téchoueyres, Przemysław Kryger, Robert Hepple, Roman Rudakov, 5619 Russell Sim, Ryan Phillips, Rytis Paškauskas, Rudolf Adamkovič, Sam 5620 Kleinman, Samuel Culpepper, Saša Janiška, Shreyas Ragavan, Simon 5621 Pugnet, Steve Downey, Tassilo Horn, Thanos Apollo, Thibaut Verron, 5622 Thomas Heartman, Togan Muftuoglu, Tony Zorman, Trey Merkley, Tomasz 5623 Hołubowicz, Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley, 5624 Zoltan Kiraly. As well as users: Ben, CsBigDataHub1, Emacs 5625 Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, Summer Emacs, 5626 TheBlob42, TitusMu, Trey, bepolymathe, bit9tream, bangedorrunt, 5627 derek-upham, doolio, fleimgruber, gitrj95, iSeeU, jixiuf, ltmsyvag, 5628 okamsn, pRot0ta1p, soaringbird, tumashu, wakamenod. 5629 5630 Packaging 5631 Basil L. Contovounesios, Eli Zaretskii, Glenn Morris, Mauro Aranda, 5632 Richard Stallman, Stefan Kangas (core Emacs), Stefan Monnier (GNU 5633 Elpa), André Alexandre Gomes, Andrew Tropin, Dimakakos Dimos, 5634 Morgan Smith, Nicolas Goaziou (Guix), Dhavan Vaidya (Debian). 5635 5636 Inspiration for certain features 5637 Bozhidar Batsov (zenburn-theme), Fabrice Niessen (leuven-theme). 5638 5639 Special thanks (from A-Z) to Daniel Mendler, Gustavo Barros, Manuel 5640 Uberti, Nicolas De Jaeghere, and Omar Antolín Camarena for their long 5641 time contributions and insightful commentary on key aspects of the 5642 themes’ design and/or aspects of their functionality. 5643 5644 All errors are my own. 5645 5646 5647 File: docv6TKvo.info, Node: GNU Free Documentation License, Next: Indices, Prev: Acknowledgements, Up: Top 5648 5649 Appendix A GNU Free Documentation License 5650 ***************************************** 5651 5652 Version 1.3, 3 November 2008 5653 5654 Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 5655 <https://fsf.org/> 5656 5657 Everyone is permitted to copy and distribute verbatim copies 5658 of this license document, but changing it is not allowed. 5659 5660 0. PREAMBLE 5661 5662 The purpose of this License is to make a manual, textbook, or other 5663 functional and useful document “free” in the sense of freedom: to 5664 assure everyone the effective freedom to copy and redistribute it, 5665 with or without modifying it, either commercially or 5666 noncommercially. Secondarily, this License preserves for the 5667 author and publisher a way to get credit for their work, while not 5668 being considered responsible for modifications made by others. 5669 5670 This License is a kind of “copyleft”, which means that derivative 5671 works of the document must themselves be free in the same sense. 5672 It complements the GNU General Public License, which is a copyleft 5673 license designed for free software. 5674 5675 We have designed this License in order to use it for manuals for 5676 free software, because free software needs free documentation: a 5677 free program should come with manuals providing the same freedoms 5678 that the software does. But this License is not limited to 5679 software manuals; it can be used for any textual work, regardless 5680 of subject matter or whether it is published as a printed book. We 5681 recommend this License principally for works whose purpose is 5682 instruction or reference. 5683 5684 1. APPLICABILITY AND DEFINITIONS 5685 5686 This License applies to any manual or other work, in any medium, 5687 that contains a notice placed by the copyright holder saying it can 5688 be distributed under the terms of this License. Such a notice 5689 grants a world-wide, royalty-free license, unlimited in duration, 5690 to use that work under the conditions stated herein. The 5691 “Document”, below, refers to any such manual or work. Any member 5692 of the public is a licensee, and is addressed as “you”. You accept 5693 the license if you copy, modify or distribute the work in a way 5694 requiring permission under copyright law. 5695 5696 A “Modified Version” of the Document means any work containing the 5697 Document or a portion of it, either copied verbatim, or with 5698 modifications and/or translated into another language. 5699 5700 A “Secondary Section” is a named appendix or a front-matter section 5701 of the Document that deals exclusively with the relationship of the 5702 publishers or authors of the Document to the Document’s overall 5703 subject (or to related matters) and contains nothing that could 5704 fall directly within that overall subject. (Thus, if the Document 5705 is in part a textbook of mathematics, a Secondary Section may not 5706 explain any mathematics.) The relationship could be a matter of 5707 historical connection with the subject or with related matters, or 5708 of legal, commercial, philosophical, ethical or political position 5709 regarding them. 5710 5711 The “Invariant Sections” are certain Secondary Sections whose 5712 titles are designated, as being those of Invariant Sections, in the 5713 notice that says that the Document is released under this License. 5714 If a section does not fit the above definition of Secondary then it 5715 is not allowed to be designated as Invariant. The Document may 5716 contain zero Invariant Sections. If the Document does not identify 5717 any Invariant Sections then there are none. 5718 5719 The “Cover Texts” are certain short passages of text that are 5720 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 5721 that says that the Document is released under this License. A 5722 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 5723 be at most 25 words. 5724 5725 A “Transparent” copy of the Document means a machine-readable copy, 5726 represented in a format whose specification is available to the 5727 general public, that is suitable for revising the document 5728 straightforwardly with generic text editors or (for images composed 5729 of pixels) generic paint programs or (for drawings) some widely 5730 available drawing editor, and that is suitable for input to text 5731 formatters or for automatic translation to a variety of formats 5732 suitable for input to text formatters. A copy made in an otherwise 5733 Transparent file format whose markup, or absence of markup, has 5734 been arranged to thwart or discourage subsequent modification by 5735 readers is not Transparent. An image format is not Transparent if 5736 used for any substantial amount of text. A copy that is not 5737 “Transparent” is called “Opaque”. 5738 5739 Examples of suitable formats for Transparent copies include plain 5740 ASCII without markup, Texinfo input format, LaTeX input format, 5741 SGML or XML using a publicly available DTD, and standard-conforming 5742 simple HTML, PostScript or PDF designed for human modification. 5743 Examples of transparent image formats include PNG, XCF and JPG. 5744 Opaque formats include proprietary formats that can be read and 5745 edited only by proprietary word processors, SGML or XML for which 5746 the DTD and/or processing tools are not generally available, and 5747 the machine-generated HTML, PostScript or PDF produced by some word 5748 processors for output purposes only. 5749 5750 The “Title Page” means, for a printed book, the title page itself, 5751 plus such following pages as are needed to hold, legibly, the 5752 material this License requires to appear in the title page. For 5753 works in formats which do not have any title page as such, “Title 5754 Page” means the text near the most prominent appearance of the 5755 work’s title, preceding the beginning of the body of the text. 5756 5757 The “publisher” means any person or entity that distributes copies 5758 of the Document to the public. 5759 5760 A section “Entitled XYZ” means a named subunit of the Document 5761 whose title either is precisely XYZ or contains XYZ in parentheses 5762 following text that translates XYZ in another language. (Here XYZ 5763 stands for a specific section name mentioned below, such as 5764 “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) 5765 To “Preserve the Title” of such a section when you modify the 5766 Document means that it remains a section “Entitled XYZ” according 5767 to this definition. 5768 5769 The Document may include Warranty Disclaimers next to the notice 5770 which states that this License applies to the Document. These 5771 Warranty Disclaimers are considered to be included by reference in 5772 this License, but only as regards disclaiming warranties: any other 5773 implication that these Warranty Disclaimers may have is void and 5774 has no effect on the meaning of this License. 5775 5776 2. VERBATIM COPYING 5777 5778 You may copy and distribute the Document in any medium, either 5779 commercially or noncommercially, provided that this License, the 5780 copyright notices, and the license notice saying this License 5781 applies to the Document are reproduced in all copies, and that you 5782 add no other conditions whatsoever to those of this License. You 5783 may not use technical measures to obstruct or control the reading 5784 or further copying of the copies you make or distribute. However, 5785 you may accept compensation in exchange for copies. If you 5786 distribute a large enough number of copies you must also follow the 5787 conditions in section 3. 5788 5789 You may also lend copies, under the same conditions stated above, 5790 and you may publicly display copies. 5791 5792 3. COPYING IN QUANTITY 5793 5794 If you publish printed copies (or copies in media that commonly 5795 have printed covers) of the Document, numbering more than 100, and 5796 the Document’s license notice requires Cover Texts, you must 5797 enclose the copies in covers that carry, clearly and legibly, all 5798 these Cover Texts: Front-Cover Texts on the front cover, and 5799 Back-Cover Texts on the back cover. Both covers must also clearly 5800 and legibly identify you as the publisher of these copies. The 5801 front cover must present the full title with all words of the title 5802 equally prominent and visible. You may add other material on the 5803 covers in addition. Copying with changes limited to the covers, as 5804 long as they preserve the title of the Document and satisfy these 5805 conditions, can be treated as verbatim copying in other respects. 5806 5807 If the required texts for either cover are too voluminous to fit 5808 legibly, you should put the first ones listed (as many as fit 5809 reasonably) on the actual cover, and continue the rest onto 5810 adjacent pages. 5811 5812 If you publish or distribute Opaque copies of the Document 5813 numbering more than 100, you must either include a machine-readable 5814 Transparent copy along with each Opaque copy, or state in or with 5815 each Opaque copy a computer-network location from which the general 5816 network-using public has access to download using public-standard 5817 network protocols a complete Transparent copy of the Document, free 5818 of added material. If you use the latter option, you must take 5819 reasonably prudent steps, when you begin distribution of Opaque 5820 copies in quantity, to ensure that this Transparent copy will 5821 remain thus accessible at the stated location until at least one 5822 year after the last time you distribute an Opaque copy (directly or 5823 through your agents or retailers) of that edition to the public. 5824 5825 It is requested, but not required, that you contact the authors of 5826 the Document well before redistributing any large number of copies, 5827 to give them a chance to provide you with an updated version of the 5828 Document. 5829 5830 4. MODIFICATIONS 5831 5832 You may copy and distribute a Modified Version of the Document 5833 under the conditions of sections 2 and 3 above, provided that you 5834 release the Modified Version under precisely this License, with the 5835 Modified Version filling the role of the Document, thus licensing 5836 distribution and modification of the Modified Version to whoever 5837 possesses a copy of it. In addition, you must do these things in 5838 the Modified Version: 5839 5840 A. Use in the Title Page (and on the covers, if any) a title 5841 distinct from that of the Document, and from those of previous 5842 versions (which should, if there were any, be listed in the 5843 History section of the Document). You may use the same title 5844 as a previous version if the original publisher of that 5845 version gives permission. 5846 5847 B. List on the Title Page, as authors, one or more persons or 5848 entities responsible for authorship of the modifications in 5849 the Modified Version, together with at least five of the 5850 principal authors of the Document (all of its principal 5851 authors, if it has fewer than five), unless they release you 5852 from this requirement. 5853 5854 C. State on the Title page the name of the publisher of the 5855 Modified Version, as the publisher. 5856 5857 D. Preserve all the copyright notices of the Document. 5858 5859 E. Add an appropriate copyright notice for your modifications 5860 adjacent to the other copyright notices. 5861 5862 F. Include, immediately after the copyright notices, a license 5863 notice giving the public permission to use the Modified 5864 Version under the terms of this License, in the form shown in 5865 the Addendum below. 5866 5867 G. Preserve in that license notice the full lists of Invariant 5868 Sections and required Cover Texts given in the Document’s 5869 license notice. 5870 5871 H. Include an unaltered copy of this License. 5872 5873 I. Preserve the section Entitled “History”, Preserve its Title, 5874 and add to it an item stating at least the title, year, new 5875 authors, and publisher of the Modified Version as given on the 5876 Title Page. If there is no section Entitled “History” in the 5877 Document, create one stating the title, year, authors, and 5878 publisher of the Document as given on its Title Page, then add 5879 an item describing the Modified Version as stated in the 5880 previous sentence. 5881 5882 J. Preserve the network location, if any, given in the Document 5883 for public access to a Transparent copy of the Document, and 5884 likewise the network locations given in the Document for 5885 previous versions it was based on. These may be placed in the 5886 “History” section. You may omit a network location for a work 5887 that was published at least four years before the Document 5888 itself, or if the original publisher of the version it refers 5889 to gives permission. 5890 5891 K. For any section Entitled “Acknowledgements” or “Dedications”, 5892 Preserve the Title of the section, and preserve in the section 5893 all the substance and tone of each of the contributor 5894 acknowledgements and/or dedications given therein. 5895 5896 L. Preserve all the Invariant Sections of the Document, unaltered 5897 in their text and in their titles. Section numbers or the 5898 equivalent are not considered part of the section titles. 5899 5900 M. Delete any section Entitled “Endorsements”. Such a section 5901 may not be included in the Modified Version. 5902 5903 N. Do not retitle any existing section to be Entitled 5904 “Endorsements” or to conflict in title with any Invariant 5905 Section. 5906 5907 O. Preserve any Warranty Disclaimers. 5908 5909 If the Modified Version includes new front-matter sections or 5910 appendices that qualify as Secondary Sections and contain no 5911 material copied from the Document, you may at your option designate 5912 some or all of these sections as invariant. To do this, add their 5913 titles to the list of Invariant Sections in the Modified Version’s 5914 license notice. These titles must be distinct from any other 5915 section titles. 5916 5917 You may add a section Entitled “Endorsements”, provided it contains 5918 nothing but endorsements of your Modified Version by various 5919 parties—for example, statements of peer review or that the text has 5920 been approved by an organization as the authoritative definition of 5921 a standard. 5922 5923 You may add a passage of up to five words as a Front-Cover Text, 5924 and a passage of up to 25 words as a Back-Cover Text, to the end of 5925 the list of Cover Texts in the Modified Version. Only one passage 5926 of Front-Cover Text and one of Back-Cover Text may be added by (or 5927 through arrangements made by) any one entity. If the Document 5928 already includes a cover text for the same cover, previously added 5929 by you or by arrangement made by the same entity you are acting on 5930 behalf of, you may not add another; but you may replace the old 5931 one, on explicit permission from the previous publisher that added 5932 the old one. 5933 5934 The author(s) and publisher(s) of the Document do not by this 5935 License give permission to use their names for publicity for or to 5936 assert or imply endorsement of any Modified Version. 5937 5938 5. COMBINING DOCUMENTS 5939 5940 You may combine the Document with other documents released under 5941 this License, under the terms defined in section 4 above for 5942 modified versions, provided that you include in the combination all 5943 of the Invariant Sections of all of the original documents, 5944 unmodified, and list them all as Invariant Sections of your 5945 combined work in its license notice, and that you preserve all 5946 their Warranty Disclaimers. 5947 5948 The combined work need only contain one copy of this License, and 5949 multiple identical Invariant Sections may be replaced with a single 5950 copy. If there are multiple Invariant Sections with the same name 5951 but different contents, make the title of each such section unique 5952 by adding at the end of it, in parentheses, the name of the 5953 original author or publisher of that section if known, or else a 5954 unique number. Make the same adjustment to the section titles in 5955 the list of Invariant Sections in the license notice of the 5956 combined work. 5957 5958 In the combination, you must combine any sections Entitled 5959 “History” in the various original documents, forming one section 5960 Entitled “History”; likewise combine any sections Entitled 5961 “Acknowledgements”, and any sections Entitled “Dedications”. You 5962 must delete all sections Entitled “Endorsements.” 5963 5964 6. COLLECTIONS OF DOCUMENTS 5965 5966 You may make a collection consisting of the Document and other 5967 documents released under this License, and replace the individual 5968 copies of this License in the various documents with a single copy 5969 that is included in the collection, provided that you follow the 5970 rules of this License for verbatim copying of each of the documents 5971 in all other respects. 5972 5973 You may extract a single document from such a collection, and 5974 distribute it individually under this License, provided you insert 5975 a copy of this License into the extracted document, and follow this 5976 License in all other respects regarding verbatim copying of that 5977 document. 5978 5979 7. AGGREGATION WITH INDEPENDENT WORKS 5980 5981 A compilation of the Document or its derivatives with other 5982 separate and independent documents or works, in or on a volume of a 5983 storage or distribution medium, is called an “aggregate” if the 5984 copyright resulting from the compilation is not used to limit the 5985 legal rights of the compilation’s users beyond what the individual 5986 works permit. When the Document is included in an aggregate, this 5987 License does not apply to the other works in the aggregate which 5988 are not themselves derivative works of the Document. 5989 5990 If the Cover Text requirement of section 3 is applicable to these 5991 copies of the Document, then if the Document is less than one half 5992 of the entire aggregate, the Document’s Cover Texts may be placed 5993 on covers that bracket the Document within the aggregate, or the 5994 electronic equivalent of covers if the Document is in electronic 5995 form. Otherwise they must appear on printed covers that bracket 5996 the whole aggregate. 5997 5998 8. TRANSLATION 5999 6000 Translation is considered a kind of modification, so you may 6001 distribute translations of the Document under the terms of section 6002 4. Replacing Invariant Sections with translations requires special 6003 permission from their copyright holders, but you may include 6004 translations of some or all Invariant Sections in addition to the 6005 original versions of these Invariant Sections. You may include a 6006 translation of this License, and all the license notices in the 6007 Document, and any Warranty Disclaimers, provided that you also 6008 include the original English version of this License and the 6009 original versions of those notices and disclaimers. In case of a 6010 disagreement between the translation and the original version of 6011 this License or a notice or disclaimer, the original version will 6012 prevail. 6013 6014 If a section in the Document is Entitled “Acknowledgements”, 6015 “Dedications”, or “History”, the requirement (section 4) to 6016 Preserve its Title (section 1) will typically require changing the 6017 actual title. 6018 6019 9. TERMINATION 6020 6021 You may not copy, modify, sublicense, or distribute the Document 6022 except as expressly provided under this License. Any attempt 6023 otherwise to copy, modify, sublicense, or distribute it is void, 6024 and will automatically terminate your rights under this License. 6025 6026 However, if you cease all violation of this License, then your 6027 license from a particular copyright holder is reinstated (a) 6028 provisionally, unless and until the copyright holder explicitly and 6029 finally terminates your license, and (b) permanently, if the 6030 copyright holder fails to notify you of the violation by some 6031 reasonable means prior to 60 days after the cessation. 6032 6033 Moreover, your license from a particular copyright holder is 6034 reinstated permanently if the copyright holder notifies you of the 6035 violation by some reasonable means, this is the first time you have 6036 received notice of violation of this License (for any work) from 6037 that copyright holder, and you cure the violation prior to 30 days 6038 after your receipt of the notice. 6039 6040 Termination of your rights under this section does not terminate 6041 the licenses of parties who have received copies or rights from you 6042 under this License. If your rights have been terminated and not 6043 permanently reinstated, receipt of a copy of some or all of the 6044 same material does not give you any rights to use it. 6045 6046 10. FUTURE REVISIONS OF THIS LICENSE 6047 6048 The Free Software Foundation may publish new, revised versions of 6049 the GNU Free Documentation License from time to time. Such new 6050 versions will be similar in spirit to the present version, but may 6051 differ in detail to address new problems or concerns. See 6052 <https://www.gnu.org/licenses/>. 6053 6054 Each version of the License is given a distinguishing version 6055 number. If the Document specifies that a particular numbered 6056 version of this License “or any later version” applies to it, you 6057 have the option of following the terms and conditions either of 6058 that specified version or of any later version that has been 6059 published (not as a draft) by the Free Software Foundation. If the 6060 Document does not specify a version number of this License, you may 6061 choose any version ever published (not as a draft) by the Free 6062 Software Foundation. If the Document specifies that a proxy can 6063 decide which future versions of this License can be used, that 6064 proxy’s public statement of acceptance of a version permanently 6065 authorizes you to choose that version for the Document. 6066 6067 11. RELICENSING 6068 6069 “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any 6070 World Wide Web server that publishes copyrightable works and also 6071 provides prominent facilities for anybody to edit those works. A 6072 public wiki that anybody can edit is an example of such a server. 6073 A “Massive Multiauthor Collaboration” (or “MMC”) contained in the 6074 site means any set of copyrightable works thus published on the MMC 6075 site. 6076 6077 “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 6078 license published by Creative Commons Corporation, a not-for-profit 6079 corporation with a principal place of business in San Francisco, 6080 California, as well as future copyleft versions of that license 6081 published by that same organization. 6082 6083 “Incorporate” means to publish or republish a Document, in whole or 6084 in part, as part of another Document. 6085 6086 An MMC is “eligible for relicensing” if it is licensed under this 6087 License, and if all works that were first published under this 6088 License somewhere other than this MMC, and subsequently 6089 incorporated in whole or in part into the MMC, (1) had no cover 6090 texts or invariant sections, and (2) were thus incorporated prior 6091 to November 1, 2008. 6092 6093 The operator of an MMC Site may republish an MMC contained in the 6094 site under CC-BY-SA on the same site at any time before August 1, 6095 2009, provided the MMC is eligible for relicensing. 6096 6097 ADDENDUM: How to use this License for your documents 6098 ==================================================== 6099 6100 To use this License in a document you have written, include a copy of 6101 the License in the document and put the following copyright and license 6102 notices just after the title page: 6103 6104 Copyright (C) YEAR YOUR NAME. 6105 Permission is granted to copy, distribute and/or modify this document 6106 under the terms of the GNU Free Documentation License, Version 1.3 6107 or any later version published by the Free Software Foundation; 6108 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 6109 Texts. A copy of the license is included in the section entitled ``GNU 6110 Free Documentation License''. 6111 6112 If you have Invariant Sections, Front-Cover Texts and Back-Cover 6113 Texts, replace the “with...Texts.” line with this: 6114 6115 with the Invariant Sections being LIST THEIR TITLES, with 6116 the Front-Cover Texts being LIST, and with the Back-Cover Texts 6117 being LIST. 6118 6119 If you have Invariant Sections without Cover Texts, or some other 6120 combination of the three, merge those two alternatives to suit the 6121 situation. 6122 6123 If your document contains nontrivial examples of program code, we 6124 recommend releasing these examples in parallel under your choice of free 6125 software license, such as the GNU General Public License, to permit 6126 their use in free software. 6127 6128 6129 File: docv6TKvo.info, Node: Indices, Prev: GNU Free Documentation License, Up: Top 6130 6131 B Indices 6132 ********* 6133 6134 * Menu: 6135 6136 * Function index:: 6137 * Variable index:: 6138 * Concept index:: 6139 6140 6141 File: docv6TKvo.info, Node: Function index, Next: Variable index, Up: Indices 6142 6143 B.1 Function index 6144 ================== 6145 6146 6147 * Menu: 6148 6149 * modus-themes-contrast: DIY Measure color contrast. 6150 (line 6) 6151 * modus-themes-get-color-value: Get a single color from the palette with modus-themes-get-color-value. 6152 (line 6) 6153 * modus-themes-list-colors: Preview theme colors. (line 6) 6154 * modus-themes-list-colors-current: Preview theme colors. (line 12) 6155 * modus-themes-load-theme: Enable and load. (line 79) 6156 * modus-themes-preview-colors: Preview theme colors. (line 25) 6157 * modus-themes-preview-colors-current: Preview theme colors. (line 25) 6158 * modus-themes-select: Enable and load. (line 93) 6159 * modus-themes-toggle: Enable and load. (line 93) 6160 * modus-themes-wcag-formula: DIY Measure color contrast. 6161 (line 6) 6162 * modus-themes-with-colors: Use theme colors in code with modus-themes-with-colors. 6163 (line 10) 6164 6165 6166 File: docv6TKvo.info, Node: Variable index, Next: Concept index, Prev: Function index, Up: Indices 6167 6168 B.2 Variable index 6169 ================== 6170 6171 6172 * Menu: 6173 6174 * modus-operandi-deuteranopia-palette-overrides: Palette overrides. 6175 (line 30) 6176 * modus-operandi-palette-overrides: Palette overrides. (line 28) 6177 * modus-operandi-tinted-palette-overrides: Palette overrides. (line 32) 6178 * modus-operandi-tritanopia-palette-overrides: Palette overrides. 6179 (line 34) 6180 * modus-themes-after-load-theme-hook: Enable and load. (line 85) 6181 * modus-themes-bold-constructs: Bold constructs. (line 6) 6182 * modus-themes-common-palette-overrides: Palette overrides. (line 22) 6183 * modus-themes-completions: Completion UIs. (line 6) 6184 * modus-themes-custom-auto-reload: Custom reload theme. (line 6) 6185 * modus-themes-disable-other-themes: Disable other themes. (line 6) 6186 * modus-themes-headings: Heading styles. (line 6) 6187 * modus-themes-italic-constructs: Italic constructs. (line 6) 6188 * modus-themes-mixed-fonts: Mixed fonts. (line 6) 6189 * modus-themes-org-blocks: Org mode blocks. (line 6) 6190 * modus-themes-post-load-hook: Enable and load. (line 85) 6191 * modus-themes-preset-overrides-cooler: DIY Palette override presets. 6192 (line 29) 6193 * modus-themes-preset-overrides-faint: DIY Palette override presets. 6194 (line 16) 6195 * modus-themes-preset-overrides-intense: DIY Palette override presets. 6196 (line 25) 6197 * modus-themes-preset-overrides-warmer: DIY Palette override presets. 6198 (line 29) 6199 * modus-themes-prompts: Command prompts. (line 6) 6200 * modus-themes-to-toggle: Option for which themes to toggle. 6201 (line 6) 6202 * modus-themes-variable-pitch-ui: UI typeface. (line 6) 6203 * modus-vivendi-deuteranopia-palette-overrides: Palette overrides. 6204 (line 38) 6205 * modus-vivendi-palette-overrides: Palette overrides. (line 36) 6206 * modus-vivendi-tinted-palette-overrides: Palette overrides. (line 40) 6207 * modus-vivendi-tritanopia-palette-overrides: Palette overrides. 6208 (line 42) 6209 6210 6211 File: docv6TKvo.info, Node: Concept index, Prev: Variable index, Up: Indices 6212 6213 B.3 Concept index 6214 ================= 6215 6216 6217 * Menu: 6218 6219 * Avoiding exaggerations in design: What does it mean to avoid exaggerations?. 6220 (line 6) 6221 * Bold and italic fonts: DIY Configure bold and italic faces. 6222 (line 6) 6223 * Changelog: Learn about the latest changes. 6224 (line 6) 6225 * Color accuracy of terminal emulators: DIY More accurate colors in terminal emulators. 6226 (line 6) 6227 * Color contrast: DIY Measure color contrast. 6228 (line 6) 6229 * Contrast between adjacent colors: Is the contrast ratio about adjacent colors?. 6230 (line 6) 6231 * Contributing: Issues you can help with. 6232 (line 6) 6233 * Contributors: Acknowledgements. (line 6) 6234 * Essential configuration: Enable and load. (line 6) 6235 * Explicitly supported packages: Supported packages. (line 6) 6236 * Font configurations: DIY Font configurations for Org and others. 6237 (line 6) 6238 * Fonts in EWW, Elfeed, Ement, and SHR: Note on SHR fonts. (line 6) 6239 * Frequently Asked Questions: Frequently Asked Questions. 6240 (line 6) 6241 * General setup for readability: What is the best setup for legibility?. 6242 (line 6) 6243 * Implicitly supported packages: Indirectly covered packages. 6244 (line 6) 6245 * Innate color qualities of the palette: Why are colors mostly variants of blue magenta cyan?. 6246 (line 6) 6247 * load-theme VS enable-theme: Differences between loading and enabling. 6248 (line 6) 6249 * Org custom emphasis faces: DIY Custom Org emphasis faces. 6250 (line 6) 6251 * Org custom todo faces: DIY Custom Org todo keyword and priority faces. 6252 (line 6) 6253 * Porting the themes to other editors: Port the Modus themes to other platforms?. 6254 (line 6) 6255 * Preview named colors or semantic color mappings: Preview theme colors. 6256 (line 6) 6257 * Pure white and pure black in terminal emulators: DIY Range of color with terminal emulators. 6258 (line 6) 6259 * Remapping faces: DIY Remap face with local value. 6260 (line 6) 6261 * Remapping pdf-tools backdrop: DIY Backdrop for pdf-tools. 6262 (line 6) 6263 * sample configuration: Sample configuration with and without use-package. 6264 (line 6) 6265 * Screenshots: How do the themes look like. 6266 (line 6) 6267 * Sources of the themes: Sources of the themes. (line 6) 6268 * Switch themes without load-theme: DIY Toggle themes without reloading them. 6269 (line 6) 6270 * Themes, not color schemes: Are these color schemes?. 6271 (line 6) 6272 * Use colors from the palette anywhere: Use theme colors in code with modus-themes-with-colors. 6273 (line 6) 6274 * use-package configuration: Sample configuration with and without use-package. 6275 (line 6) 6276 6277 6278 6279 Tag Table: 6280 Node: Top869 6281 Node: Overview8407 6282 Node: How do the themes look like11176 6283 Node: Learn about the latest changes11532 6284 Node: Installation11917 6285 Node: Install manually from source12844 6286 Node: Install from the archives13666 6287 Node: Install on GNU/Linux14262 6288 Node: Debian 11 Bullseye14752 6289 Node: GNU Guix15159 6290 Node: Dealing with byte compilation errors15439 6291 Node: Enable and load16594 6292 Node: The require-theme for built-in Emacs themes20535 6293 Node: Sample configuration with and without use-package21652 6294 Node: Differences between loading and enabling24497 6295 Node: Customization options26626 6296 Node: Custom reload theme30407 6297 Node: Disable other themes31324 6298 Node: Bold constructs32563 6299 Node: Italic constructs33432 6300 Node: Option for which themes to toggle34257 6301 Node: Mixed fonts35029 6302 Node: Command prompts36080 6303 Node: Completion UIs37920 6304 Node: Org mode blocks40768 6305 Node: Heading styles41408 6306 Node: UI typeface45835 6307 Node: Palette overrides46805 6308 Node: Preview theme colors51166 6309 Node: Use colors from the Modus themes palette52976 6310 Node: Get a single color from the palette with modus-themes-get-color-value53837 6311 Node: Use theme colors in code with modus-themes-with-colors56196 6312 Node: Advanced customization58449 6313 Node: DIY Palette override presets60105 6314 Node: DIY Stylistic variants using palette overrides62957 6315 Node: DIY Make the mode line borderless65008 6316 Node: DIY Make the active mode line colorful66380 6317 Node: DIY Make the tab bar more or less colorful68595 6318 Node: DIY Make the fringe invisible or another color70529 6319 Node: DIY Make links use subtle or no underlines71727 6320 Node: DIY Make prompts more or less colorful72842 6321 Node: DIY Make completion matches more or less colorful74162 6322 Node: DIY Make comments yellow and strings green77718 6323 Node: DIY Make code syntax use the old alt-syntax style79424 6324 Node: DIY Make use of alternative styles for code syntax82544 6325 Node: DIY Make matching parenthesis more or less intense86003 6326 Node: DIY Make box buttons more or less gray87372 6327 Node: DIY Make TODO and DONE more or less intense88382 6328 Node: DIY Make headings more or less colorful89880 6329 Node: DIY Make Org block colors more or less colorful91994 6330 Node: DIY Make Org agenda more or less colorful96365 6331 Node: DIY Make inline code in prose use alternative styles99537 6332 Node: DIY Make mail citations and headers more or less colorful101776 6333 Node: DIY Make the region preserve text colors plus other styles104173 6334 Node: DIY Make mouse highlights more or less colorful105726 6335 Node: DIY Make language underlines less colorful106736 6336 Node: DIY Make line numbers use alternative styles107885 6337 Node: DIY Make diffs use only a foreground109525 6338 Node: DIY Make deuteranopia diffs red and blue instead of yellow and blue112413 6339 Node: DIY More accurate colors in terminal emulators114890 6340 Node: DIY Range of color with terminal emulators116199 6341 Node: DIY Per-theme customization settings118989 6342 Node: DIY Do not extend the region background120419 6343 Node: DIY Add padding to the mode line121220 6344 Node: DIY Remap face with local value124150 6345 Node: DIY Font configurations for Org and others126695 6346 Ref: DIY Font configurations for Org and others-Footnote-1129675 6347 Node: DIY Configure bold and italic faces129862 6348 Node: DIY Custom Org todo keyword and priority faces134481 6349 Node: DIY Custom Org emphasis faces138221 6350 Node: DIY Use colored Org source blocks per language143099 6351 Node: DIY Measure color contrast147736 6352 Node: DIY Load theme depending on time of day150453 6353 Node: DIY Backdrop for pdf-tools151480 6354 Node: DIY Toggle themes without reloading them154646 6355 Node: DIY Use more spacious margins or padding in Emacs frames155952 6356 Node: DIY Custom hl-todo colors160206 6357 Node: DIY Add support for solaire-mode162020 6358 Node: DIY Use a hook at the post-load-theme phase165143 6359 Node: DIY A theme-agnostic hook for theme loading167264 6360 Node: Face coverage169892 6361 Node: Supported packages170341 6362 Node: Indirectly covered packages175952 6363 Node: Notes on individual packages177318 6364 Node: Note on calendarel weekday and weekend colors178415 6365 Node: Note on git-gutter in Doom Emacs179560 6366 Node: Note on php-mode multiline comments182057 6367 Node: Note on underlines in compilation buffers182814 6368 Node: Note on inline Latex in Org buffers183683 6369 Node: Note on dimmerel184290 6370 Node: Note on display-fill-column-indicator-mode185772 6371 Node: Note on highlight-parenthesesel187222 6372 Node: Note on mmm-modeel background colors193302 6373 Node: Note for prism195653 6374 Node: Note on company-mode overlay pop-up198872 6375 Ref: Note on company-mode overlay pop-up-Footnote-1199599 6376 Ref: Note on company-mode overlay pop-up-Footnote-2199666 6377 Node: Note on ERC escaped color sequences199721 6378 Ref: Note on ERC escaped color sequences-Footnote-1201146 6379 Node: Note on powerline or spaceline201256 6380 Node: Note on SHR colors201667 6381 Node: Note on SHR fonts202088 6382 Node: Note on Ement colors and fonts202772 6383 Node: Note on pdf-tools link hints204279 6384 Node: Note on the Notmuch logo206736 6385 Node: Note on goto-address-mode faces207271 6386 Node: Frequently Asked Questions208386 6387 Node: Is the contrast ratio about adjacent colors?209016 6388 Node: What does it mean to avoid exaggerations?210522 6389 Node: Why are colors mostly variants of blue magenta cyan?212371 6390 Node: What is the best setup for legibility?216702 6391 Node: Are these color schemes?219346 6392 Node: Port the Modus themes to other platforms?223027 6393 Node: Contributing225870 6394 Node: Sources of the themes226266 6395 Node: Issues you can help with227159 6396 Node: Patches require copyright assignment to the FSF228549 6397 Node: Acknowledgements230768 6398 Node: GNU Free Documentation License234935 6399 Node: Indices260296 6400 Node: Function index260472 6401 Node: Variable index261767 6402 Node: Concept index264458 6403 6404 End Tag Table 6405 6406 6407 Local Variables: 6408 coding: utf-8 6409 End: