diff options
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/modus-themes.org | 499 |
1 files changed, 406 insertions, 93 deletions
diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 9764a3467fa..001ed572186 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org | |||
| @@ -4,9 +4,9 @@ | |||
| 4 | #+language: en | 4 | #+language: en |
| 5 | #+options: ':t toc:nil author:t email:t | 5 | #+options: ':t toc:nil author:t email:t |
| 6 | 6 | ||
| 7 | #+macro: stable-version 1.2.3 | 7 | #+macro: stable-version 1.3.2 |
| 8 | #+macro: release-date 2021-03-05 | 8 | #+macro: release-date 2021-04-18 |
| 9 | #+macro: development-version 1.3.0-dev | 9 | #+macro: development-version 1.4.0-dev |
| 10 | #+macro: export-date (eval (format-time-string "%F %R %z" (current-time))) | 10 | #+macro: export-date (eval (format-time-string "%F %R %z" (current-time))) |
| 11 | #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ | 11 | #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ |
| 12 | #+macro: space @@texinfo:@: @@ | 12 | #+macro: space @@texinfo:@: @@ |
| @@ -46,11 +46,15 @@ built on {{{export-date}}}. | |||
| 46 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | 46 | Copyright (C) 2020-2021 Free Software Foundation, Inc. |
| 47 | 47 | ||
| 48 | #+begin_quote | 48 | #+begin_quote |
| 49 | Permission is granted to copy, distribute and/or modify this | 49 | Permission is granted to copy, distribute and/or modify this document |
| 50 | document under the terms of the GNU Free Documentation License, | 50 | under the terms of the GNU Free Documentation License, Version 1.3 or |
| 51 | Version 1.3 or any later version published by the Free Software | 51 | any later version published by the Free Software Foundation; with no |
| 52 | Foundation; with no Invariant Sections, with no Front-Cover Texts, | 52 | Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and |
| 53 | and with no Back-Cover Texts. | 53 | with the Back-Cover Texts as in (a) below. A copy of the license is |
| 54 | included in the section entitled “GNU Free Documentation License.” | ||
| 55 | |||
| 56 | (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and | ||
| 57 | modify this GNU manual.” | ||
| 54 | #+end_quote | 58 | #+end_quote |
| 55 | 59 | ||
| 56 | * Overview | 60 | * Overview |
| @@ -141,7 +145,7 @@ The themes are now ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][ | |||
| 141 | :custom_id: h:c4b10085-149f-43e2-bd4d-347f33aee054 | 145 | :custom_id: h:c4b10085-149f-43e2-bd4d-347f33aee054 |
| 142 | :end: | 146 | :end: |
| 143 | 147 | ||
| 144 | The =modus-themes= package is available from the GNU ELPA archive, which | 148 | The ~modus-themes~ package is available from the GNU ELPA archive, which |
| 145 | is configured by default. | 149 | is configured by default. |
| 146 | 150 | ||
| 147 | Prior to querying any package archive, make sure to have updated the | 151 | Prior to querying any package archive, make sure to have updated the |
| @@ -287,7 +291,8 @@ package configurations in their setup. We use this as an example: | |||
| 287 | :init | 291 | :init |
| 288 | ;; Add all your customizations prior to loading the themes | 292 | ;; Add all your customizations prior to loading the themes |
| 289 | (setq modus-themes-slanted-constructs t | 293 | (setq modus-themes-slanted-constructs t |
| 290 | modus-themes-bold-constructs nil) | 294 | modus-themes-bold-constructs nil |
| 295 | modus-themes-region 'no-extend) | ||
| 291 | 296 | ||
| 292 | ;; Load the theme files before enabling a theme (else you get an error). | 297 | ;; Load the theme files before enabling a theme (else you get an error). |
| 293 | (modus-themes-load-themes) | 298 | (modus-themes-load-themes) |
| @@ -374,13 +379,13 @@ Symbol: ~modus-themes-bold-constructs~ | |||
| 374 | 379 | ||
| 375 | Possible values: | 380 | Possible values: |
| 376 | 381 | ||
| 377 | 1. =nil= (default) | 382 | 1. ~nil~ (default) |
| 378 | 2. =t= | 383 | 2. ~t~ |
| 379 | 384 | ||
| 380 | The default is to use a bold typographic weight only when it is | 385 | The default is to use a bold typographic weight only when it is |
| 381 | required. | 386 | required. |
| 382 | 387 | ||
| 383 | With a non-nil value (=t=) display several syntactic constructs in bold | 388 | With a non-nil value (~t~) display several syntactic constructs in bold |
| 384 | weight. This concerns keywords and other important aspects of code | 389 | weight. This concerns keywords and other important aspects of code |
| 385 | syntax. It also affects certain mode line indicators and command-line | 390 | syntax. It also affects certain mode line indicators and command-line |
| 386 | prompts. | 391 | prompts. |
| @@ -397,13 +402,13 @@ Symbol: ~modus-themes-slanted-constructs~ | |||
| 397 | 402 | ||
| 398 | Possible values: | 403 | Possible values: |
| 399 | 404 | ||
| 400 | 1. =nil= (default) | 405 | 1. ~nil~ (default) |
| 401 | 2. =t= | 406 | 2. ~t~ |
| 402 | 407 | ||
| 403 | The default is to not use slanted text (italics) unless it is absolutely | 408 | The default is to not use slanted text (italics) unless it is absolutely |
| 404 | necessary. | 409 | necessary. |
| 405 | 410 | ||
| 406 | With a non-nil value (=t=) choose to render more faces in slanted text. | 411 | With a non-nil value (~t~) choose to render more faces in slanted text. |
| 407 | This typically affects documentation strings and code comments. | 412 | This typically affects documentation strings and code comments. |
| 408 | 413 | ||
| 409 | ** Option for syntax highlighting | 414 | ** Option for syntax highlighting |
| @@ -418,7 +423,7 @@ Symbol: ~modus-themes-syntax~ | |||
| 418 | 423 | ||
| 419 | Possible values: | 424 | Possible values: |
| 420 | 425 | ||
| 421 | 1. =nil= (default) | 426 | 1. ~nil~ (default) |
| 422 | 2. ~faint~ | 427 | 2. ~faint~ |
| 423 | 3. ~yellow-comments~ | 428 | 3. ~yellow-comments~ |
| 424 | 4. ~green-strings~ | 429 | 4. ~green-strings~ |
| @@ -467,8 +472,8 @@ Symbol: ~modus-themes-no-mixed-fonts~ | |||
| 467 | 472 | ||
| 468 | Possible values: | 473 | Possible values: |
| 469 | 474 | ||
| 470 | 1. =nil= (default) | 475 | 1. ~nil~ (default) |
| 471 | 2. =t= | 476 | 2. ~t~ |
| 472 | 477 | ||
| 473 | By default, the themes configure some spacing-sensitive faces like Org | 478 | By default, the themes configure some spacing-sensitive faces like Org |
| 474 | tables and code blocks to always inherit from the ~fixed-pitch~ face. | 479 | tables and code blocks to always inherit from the ~fixed-pitch~ face. |
| @@ -476,14 +481,14 @@ This is to ensure that those constructs remain monospaced even when | |||
| 476 | users opt for a mode that remaps typeface families, such as the built-in | 481 | users opt for a mode that remaps typeface families, such as the built-in |
| 477 | {{{kbd(M-x variable-pitch-mode)}}}. Otherwise the layout would appear | 482 | {{{kbd(M-x variable-pitch-mode)}}}. Otherwise the layout would appear |
| 478 | broken, due to how spacing is done. To disable this behaviour, set the | 483 | broken, due to how spacing is done. To disable this behaviour, set the |
| 479 | option to =t=. | 484 | option to ~t~. |
| 480 | 485 | ||
| 481 | Users may prefer to use another package for handling mixed typeface | 486 | Users may prefer to use another package for handling mixed typeface |
| 482 | configurations, rather than letting the theme do it, perhaps because a | 487 | configurations, rather than letting the theme do it, perhaps because a |
| 483 | purpose-specific package has extra functionality. Two possible options | 488 | purpose-specific package has extra functionality. Two possible options |
| 484 | are ~org-variable-pitch~ and ~mixed-pitch~. | 489 | are ~org-variable-pitch~ and ~mixed-pitch~. |
| 485 | 490 | ||
| 486 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org (and others)]]. | 491 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| 487 | 492 | ||
| 488 | ** Option for links | 493 | ** Option for links |
| 489 | :properties: | 494 | :properties: |
| @@ -497,7 +502,7 @@ Symbol: ~modus-themes-links~ | |||
| 497 | 502 | ||
| 498 | Possible values: | 503 | Possible values: |
| 499 | 504 | ||
| 500 | 1. =nil= (default) | 505 | 1. ~nil~ (default) |
| 501 | 2. ~faint~ | 506 | 2. ~faint~ |
| 502 | 3. ~neutral-underline~ | 507 | 3. ~neutral-underline~ |
| 503 | 4. ~faint-neutral-underline~ | 508 | 4. ~faint-neutral-underline~ |
| @@ -545,7 +550,7 @@ Symbol: ~modus-themes-prompts~ | |||
| 545 | 550 | ||
| 546 | Possible values: | 551 | Possible values: |
| 547 | 552 | ||
| 548 | 1. =nil= (default) | 553 | 1. ~nil~ (default) |
| 549 | 2. ~subtle-accented~ (~subtle~ exists for backward compatibility) | 554 | 2. ~subtle-accented~ (~subtle~ exists for backward compatibility) |
| 550 | 3. ~intense-accented~ (~intense~ exists for backward compatibility) | 555 | 3. ~intense-accented~ (~intense~ exists for backward compatibility) |
| 551 | 4. ~subtle-gray~ | 556 | 4. ~subtle-gray~ |
| @@ -577,12 +582,15 @@ Symbol: ~modus-themes-mode-line~ | |||
| 577 | 582 | ||
| 578 | Possible values: | 583 | Possible values: |
| 579 | 584 | ||
| 580 | 1. =nil= (default) | 585 | 1. ~nil~ (default) |
| 581 | 2. ~3d~ | 586 | 2. ~3d~ |
| 582 | 3. ~moody~ | 587 | 3. ~moody~ |
| 583 | 4. ~borderless~ | 588 | 4. ~borderless~ |
| 584 | 5. ~borderless-3d~ | 589 | 5. ~borderless-3d~ |
| 585 | 6. ~borderless-moody~ | 590 | 6. ~borderless-moody~ |
| 591 | 7. ~accented~ | ||
| 592 | 8. ~accented-3d~ | ||
| 593 | 9. ~accented-moody~ | ||
| 586 | 594 | ||
| 587 | The default produces a two-dimensional effect both for the active and | 595 | The default produces a two-dimensional effect both for the active and |
| 588 | inactive modelines. The differences between the two are limited to | 596 | inactive modelines. The differences between the two are limited to |
| @@ -612,6 +620,11 @@ that the inactive modelines remain visible, they apply a slightly more | |||
| 612 | prominent background to them than what their counterparts do (same | 620 | prominent background to them than what their counterparts do (same |
| 613 | inactive background as with the default). | 621 | inactive background as with the default). |
| 614 | 622 | ||
| 623 | Similarly, ~accented~, ~accented-3d~, and ~accented-moody~ correspond to the | ||
| 624 | default (~nil~), ~3d~, and ~moody~ styles respectively, except that the active | ||
| 625 | mode line uses a colored background instead of the standard shade of | ||
| 626 | gray. | ||
| 627 | |||
| 615 | Note that Moody does not expose any faces that the themes could style | 628 | Note that Moody does not expose any faces that the themes could style |
| 616 | directly. Instead it re-purposes existing ones to render its tabs and | 629 | directly. Instead it re-purposes existing ones to render its tabs and |
| 617 | ribbons. As such, there may be cases where the contrast ratio falls | 630 | ribbons. As such, there may be cases where the contrast ratio falls |
| @@ -624,10 +637,11 @@ is activated when Emacs determines that the background and foreground of | |||
| 624 | the given construct are too close to each other in terms of color | 637 | the given construct are too close to each other in terms of color |
| 625 | distance. In effect, users would need to experiment with the variable | 638 | distance. In effect, users would need to experiment with the variable |
| 626 | ~face-near-same-color-threshold~ to trigger the effect. We find that a | 639 | ~face-near-same-color-threshold~ to trigger the effect. We find that a |
| 627 | value of =45000= will suffice, contrary to the default =30000=. Do not set | 640 | value of =45000= will suffice, contrary to the default =30000=. Though for |
| 628 | the value too high, because that would have the adverse effect of always | 641 | the ~accented-moody~ value mentioned above, that should be raised up to |
| 629 | overriding the default color (which has been carefully designed to be | 642 | =70000=. Do not set it too high, because it has the adverse effect of |
| 630 | highly accessible). | 643 | always overriding the default colors (which have been carefully designed |
| 644 | to be highly accessible). | ||
| 631 | 645 | ||
| 632 | Furthermore, because Moody expects an underline and overline instead of | 646 | Furthermore, because Moody expects an underline and overline instead of |
| 633 | a box style, it is advised you include this in your setup: | 647 | a box style, it is advised you include this in your setup: |
| @@ -648,7 +662,7 @@ Symbol: ~modus-themes-completions~ | |||
| 648 | 662 | ||
| 649 | Possible values: | 663 | Possible values: |
| 650 | 664 | ||
| 651 | 1. =nil= (default) | 665 | 1. ~nil~ (default) |
| 652 | 2. ~moderate~ | 666 | 2. ~moderate~ |
| 653 | 3. ~opinionated~ | 667 | 3. ~opinionated~ |
| 654 | 668 | ||
| @@ -661,7 +675,7 @@ The former category encompasses Icomplete, Ido, Selectrum as well as | |||
| 661 | pattern matching styles like Orderless and Flx. The latter covers Helm, | 675 | pattern matching styles like Orderless and Flx. The latter covers Helm, |
| 662 | Ivy, and similar. | 676 | Ivy, and similar. |
| 663 | 677 | ||
| 664 | A value of =nil= will respect the metaphors of each completion framework. | 678 | A value of ~nil~ will respect the metaphors of each completion framework. |
| 665 | 679 | ||
| 666 | Option ~moderate~ applies a combination of background and foreground that | 680 | Option ~moderate~ applies a combination of background and foreground that |
| 667 | is fairly subtle. For Icomplete and friends this constitutes a | 681 | is fairly subtle. For Icomplete and friends this constitutes a |
| @@ -677,7 +691,7 @@ packages will revert to an even more nuanced aesthetic with some | |||
| 677 | additional changes to the choice of hues. | 691 | additional changes to the choice of hues. |
| 678 | 692 | ||
| 679 | To appreciate the scope of this customization option, you should spend | 693 | To appreciate the scope of this customization option, you should spend |
| 680 | some time with every one of the =nil= (default), ~moderate~, and ~opinionated~ | 694 | some time with every one of the ~nil~ (default), ~moderate~, and ~opinionated~ |
| 681 | possibilities. | 695 | possibilities. |
| 682 | 696 | ||
| 683 | ** Option for fringe visibility | 697 | ** Option for fringe visibility |
| @@ -692,7 +706,7 @@ Symbol: ~modus-themes-fringes~ | |||
| 692 | 706 | ||
| 693 | Possible values: | 707 | Possible values: |
| 694 | 708 | ||
| 695 | 1. =nil= (default) | 709 | 1. ~nil~ (default) |
| 696 | 2. ~subtle~ | 710 | 2. ~subtle~ |
| 697 | 3. ~intense~ | 711 | 3. ~intense~ |
| 698 | 712 | ||
| @@ -716,7 +730,7 @@ Symbol: ~modus-themes-lang-checkers~ | |||
| 716 | 730 | ||
| 717 | Possible values: | 731 | Possible values: |
| 718 | 732 | ||
| 719 | 1. =nil= (default) | 733 | 1. ~nil~ (default) |
| 720 | 2. ~subtle-foreground~ | 734 | 2. ~subtle-foreground~ |
| 721 | 3. ~intense-foreground~ | 735 | 3. ~intense-foreground~ |
| 722 | 4. ~straight-underline~ | 736 | 4. ~straight-underline~ |
| @@ -755,25 +769,50 @@ refer to their documentation strings. | |||
| 755 | ** Option for line highlighting (hl-line-mode) | 769 | ** Option for line highlighting (hl-line-mode) |
| 756 | :properties: | 770 | :properties: |
| 757 | :alt_title: Line highlighting | 771 | :alt_title: Line highlighting |
| 758 | :description: Toggle intense style for current line highlighting | 772 | :description: Choose style of current line (hl-line-mode) |
| 759 | :custom_id: h:1dba1cfe-d079-4c13-a810-f768e8789177 | 773 | :custom_id: h:1dba1cfe-d079-4c13-a810-f768e8789177 |
| 760 | :end: | 774 | :end: |
| 761 | #+vindex: modus-themes-intense-hl-line | 775 | #+vindex: modus-themes-hl-line |
| 762 | 776 | ||
| 763 | Symbol: ~modus-themes-intense-hl-line~ | 777 | Symbol: ~modus-themes-hl-line~ |
| 764 | 778 | ||
| 765 | Possible values: | 779 | Possible values: |
| 766 | 780 | ||
| 767 | 1. =nil= (default) | 781 | 1. ~nil~ (default) |
| 768 | 2. =t= | 782 | 2. ~intense-background~ |
| 783 | 3. ~accented-background~ | ||
| 784 | 4. ~underline-neutral~ | ||
| 785 | 5. ~underline-accented~ | ||
| 786 | 6. ~underline-only-neutral~ | ||
| 787 | 7. ~underline-only-accented~ | ||
| 788 | |||
| 789 | The default is to use a subtle gray background for the current line when | ||
| 790 | ~hl-line-mode~ is enabled. | ||
| 791 | |||
| 792 | The ~intense-background~ applies a more prominent gray to the background | ||
| 793 | of the current line. | ||
| 794 | |||
| 795 | With ~accented-background~ the default's subtle aesthetic is retained, but | ||
| 796 | the background has a more colored hint. | ||
| 797 | |||
| 798 | The ~underline-neutral~ combines the default subtle neutral background | ||
| 799 | with a gray underline. | ||
| 769 | 800 | ||
| 770 | The default is to use a subtle gray background for ~hl-line-mode~ and its | 801 | Similarly, the ~underline-accented~ renders the background of the current |
| 771 | global equivalent. | 802 | line in a subtle colored background, while it also draws an accented |
| 803 | underline. | ||
| 772 | 804 | ||
| 773 | With a non-nil value (=t=) use a more prominent background color instead. | 805 | Option ~underline-only-neutral~ produces a neutral underline, but does not |
| 806 | use any background. | ||
| 774 | 807 | ||
| 775 | This affects several packages that enable ~hl-line-mode~, such as =elfeed= | 808 | While ~underline-only-accented~ also uses just an underline, only this one |
| 776 | and =mu4e=. | 809 | is colored. |
| 810 | |||
| 811 | Consider setting the variable ~x-underline-at-descent-line~ to a non-nil | ||
| 812 | value for better results with underlines. | ||
| 813 | |||
| 814 | This style affects several packages that enable ~hl-line-mode~, such as | ||
| 815 | =elfeed= and =mu4e=. | ||
| 777 | 816 | ||
| 778 | ** Option for line numbers (display-line-numbers-mode) | 817 | ** Option for line numbers (display-line-numbers-mode) |
| 779 | :properties: | 818 | :properties: |
| @@ -787,8 +826,8 @@ Symbol: ~modus-themes-subtle-line-numbers~ | |||
| 787 | 826 | ||
| 788 | Possible value: | 827 | Possible value: |
| 789 | 828 | ||
| 790 | 1. =nil= (default) | 829 | 1. ~nil~ (default) |
| 791 | 2. =t= | 830 | 2. ~t~ |
| 792 | 831 | ||
| 793 | The default style for ~display-line-numbers-mode~ and its global variant | 832 | The default style for ~display-line-numbers-mode~ and its global variant |
| 794 | is to apply a subtle gray background to the line numbers. The current | 833 | is to apply a subtle gray background to the line numbers. The current |
| @@ -799,7 +838,7 @@ Similarly, the faces for ~display-line-numbers-major-tick~ and its | |||
| 799 | counterpart ~display-line-numbers-minor-tick~ use appropriate styles that | 838 | counterpart ~display-line-numbers-minor-tick~ use appropriate styles that |
| 800 | involve a bespoke background and foreground combination. | 839 | involve a bespoke background and foreground combination. |
| 801 | 840 | ||
| 802 | With a non-nil value (=t=), line numbers have no background of their own. | 841 | With a non-nil value (~t~), line numbers have no background of their own. |
| 803 | Instead they retain the primary background of the theme, blending with | 842 | Instead they retain the primary background of the theme, blending with |
| 804 | the rest of the buffer. Foreground values for all relevant faces are | 843 | the rest of the buffer. Foreground values for all relevant faces are |
| 805 | updated to accommodate this aesthetic. | 844 | updated to accommodate this aesthetic. |
| @@ -816,7 +855,7 @@ Symbol: ~modus-themes-paren-match~ | |||
| 816 | 855 | ||
| 817 | Possible values: | 856 | Possible values: |
| 818 | 857 | ||
| 819 | 1. =nil= (default) | 858 | 1. ~nil~ (default) |
| 820 | 2. ~subtle-bold~ | 859 | 2. ~subtle-bold~ |
| 821 | 3. ~intense~ | 860 | 3. ~intense~ |
| 822 | 4. ~intense-bold~ | 861 | 4. ~intense-bold~ |
| @@ -847,10 +886,12 @@ Symbol: ~modus-themes-region~ | |||
| 847 | 886 | ||
| 848 | Possible values: | 887 | Possible values: |
| 849 | 888 | ||
| 850 | 1. =nil= (default) | 889 | 1. ~nil~ (default) |
| 851 | 2. ~no-extend~ | 890 | 2. ~no-extend~ |
| 852 | 3. ~bg-only~ | 891 | 3. ~bg-only~ |
| 853 | 4. ~bg-only-no-extend~ | 892 | 4. ~bg-only-no-extend~ |
| 893 | 5. ~accent~ | ||
| 894 | 6. ~accent-no-extend~ | ||
| 854 | 895 | ||
| 855 | Nil means to only use a prominent gray background with a neutral | 896 | Nil means to only use a prominent gray background with a neutral |
| 856 | foreground. The foreground overrides all syntax highlighting. The | 897 | foreground. The foreground overrides all syntax highlighting. The |
| @@ -866,6 +907,11 @@ colors. It extends to the edge of the window. | |||
| 866 | Option ~bg-only-no-extend~ is a combination of the ~bg-only~ and ~no-extend~ | 907 | Option ~bg-only-no-extend~ is a combination of the ~bg-only~ and ~no-extend~ |
| 867 | options. | 908 | options. |
| 868 | 909 | ||
| 910 | Option ~accent~ is like the default, though it uses a more colorful | ||
| 911 | background, while ~accent-no-extend~ is the same except it draws the | ||
| 912 | region only up to the end of each line instead of extending to the edge | ||
| 913 | of the window. | ||
| 914 | |||
| 869 | ** Option for diff buffer looks | 915 | ** Option for diff buffer looks |
| 870 | :properties: | 916 | :properties: |
| 871 | :alt_title: Diffs | 917 | :alt_title: Diffs |
| @@ -878,7 +924,7 @@ Symbol: ~modus-themes-diffs~ | |||
| 878 | 924 | ||
| 879 | Possible values: | 925 | Possible values: |
| 880 | 926 | ||
| 881 | 1. =nil= (default) | 927 | 1. ~nil~ (default) |
| 882 | 2. ~desaturated~ | 928 | 2. ~desaturated~ |
| 883 | 3. ~fg-only~ | 929 | 3. ~fg-only~ |
| 884 | 4. ~bg-only~ | 930 | 4. ~bg-only~ |
| @@ -935,7 +981,7 @@ Symbol: ~modus-themes-org-blocks~ | |||
| 935 | 981 | ||
| 936 | Possible values: | 982 | Possible values: |
| 937 | 983 | ||
| 938 | 1. =nil= (default) | 984 | 1. ~nil~ (default) |
| 939 | 2. ~grayscale~ | 985 | 2. ~grayscale~ |
| 940 | 3. ~rainbow~ | 986 | 3. ~rainbow~ |
| 941 | 987 | ||
| @@ -960,6 +1006,9 @@ major-mode so that the colors are applied consistently throughout: use | |||
| 960 | Or start typing in each code block (inefficient at scale, but it still | 1006 | Or start typing in each code block (inefficient at scale, but it still |
| 961 | works). | 1007 | works). |
| 962 | 1008 | ||
| 1009 | The extent of Org block delimiter lines is controlled by the variable | ||
| 1010 | ~org-fontify-whole-block-delimiter-line~. | ||
| 1011 | |||
| 963 | ** Option for org-habit graph styles | 1012 | ** Option for org-habit graph styles |
| 964 | :properties: | 1013 | :properties: |
| 965 | :alt_title: Org agenda habits | 1014 | :alt_title: Org agenda habits |
| @@ -972,7 +1021,7 @@ Symbol: ~modus-themes-org-habit~ | |||
| 972 | 1021 | ||
| 973 | Possible values: | 1022 | Possible values: |
| 974 | 1023 | ||
| 975 | 1. =nil= (default) | 1024 | 1. ~nil~ (default) |
| 976 | 2. ~simplified~ | 1025 | 2. ~simplified~ |
| 977 | 3. ~traffic-light~ | 1026 | 3. ~traffic-light~ |
| 978 | 1027 | ||
| @@ -1014,11 +1063,10 @@ than other customization options documented in this manual. | |||
| 1014 | 1063 | ||
| 1015 | Symbol: ~modus-themes-headings~ | 1064 | Symbol: ~modus-themes-headings~ |
| 1016 | 1065 | ||
| 1017 | Possible values, which can be specified for each heading level (examples | 1066 | Possible values, which can be specified for each heading level N |
| 1018 | further below): | 1067 | (examples further below): |
| 1019 | 1068 | ||
| 1020 | + nil (default fallback option---covers all heading levels) | 1069 | + ~nil~ (~t~ is also available for backward compatibility) |
| 1021 | + =t= (default style for a single heading, when the fallback differs) | ||
| 1022 | + ~no-bold~ | 1070 | + ~no-bold~ |
| 1023 | + ~line~ | 1071 | + ~line~ |
| 1024 | + ~line-no-bold~ | 1072 | + ~line-no-bold~ |
| @@ -1058,19 +1106,19 @@ To set a uniform value for all heading levels, use this pattern: | |||
| 1058 | '((t . section))) | 1106 | '((t . section))) |
| 1059 | 1107 | ||
| 1060 | ;; Default aesthetic for every heading | 1108 | ;; Default aesthetic for every heading |
| 1061 | (setq modus-themes-headings | 1109 | (setq modus-themes-headings nil) |
| 1062 | '()) | ||
| 1063 | #+end_src | 1110 | #+end_src |
| 1064 | 1111 | ||
| 1065 | The default style for headings uses a fairly desaturated foreground | 1112 | The default style for headings uses a fairly desaturated foreground |
| 1066 | value in combination with bold typographic weight. To specify this | 1113 | color in combination with bold typographic weight. To specify this |
| 1067 | style for a given level N, assuming you wish to have another fallback | 1114 | style for a given level N, assuming you wish to have another fallback |
| 1068 | option, just specify the value =t= like this: | 1115 | option, just assign the value ~nil~ like this: |
| 1069 | 1116 | ||
| 1070 | #+begin_src emacs-lisp | 1117 | #+begin_src emacs-lisp |
| 1071 | (setq modus-themes-headings | 1118 | (setq modus-themes-headings |
| 1072 | '((1 . t) | 1119 | '((1 . nil) |
| 1073 | (2 . line) | 1120 | (2 . line) |
| 1121 | (3) ; same as nil | ||
| 1074 | (t . rainbow-line-no-bold))) | 1122 | (t . rainbow-line-no-bold))) |
| 1075 | #+end_src | 1123 | #+end_src |
| 1076 | 1124 | ||
| @@ -1122,6 +1170,9 @@ A description of all other possible styles beyond the default: | |||
| 1122 | 1170 | ||
| 1123 | + ~no-color-no-bold~ is like ~no-color~ but without the bold weight. | 1171 | + ~no-color-no-bold~ is like ~no-color~ but without the bold weight. |
| 1124 | 1172 | ||
| 1173 | Remember to also inspect relevant variables that Org provides, such as: | ||
| 1174 | ~org-fontify-whole-heading-line~ and ~org-fontify-done-headline~. | ||
| 1175 | |||
| 1125 | ** Option for scaled headings | 1176 | ** Option for scaled headings |
| 1126 | :properties: | 1177 | :properties: |
| 1127 | :alt_title: Scaled headings | 1178 | :alt_title: Scaled headings |
| @@ -1134,12 +1185,12 @@ Symbol: ~modus-themes-scale-headings~ | |||
| 1134 | 1185 | ||
| 1135 | Possible values: | 1186 | Possible values: |
| 1136 | 1187 | ||
| 1137 | 1. =nil= (default) | 1188 | 1. ~nil~ (default) |
| 1138 | 2. =t= | 1189 | 2. ~t~ |
| 1139 | 1190 | ||
| 1140 | The default is to use the same size for headings and paragraph text. | 1191 | The default is to use the same size for headings and paragraph text. |
| 1141 | 1192 | ||
| 1142 | With a non-nil value (=t=) make headings larger in height relative to the | 1193 | With a non-nil value (~t~) make headings larger in height relative to the |
| 1143 | main text. This is noticeable in modes like Org, Markdown, and Info. | 1194 | main text. This is noticeable in modes like Org, Markdown, and Info. |
| 1144 | 1195 | ||
| 1145 | *** Control the scale of headings | 1196 | *** Control the scale of headings |
| @@ -1217,8 +1268,8 @@ Symbol: ~modus-themes-variable-pitch-ui~ | |||
| 1217 | 1268 | ||
| 1218 | Possible values: | 1269 | Possible values: |
| 1219 | 1270 | ||
| 1220 | 1. =nil= (default) | 1271 | 1. ~nil~ (default) |
| 1221 | 2. =t= | 1272 | 2. ~t~ |
| 1222 | 1273 | ||
| 1223 | This option concerns User Interface elements that are under the direct | 1274 | This option concerns User Interface elements that are under the direct |
| 1224 | control of Emacs. In particular: the mode line, header line, tab bar, | 1275 | control of Emacs. In particular: the mode line, header line, tab bar, |
| @@ -1227,7 +1278,7 @@ and tab line. | |||
| 1227 | The default is to use the same font as the rest of Emacs, which usually | 1278 | The default is to use the same font as the rest of Emacs, which usually |
| 1228 | is a monospaced family. | 1279 | is a monospaced family. |
| 1229 | 1280 | ||
| 1230 | With a non-nil value (=t=) apply a proportionately spaced typeface. This | 1281 | With a non-nil value (~t~) apply a proportionately spaced typeface. This |
| 1231 | is done by assigning the ~variable-pitch~ face to the relevant items. | 1282 | is done by assigning the ~variable-pitch~ face to the relevant items. |
| 1232 | 1283 | ||
| 1233 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | 1284 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| @@ -1244,13 +1295,13 @@ Symbol: ~modus-themes-variable-pitch-headings~ | |||
| 1244 | 1295 | ||
| 1245 | Possible values: | 1296 | Possible values: |
| 1246 | 1297 | ||
| 1247 | 1. =nil= (default) | 1298 | 1. ~nil~ (default) |
| 1248 | 2. =t= | 1299 | 2. ~t~ |
| 1249 | 1300 | ||
| 1250 | The default is to use the main font family, which typically is | 1301 | The default is to use the main font family, which typically is |
| 1251 | monospaced. | 1302 | monospaced. |
| 1252 | 1303 | ||
| 1253 | With a non-nil value (=t=) apply a proportionately spaced typeface, else | 1304 | With a non-nil value (~t~) apply a proportionately spaced typeface, else |
| 1254 | "variable-pitch", to headings (such as in Org mode). | 1305 | "variable-pitch", to headings (such as in Org mode). |
| 1255 | 1306 | ||
| 1256 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | 1307 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| @@ -1357,7 +1408,7 @@ With that granted, let us expand the example to actually change the | |||
| 1357 | 1408 | ||
| 1358 | If you evaluate this form, your cursor will become blue. But if you | 1409 | If you evaluate this form, your cursor will become blue. But if you |
| 1359 | change themes, such as with ~modus-themes-toggle~, your edits will be | 1410 | change themes, such as with ~modus-themes-toggle~, your edits will be |
| 1360 | lost, because the newly loaded theme will override the =:background= | 1411 | lost, because the newly loaded theme will override the ~:background~ |
| 1361 | attribute you had assigned to that face. | 1412 | attribute you had assigned to that face. |
| 1362 | 1413 | ||
| 1363 | For such changes to persist, we need to make them after loading the | 1414 | For such changes to persist, we need to make them after loading the |
| @@ -1458,7 +1509,7 @@ Getting a list of colors may have its applications, though what you are | |||
| 1458 | most likely interested in is how to use those variables to configure | 1509 | most likely interested in is how to use those variables to configure |
| 1459 | several faces at once. To do so we can rely on the built-in | 1510 | several faces at once. To do so we can rely on the built-in |
| 1460 | ~custom-set-faces~ function, which sets face specifications for the | 1511 | ~custom-set-faces~ function, which sets face specifications for the |
| 1461 | special =user= theme. That "theme" gets applied on top of regular themes | 1512 | special ~user~ theme. That "theme" gets applied on top of regular themes |
| 1462 | like ~modus-operandi~ and ~modus-vivendi~. | 1513 | like ~modus-operandi~ and ~modus-vivendi~. |
| 1463 | 1514 | ||
| 1464 | This is how it works: | 1515 | This is how it works: |
| @@ -1502,7 +1553,7 @@ Thus: | |||
| 1502 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. | 1553 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. |
| 1503 | 1554 | ||
| 1504 | To discover the faces defined by all loaded libraries, you may do | 1555 | To discover the faces defined by all loaded libraries, you may do |
| 1505 | {{{kbd(M-x list-faces-display)}}}. Be warned that when you =:inherit= a face | 1556 | {{{kbd(M-x list-faces-display)}}}. Be warned that when you ~:inherit~ a face |
| 1506 | you are introducing an implicit dependency, so try to avoid doing so for | 1557 | you are introducing an implicit dependency, so try to avoid doing so for |
| 1507 | libraries other than the built-in {{{file(faces.el)}}} (or at least understand | 1558 | libraries other than the built-in {{{file(faces.el)}}} (or at least understand |
| 1508 | that things may break if you inherit from a yet-to-be-loaded face). | 1559 | that things may break if you inherit from a yet-to-be-loaded face). |
| @@ -1524,6 +1575,68 @@ the previous section. Adapt the above example like this: | |||
| 1524 | ...)) | 1575 | ...)) |
| 1525 | #+end_src | 1576 | #+end_src |
| 1526 | 1577 | ||
| 1578 | ** Remap face with local value (DIY) | ||
| 1579 | :properties: | ||
| 1580 | :custom_id: h:7a93cb6f-4eca-4d56-a85c-9dcd813d6b0f | ||
| 1581 | :end: | ||
| 1582 | #+cindex: Remapping faces | ||
| 1583 | |||
| 1584 | There are cases where we need to change the buffer-local attributes of a | ||
| 1585 | face. This might be because we have our own minor mode that re-uses a | ||
| 1586 | face for a particular purpose, such as a line selection tool that | ||
| 1587 | activates ~hl-line-mode~, but we wish to keep it distinct from other | ||
| 1588 | buffers. This is where ~face-remap-add-relative~ can be applied and may | ||
| 1589 | be combined with ~modus-themes-with-colors~ to deliver consistent results. | ||
| 1590 | |||
| 1591 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette (DIY)]]. | ||
| 1592 | |||
| 1593 | In this example we will write a simple interactive function that adjusts | ||
| 1594 | the background color of the ~region~ face. This is the sample code: | ||
| 1595 | |||
| 1596 | #+begin_src emacs-lisp | ||
| 1597 | (defvar my-rainbow-region-colors | ||
| 1598 | (modus-themes-with-colors | ||
| 1599 | `((red . ,red-subtle-bg) | ||
| 1600 | (green . ,green-subtle-bg) | ||
| 1601 | (yellow . ,yellow-subtle-bg) | ||
| 1602 | (blue . ,blue-subtle-bg) | ||
| 1603 | (magenta . ,magenta-subtle-bg) | ||
| 1604 | (cyan . ,cyan-subtle-bg))) | ||
| 1605 | "Sample list of color values for `my-rainbow-region'.") | ||
| 1606 | |||
| 1607 | (defun my-rainbow-region (color) | ||
| 1608 | "Remap buffer-local attribute of `region' using COLOR." | ||
| 1609 | (interactive | ||
| 1610 | (list | ||
| 1611 | (completing-read "Pick a color: " my-rainbow-region-colors))) | ||
| 1612 | (face-remap-add-relative | ||
| 1613 | 'region | ||
| 1614 | `( :background ,(alist-get (intern color) my-rainbow-region-colors) | ||
| 1615 | :foreground ,(face-attribute 'default :foreground)))) | ||
| 1616 | #+end_src | ||
| 1617 | |||
| 1618 | When ~my-rainbow-region~ is called interactively, it prompts for a color | ||
| 1619 | to use. The list of candidates is drawn from the car of each | ||
| 1620 | association in ~my-rainbow-region-colors~ (so "red", "green", etc.). | ||
| 1621 | |||
| 1622 | To extend this principle, we may write wrapper functions that pass a | ||
| 1623 | color directly. Those can be useful in tandem with hooks. Consider | ||
| 1624 | this example: | ||
| 1625 | |||
| 1626 | #+begin_src emacs-lisp | ||
| 1627 | (defun my-rainbow-region-magenta () | ||
| 1628 | (my-rainbow-region 'magenta)) | ||
| 1629 | |||
| 1630 | (add-hook 'diff-mode-hook #'my-rainbow-region-magenta) | ||
| 1631 | #+end_src | ||
| 1632 | |||
| 1633 | Whenever we enter a ~diff-mode~ buffer, we now get a magenta-colored | ||
| 1634 | region. | ||
| 1635 | |||
| 1636 | Perhaps you may wish to generalise those findings in to a set of | ||
| 1637 | functions that also accept an arbitrary face. We shall leave the | ||
| 1638 | experimentation up to you. | ||
| 1639 | |||
| 1527 | ** Override colors (DIY) | 1640 | ** Override colors (DIY) |
| 1528 | :properties: | 1641 | :properties: |
| 1529 | :custom_id: h:307d95dd-8dbd-4ece-a543-10ae86f155a6 | 1642 | :custom_id: h:307d95dd-8dbd-4ece-a543-10ae86f155a6 |
| @@ -1627,16 +1740,89 @@ with {{{kbd(M-x modus-themes-toggle)}}} will also use the overrides. | |||
| 1627 | Given that this is a user-level customisation, one is free to implement | 1740 | Given that this is a user-level customisation, one is free to implement |
| 1628 | whatever color values they desire, even if the possible combinations | 1741 | whatever color values they desire, even if the possible combinations |
| 1629 | fall below the minimum 7:1 contrast ratio that governs the design of the | 1742 | fall below the minimum 7:1 contrast ratio that governs the design of the |
| 1630 | themes (the WCAG AAA legibility standard). Preferences aside, it is | 1743 | themes (the WCAG AAA legibility standard). Alternatively, this can also |
| 1631 | advised to inspect the source code of ~modus-themes-operandi-colors~ and | 1744 | be done programmatically ([[#h:4589acdc-2505-41fc-9f5e-699cfc45ab00][Override color saturation]]). |
| 1632 | ~modus-themes-vivendi-colors~ to read the inline commentary: it explains | 1745 | |
| 1633 | what the intended use of each palette subset is. | 1746 | For manual interventions it is advised to inspect the source code of |
| 1747 | ~modus-themes-operandi-colors~ and ~modus-themes-vivendi-colors~ for the | ||
| 1748 | inline commentary: it explains what the intended use of each palette | ||
| 1749 | subset is. | ||
| 1634 | 1750 | ||
| 1635 | Furthermore, users may benefit from the ~modus-themes-contrast~ function | 1751 | Furthermore, users may benefit from the ~modus-themes-contrast~ function |
| 1636 | that we provide: [[#h:02e25930-e71a-493d-828a-8907fc80f874][test color combinations]]. It measures the contrast | 1752 | that we provide: [[#h:02e25930-e71a-493d-828a-8907fc80f874][test color combinations]]. It measures the contrast |
| 1637 | ratio between two color values, so it can help in overriding the palette | 1753 | ratio between two color values, so it can help in overriding the palette |
| 1638 | (or a subset thereof) without making the end result inaccessible. | 1754 | (or a subset thereof) without making the end result inaccessible. |
| 1639 | 1755 | ||
| 1756 | ** Override color saturation (DIY) | ||
| 1757 | :properties: | ||
| 1758 | :custom_id: h:4589acdc-2505-41fc-9f5e-699cfc45ab00 | ||
| 1759 | :end: | ||
| 1760 | #+cindex: Change a theme's color saturation | ||
| 1761 | |||
| 1762 | In the previous section we documented how one can override color values | ||
| 1763 | manually ([[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]). Here we use a programmatic approach which | ||
| 1764 | leverages the built-in ~color-saturate-name~ function to adjust the | ||
| 1765 | saturation of all color values used by the active Modus theme. Our goal | ||
| 1766 | is to prepare a counterpart of the active theme's palette that holds | ||
| 1767 | modified color values, adjusted for a percent change in saturation. A | ||
| 1768 | positive number amplifies the effect, while a negative one will move | ||
| 1769 | towards a grayscale spectrum. | ||
| 1770 | |||
| 1771 | We start with a function that can be either called from Lisp or invoked | ||
| 1772 | interactively. In the former scenario, we pass to it the rate of change | ||
| 1773 | we want. While in the latter, a minibuffer prompt asks for a number to | ||
| 1774 | apply the desired effect. In either case, we intend to assign anew the | ||
| 1775 | value of ~modus-themes-operandi-color-overrides~ (light theme) and the | ||
| 1776 | same for ~modus-themes-vivendi-color-overrides~ (dark theme). | ||
| 1777 | |||
| 1778 | #+begin_src emacs-lisp | ||
| 1779 | (defun my-modus-themes-saturate (percent) | ||
| 1780 | "Saturate current Modus theme palette overrides by PERCENT." | ||
| 1781 | (interactive | ||
| 1782 | (list (read-number "Saturation by percent: "))) | ||
| 1783 | (let* ((theme (modus-themes--current-theme)) | ||
| 1784 | (palette (pcase theme | ||
| 1785 | ('modus-operandi modus-themes-operandi-colors) | ||
| 1786 | ('modus-vivendi modus-themes-vivendi-colors) | ||
| 1787 | (_ (error "No Modus theme is active")))) | ||
| 1788 | (overrides (pcase theme | ||
| 1789 | ('modus-operandi 'modus-themes-operandi-color-overrides) | ||
| 1790 | ('modus-vivendi 'modus-themes-vivendi-color-overrides) | ||
| 1791 | (_ (error "No Modus theme is active"))))) | ||
| 1792 | (let (name cons colors) | ||
| 1793 | (dolist (cons palette) | ||
| 1794 | (setq name (color-saturate-name (cdr cons) percent)) | ||
| 1795 | (setq name (format "%s" name)) | ||
| 1796 | (setq cons `(,(car cons) . ,name)) | ||
| 1797 | (push cons colors)) | ||
| 1798 | (set overrides colors)) | ||
| 1799 | (pcase theme | ||
| 1800 | ('modus-operandi (modus-themes-load-operandi)) | ||
| 1801 | ('modus-vivendi (modus-themes-load-vivendi))))) | ||
| 1802 | |||
| 1803 | ;; sample Elisp calls (or call `my-modus-themes-saturate' interactively) | ||
| 1804 | (my-modus-themes-saturate 50) | ||
| 1805 | (my-modus-themes-saturate -75) | ||
| 1806 | #+end_src | ||
| 1807 | |||
| 1808 | Using the above has an immediate effect, as it reloads the active Modus | ||
| 1809 | theme. | ||
| 1810 | |||
| 1811 | To disable the effect, one must reset the aforementioned variables to | ||
| 1812 | ~nil~. Or specify a command for it, such as by taking inspiration from | ||
| 1813 | the ~modus-themes-toggle~ we already provide: | ||
| 1814 | |||
| 1815 | #+begin_src emacs-lisp | ||
| 1816 | (defun my-modus-themes-revert-overrides () | ||
| 1817 | "Reset palette overrides and reload active Modus theme." | ||
| 1818 | (interactive) | ||
| 1819 | (setq modus-themes-operandi-color-overrides nil | ||
| 1820 | modus-themes-vivendi-color-overrides nil) | ||
| 1821 | (pcase (modus-themes--current-theme) | ||
| 1822 | ('modus-operandi (modus-themes-load-operandi)) | ||
| 1823 | ('modus-vivendi (modus-themes-load-vivendi)))) | ||
| 1824 | #+end_src | ||
| 1825 | |||
| 1640 | ** Font configurations for Org and others (DIY) | 1826 | ** Font configurations for Org and others (DIY) |
| 1641 | :properties: | 1827 | :properties: |
| 1642 | :custom_id: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 | 1828 | :custom_id: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 |
| @@ -1677,9 +1863,9 @@ reading the doc string of ~set-face-attribute~): | |||
| 1677 | (set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.0) | 1863 | (set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.0) |
| 1678 | #+end_src | 1864 | #+end_src |
| 1679 | 1865 | ||
| 1680 | Note the differences in the =:height= property. The =default= face must | 1866 | Note the differences in the ~:height~ property. The ~default~ face must |
| 1681 | specify an absolute value, which is the point size × 10. So if you want | 1867 | specify an absolute value, which is the point size × 10. So if you want |
| 1682 | to use a font at point size =11=, you set the height to =110=.[fn:: =:height= | 1868 | to use a font at point size =11=, you set the height to =110=.[fn:: ~:height~ |
| 1683 | values do not need to be rounded to multiples of ten: the likes of =115= | 1869 | values do not need to be rounded to multiples of ten: the likes of =115= |
| 1684 | are perfectly valid—some typefaces will change to account for those | 1870 | are perfectly valid—some typefaces will change to account for those |
| 1685 | finer increments.] Whereas every other face must have a value that is | 1871 | finer increments.] Whereas every other face must have a value that is |
| @@ -1689,6 +1875,8 @@ importance: it ensures that all fonts can scale gracefully when using | |||
| 1689 | something like the ~text-scale-adjust~ command which only operates on the | 1875 | something like the ~text-scale-adjust~ command which only operates on the |
| 1690 | base font size (i.e. the ~default~ face's absolute height). | 1876 | base font size (i.e. the ~default~ face's absolute height). |
| 1691 | 1877 | ||
| 1878 | [[#h:e6c5451f-6763-4be7-8fdb-b4706a422a4c][Note for EWW and Elfeed fonts (SHR fonts)]]. | ||
| 1879 | |||
| 1692 | ** Custom Org user faces (DIY) | 1880 | ** Custom Org user faces (DIY) |
| 1693 | :properties: | 1881 | :properties: |
| 1694 | :custom_id: h:89f0678d-c5c3-4a57-a526-668b2bb2d7ad | 1882 | :custom_id: h:89f0678d-c5c3-4a57-a526-668b2bb2d7ad |
| @@ -1871,6 +2059,68 @@ package: | |||
| 1871 | (circadian-setup)) | 2059 | (circadian-setup)) |
| 1872 | #+end_src | 2060 | #+end_src |
| 1873 | 2061 | ||
| 2062 | ** Backdrop for pdf-tools (DIY) | ||
| 2063 | :properties: | ||
| 2064 | :custom_id: h:ff69dfe1-29c0-447a-915c-b5ff7c5509cd | ||
| 2065 | :end: | ||
| 2066 | #+cindex: Remapping pdf-tools backdrop | ||
| 2067 | |||
| 2068 | Most PDF files use a white background for their page, making it | ||
| 2069 | impossible to discern the file's boundaries in the buffer while using | ||
| 2070 | the Modus Operandi theme. To introduce a distinction between the | ||
| 2071 | buffer's backdrop and the PDF page's background, the former must be | ||
| 2072 | rendered as some shade of gray. Ideally, ~pdf-tools~ would provide a face | ||
| 2073 | that the themes could support directly, though this does not seem to be | ||
| 2074 | the case for the time being. We must thus employ the face remapping | ||
| 2075 | technique that is documented elsewhere in this document to change the | ||
| 2076 | buffer-local value of the ~default~ face. | ||
| 2077 | |||
| 2078 | [[#h:7a93cb6f-4eca-4d56-a85c-9dcd813d6b0f][Remap face with local value (DIY)]]. | ||
| 2079 | |||
| 2080 | To remap the buffer's backdrop, we start with a function like this one: | ||
| 2081 | |||
| 2082 | #+begin_src emacs-lisp | ||
| 2083 | (defun my-pdf-tools-backdrop () | ||
| 2084 | (face-remap-add-relative | ||
| 2085 | 'default | ||
| 2086 | `(:background ,(modus-themes-color 'bg-alt)))) | ||
| 2087 | |||
| 2088 | (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-backdrop) | ||
| 2089 | #+end_src | ||
| 2090 | |||
| 2091 | The idea is to assign that function to a hook that gets called when | ||
| 2092 | ~pdf-tools~ renders the document: ~pdf-tools-enabled-hook~. This is enough | ||
| 2093 | when you only use one theme. However it has the downside of setting the | ||
| 2094 | background color value only at render time. In other words, the face | ||
| 2095 | remapping function does not get evaluated anew whenever the theme | ||
| 2096 | changes, such as upon invoking {{{kbd(M-x modus-themes-toggle)}}}. | ||
| 2097 | |||
| 2098 | To have our face remapping adapt gracefully while switching between the | ||
| 2099 | Modus themes, we need to also account for the current theme and control | ||
| 2100 | the activation of ~pdf-view-midnight-minor-mode~. To which end we arrive | ||
| 2101 | at something like the following, which builds on the above example: | ||
| 2102 | |||
| 2103 | #+begin_src emacs-lisp | ||
| 2104 | (defun my-pdf-tools-backdrop () | ||
| 2105 | (face-remap-add-relative | ||
| 2106 | 'default | ||
| 2107 | `(:background ,(modus-themes-color 'bg-alt)))) | ||
| 2108 | |||
| 2109 | (defun my-pdf-tools-midnight-mode-toggle () | ||
| 2110 | (when (derived-mode-p 'pdf-view-mode) | ||
| 2111 | (if (eq (car custom-enabled-themes) 'modus-vivendi) | ||
| 2112 | (pdf-view-midnight-minor-mode 1) | ||
| 2113 | (pdf-view-midnight-minor-mode -1)) | ||
| 2114 | (my-pdf-tools-backdrop))) | ||
| 2115 | |||
| 2116 | (add-hook 'pdf-tools-enabled-hook #'my-pdf-tools-midnight-mode-toggle) | ||
| 2117 | (add-hook 'modus-themes-after-load-theme-hook #'my-pdf-tools-midnight-mode-toggle) | ||
| 2118 | #+end_src | ||
| 2119 | |||
| 2120 | With those in place, PDFs have a distinct backdrop for their page, while | ||
| 2121 | they automatically switch to their dark mode when ~modus-themes-toggle~ is | ||
| 2122 | called from inside a buffer whose major-mode is ~pdf-view-mode~. | ||
| 2123 | |||
| 1874 | ** A theme-agnostic hook for theme loading (DIY) | 2124 | ** A theme-agnostic hook for theme loading (DIY) |
| 1875 | :properties: | 2125 | :properties: |
| 1876 | :custom_id: h:86f6906b-f090-46cc-9816-1fe8aeb38776 | 2126 | :custom_id: h:86f6906b-f090-46cc-9816-1fe8aeb38776 |
| @@ -1976,6 +2226,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1976 | + compilation-mode | 2226 | + compilation-mode |
| 1977 | + completions | 2227 | + completions |
| 1978 | + consult | 2228 | + consult |
| 2229 | + corfu | ||
| 1979 | + counsel* | 2230 | + counsel* |
| 1980 | + counsel-css | 2231 | + counsel-css |
| 1981 | + counsel-notmuch | 2232 | + counsel-notmuch |
| @@ -2018,8 +2269,9 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 2018 | + eldoc-box | 2269 | + eldoc-box |
| 2019 | + elfeed | 2270 | + elfeed |
| 2020 | + elfeed-score | 2271 | + elfeed-score |
| 2272 | + embark | ||
| 2021 | + emms | 2273 | + emms |
| 2022 | + enhanced-ruby-mode | 2274 | + enh-ruby-mode (enhanced-ruby-mode) |
| 2023 | + epa | 2275 | + epa |
| 2024 | + equake | 2276 | + equake |
| 2025 | + erc | 2277 | + erc |
| @@ -2149,6 +2401,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 2149 | + outline-minor-faces | 2401 | + outline-minor-faces |
| 2150 | + package (what you get with {{{kbd(M-x list-packages)}}}) | 2402 | + package (what you get with {{{kbd(M-x list-packages)}}}) |
| 2151 | + page-break-lines | 2403 | + page-break-lines |
| 2404 | + pandoc-mode | ||
| 2152 | + paradox | 2405 | + paradox |
| 2153 | + paren-face | 2406 | + paren-face |
| 2154 | + parrot | 2407 | + parrot |
| @@ -2206,7 +2459,11 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 2206 | + sx | 2459 | + sx |
| 2207 | + symbol-overlay | 2460 | + symbol-overlay |
| 2208 | + syslog-mode | 2461 | + syslog-mode |
| 2462 | + tab-bar-groups | ||
| 2463 | + tab-bar-mode | ||
| 2464 | + tab-line-mode | ||
| 2209 | + table (built-in table.el) | 2465 | + table (built-in table.el) |
| 2466 | + telega | ||
| 2210 | + telephone-line | 2467 | + telephone-line |
| 2211 | + terraform-mode | 2468 | + terraform-mode |
| 2212 | + term | 2469 | + term |
| @@ -2221,6 +2478,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 2221 | + vc (built-in mode line status for version control) | 2478 | + vc (built-in mode line status for version control) |
| 2222 | + vc-annotate (the out put of {{{kbd(C-x v g)}}}) | 2479 | + vc-annotate (the out put of {{{kbd(C-x v g)}}}) |
| 2223 | + vdiff | 2480 | + vdiff |
| 2481 | + vertico | ||
| 2224 | + vimish-fold | 2482 | + vimish-fold |
| 2225 | + visible-mark | 2483 | + visible-mark |
| 2226 | + visual-regexp | 2484 | + visual-regexp |
| @@ -2274,6 +2532,42 @@ inherit from some basic faces. Please confirm. | |||
| 2274 | This section covers information that may be of interest to users of | 2532 | This section covers information that may be of interest to users of |
| 2275 | individual packages. | 2533 | individual packages. |
| 2276 | 2534 | ||
| 2535 | ** Note for dimmer.el | ||
| 2536 | :properties: | ||
| 2537 | :custom_id: h:8eb4b758-d318-4480-9ead-357a571beb93 | ||
| 2538 | :end: | ||
| 2539 | |||
| 2540 | The {{{file(dimmer.el)}}} library by Neil Okamoto can be configured to | ||
| 2541 | automatically dim the colors of inactive Emacs windows. To guarantee | ||
| 2542 | consistent results with the Modus themes, we suggest some tweaks to the | ||
| 2543 | default styles, such as in this minimal setup: | ||
| 2544 | |||
| 2545 | #+begin_src emacs-lisp | ||
| 2546 | (use-package dimmer | ||
| 2547 | :config | ||
| 2548 | (setq dimmer-fraction 0.3) | ||
| 2549 | (setq dimmer-adjustment-mode :foreground) | ||
| 2550 | (setq dimmer-use-colorspace :rgb) | ||
| 2551 | |||
| 2552 | (dimmer-mode 1)) | ||
| 2553 | #+end_src | ||
| 2554 | |||
| 2555 | Of the above, we strongly recommend the RGB color space because it is | ||
| 2556 | the one that remains faithful to the hueness of the colors used by the | ||
| 2557 | themes. Whereas the default CIELAB space has a tendency to distort | ||
| 2558 | colors in addition to applying the dim effect, which can be somewhat | ||
| 2559 | disorienting. | ||
| 2560 | |||
| 2561 | The value of the ~dimmer-fraction~ has been selected empirically. Users | ||
| 2562 | might prefer to tweak it further (increasing it makes the dim effect | ||
| 2563 | more pronounced). | ||
| 2564 | |||
| 2565 | Changing the ~dimmer-adjustment-mode~ is a matter of preference. Though | ||
| 2566 | because the Modus themes use black and white as their base colors, any | ||
| 2567 | other value for that variable will turn the main background gray. This | ||
| 2568 | inadvertently leads to the opposite of the intended utility of this | ||
| 2569 | package: it draws too much attention to unfocused windows. | ||
| 2570 | |||
| 2277 | ** Note for display-fill-column-indicator-mode | 2571 | ** Note for display-fill-column-indicator-mode |
| 2278 | :properties: | 2572 | :properties: |
| 2279 | :custom_id: h:2a602816-bc1b-45bf-9675-4cbbd7bf6cab | 2573 | :custom_id: h:2a602816-bc1b-45bf-9675-4cbbd7bf6cab |
| @@ -2521,6 +2815,21 @@ specifications the webpage provides. | |||
| 2521 | 2815 | ||
| 2522 | Consult {{{kbd(C-h v shr-use-colors)}}}. | 2816 | Consult {{{kbd(C-h v shr-use-colors)}}}. |
| 2523 | 2817 | ||
| 2818 | |||
| 2819 | ** Note for EWW and Elfeed fonts (SHR fonts) | ||
| 2820 | :properties: | ||
| 2821 | :custom_id: h:e6c5451f-6763-4be7-8fdb-b4706a422a4c | ||
| 2822 | :end: | ||
| 2823 | |||
| 2824 | EWW and Elfeed rely on the Simple HTML Renderer to display their | ||
| 2825 | content. The {{{file(shr.el)}}} library contains the variable ~shr-use-fonts~ | ||
| 2826 | that controls whether the text in the buffer is set to a ~variable-pitch~ | ||
| 2827 | typeface (proportionately spaced) or if just retains whatever the | ||
| 2828 | default font family is. Its default value is non-nil, which means that | ||
| 2829 | ~variable-pitch~ is applied. | ||
| 2830 | |||
| 2831 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | ||
| 2832 | |||
| 2524 | ** Note for Helm grep | 2833 | ** Note for Helm grep |
| 2525 | :properties: | 2834 | :properties: |
| 2526 | :custom_id: h:d28879a2-8e4b-4525-986e-14c0f873d229 | 2835 | :custom_id: h:d28879a2-8e4b-4525-986e-14c0f873d229 |
| @@ -2748,26 +3057,28 @@ The Modus themes are a collective effort. Every bit of work matters. | |||
| 2748 | 3057 | ||
| 2749 | + Contributions to code or documentation :: Anders Johansson, Basil | 3058 | + Contributions to code or documentation :: Anders Johansson, Basil |
| 2750 | L.{{{space()}}} Contovounesios, Carlo Zancanaro, Eli Zaretskii, Kostadin | 3059 | L.{{{space()}}} Contovounesios, Carlo Zancanaro, Eli Zaretskii, Kostadin |
| 2751 | Ninev, Madhavan Krishnan, Markus Beppler, Matthew Stevenson, Nicolas | 3060 | Ninev, Madhavan Krishnan, Markus Beppler, Matthew Stevenson, Mauro |
| 2752 | De Jaeghere, Shreyas Ragavan, Stefan Kangas, Vincent Murphy, Xinglu | 3061 | Aranda, Nicolas De Jaeghere, Shreyas Ragavan, Stefan Kangas, Vincent |
| 2753 | Chen. | 3062 | Murphy, Xinglu Chen. |
| 2754 | 3063 | ||
| 2755 | + Ideas and user feedback :: Aaron Jensen, Adam Spiers, Adrian Manea, | 3064 | + Ideas and user feedback :: Aaron Jensen, Adam Spiers, Adrian Manea, |
| 2756 | Alex Griffin, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders | 3065 | Alex Griffin, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders |
| 2757 | Johansson, André Alexandre Gomes, Arif Rezai, Basil L.{{{space()}}} | 3066 | Johansson, André Alexandre Gomes, Arif Rezai, Basil L.{{{space()}}} |
| 2758 | Contovounesios, Burgess Chang, Christian Tietze, Christopher Dimech, | 3067 | Contovounesios, Burgess Chang, Christian Tietze, Christopher Dimech, |
| 2759 | Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, | 3068 | Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, |
| 2760 | Davor Rotim, Divan Santana, Gerry Agbobada, Gianluca Recchia, Gustavo | 3069 | Davor Rotim, Divan Santana, Emanuele Michele Alberto Monterosso, |
| 2761 | Barros, Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, | 3070 | Farasha Euker, Gerry Agbobada, Gianluca Recchia, Gustavo Barros, |
| 2762 | John Haman, Joshua O'Connor, Kevin Fleming, Kostadin Ninev, Len Trigg, | 3071 | Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, John |
| 2763 | Manuel Uberti, Mark Burton, Markus Beppler, Michael Goldenberg, Morgan | 3072 | Haman, Joshua O'Connor, Kevin Fleming, Kévin Le Gouguec, Kostadin |
| 2764 | Smith, Murilo Pereira, Nicolas De Jaeghere, Paul Poloskov, Pete | 3073 | Ninev, Len Trigg, Manuel Uberti, Mark Burton, Markus Beppler, Mauro |
| 2765 | Kazmier, Peter Wu, Philip K., Pierre Téchoueyres, Roman Rudakov, Ryan | 3074 | Aranda, Michael Goldenberg, Morgan Smith, Murilo Pereira, Nicky van |
| 2766 | Phillips, Sam Kleinman, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, | 3075 | Foreest, Nicolas De Jaeghere, Paul Poloskov, Pete Kazmier, Peter Wu, |
| 2767 | Thibaut Verron, Trey Merkley, Togan Muftuoglu, Toon Claes, Uri Sharf, | 3076 | Philip K., Pierre Téchoueyres, Roman Rudakov, Ryan Phillips, Sam |
| 2768 | Utkarsh Singh, Vincent Foley. As well as users: Ben, CsBigDataHub1, | 3077 | Kleinman, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, Thibaut Verron, |
| 2769 | Emacs Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, TheBlob42, | 3078 | Trey Merkley, Togan Muftuoglu, Toon Claes, Uri Sharf, Utkarsh Singh, |
| 2770 | bepolymathe, doolio, fleimgruber, iSeeU, jixiuf, okamsn. | 3079 | Vincent Foley. As well as users: Ben, CsBigDataHub1, Emacs Contrib, |
| 3080 | Eugene, Fourchaux, Fredrik, Moesasji, Nick, TheBlob42, Trey, | ||
| 3081 | bepolymathe, doolio, fleimgruber, iSeeU, jixiuf, okamsn, pRot0ta1p. | ||
| 2771 | 3082 | ||
| 2772 | + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn | 3083 | + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn |
| 2773 | Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs), | 3084 | Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs), |
| @@ -2819,6 +3130,7 @@ And here are the canonical sources of this project's documentation: | |||
| 2819 | #+texinfo: @include doclicense.texi | 3130 | #+texinfo: @include doclicense.texi |
| 2820 | 3131 | ||
| 2821 | #+begin_export html | 3132 | #+begin_export html |
| 3133 | <pre> | ||
| 2822 | 3134 | ||
| 2823 | GNU Free Documentation License | 3135 | GNU Free Documentation License |
| 2824 | Version 1.3, 3 November 2008 | 3136 | Version 1.3, 3 November 2008 |
| @@ -3270,6 +3582,7 @@ If your document contains nontrivial examples of program code, we | |||
| 3270 | recommend releasing these examples in parallel under your choice of | 3582 | recommend releasing these examples in parallel under your choice of |
| 3271 | free software license, such as the GNU General Public License, | 3583 | free software license, such as the GNU General Public License, |
| 3272 | to permit their use in free software. | 3584 | to permit their use in free software. |
| 3585 | </pre> | ||
| 3273 | #+end_export | 3586 | #+end_export |
| 3274 | 3587 | ||
| 3275 | #+html: <!-- | 3588 | #+html: <!-- |