diff --git a/.gitignore b/.gitignore index 5af5831..4e14440 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.elc *-autoloads.el *-pkg.el -*.texi doc/fdl-1.3.txt diff --git a/doc/modus-themes.info b/doc/modus-themes.info index cd42543..b05dfb5 100644 --- a/doc/modus-themes.info +++ b/doc/modus-themes.info @@ -20,9 +20,17 @@ File: modus-themes.info, Node: Top, Next: Overview, Up: (dir) Modus themes for GNU Emacs ************************** -This manual, written by Protesilaos Stavrou, describes the customization -options for the ‘modus-operandi’ and ‘modus-vivendi’ themes, and -provides every other piece of information pertinent to them. +Copyright (C) 2020-2021 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, with no Front-Cover Texts, + and with no Back-Cover Texts. + + This manual, written by Protesilaos Stavrou, describes the +customization options for the ‘modus-operandi’ and ‘modus-vivendi’ +themes, and provides every other piece of information pertinent to them. The documentation furnished herein corresponds to stable version 1.1.1, released on 2021-01-25. Any reference to a newer feature which @@ -30,7 +38,7 @@ does not yet form part of the latest tagged commit, is explicitly marked as such. Current development target is 1.2.0-dev. This manual was rebuilt on -2021-02-24 07:47 +0200. +2021-02-24 09:09 +0200. * Menu: @@ -76,11 +84,11 @@ Customization Options * Slanted constructs:: Toggle slanted constructs (italics) in code * Syntax styles:: Choose the overall aesthetic of code syntax * No mixed fonts:: Toggle mixing of font families -* Link styles:: Choose link color intensity for the text or underline, or no underline at all +* Link styles:: Choose among several styles, with or without underline * Command prompts:: Choose among plain, subtle, or intense prompts -* Mode line:: Choose among plain, three-dimensional, or Moody-compliant styles +* Mode line:: Choose among several styles, with or without borders * Completion UIs:: Choose among standard, moderate, or opinionated looks -* Fringes:: Choose among invisible, subtle, or intense fringe visibility +* Fringes:: Choose among invisible, subtle, or intense fringe styles * Language checkers:: Control the style of language checkers/linters * Line highlighting:: Toggle intense style for current line highlighting * Line numbers:: Toggle subtle style for line numbers @@ -229,10 +237,10 @@ stored in ‘~/.emacs.d’ and that you want to place the Modus themes in 1. Get the source and store it in the desired path by running the following in the command line shell: - git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes + $ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes 1. Add that path to your known Elisp libraries’ list, by placing this - snippet of Emacs Lisp in your init file (say, your ‘init.el’): + snippet of Emacs Lisp in your init file (e.g. ‘init.el’): (add-to-list 'load-path "~/.emacs.d/modus-themes") @@ -350,9 +358,9 @@ is how a basic setup should look like: ‘modus-themes-load-operandi’ and ‘modus-themes-load-vivendi’, as well as ‘modus-themes-toggle’ which relies on them: - 1. Those functions use ‘load-theme’. Some users may not want that, - opting for ‘enable-theme’ instead (*note Differences between - loading and enabling::). + 1. Those functions use ‘load-theme’. Some users prefer opting for + ‘enable-theme’ instead (*note Differences between loading and + enabling::). 2. The functions will run the ‘modus-themes-after-load-theme-hook’ as their final step. This can be employed for bespoke configurations @@ -451,7 +459,7 @@ File: modus-themes.info, Node: Customization Options, Next: Advanced customiza The Modus themes are highly configurable, though they should work well without any further tweaks. By default, all customization options are -set to ‘nil’. +set to nil. Remember that all customization options must be evaluated before loading a theme (*note Enable and load::). @@ -462,11 +470,11 @@ loading a theme (*note Enable and load::). * Slanted constructs:: Toggle slanted constructs (italics) in code * Syntax styles:: Choose the overall aesthetic of code syntax * No mixed fonts:: Toggle mixing of font families -* Link styles:: Choose link color intensity for the text or underline, or no underline at all +* Link styles:: Choose among several styles, with or without underline * Command prompts:: Choose among plain, subtle, or intense prompts -* Mode line:: Choose among plain, three-dimensional, or Moody-compliant styles +* Mode line:: Choose among several styles, with or without borders * Completion UIs:: Choose among standard, moderate, or opinionated looks -* Fringes:: Choose among invisible, subtle, or intense fringe visibility +* Fringes:: Choose among invisible, subtle, or intense fringe styles * Language checkers:: Control the style of language checkers/linters * Line highlighting:: Toggle intense style for current line highlighting * Line numbers:: Toggle subtle style for line numbers @@ -580,12 +588,13 @@ Symbol: ‘modus-themes-no-mixed-fonts’ 1. ‘nil’ (default) 2. ‘t’ - By default, the themes configure some spacing-sensitive faces, such -as Org tables and code blocks, to always inherit from the ‘fixed-pitch’ -face. This is to ensure that those constructs remain monospaced when -users opt for something like the built-in ‘M-x variable-pitch-mode’. -Otherwise the layout would appear broken. To disable this behaviour, -set the option to ‘t’. + By default, the themes configure some spacing-sensitive faces like +Org tables and code blocks to always inherit from the ‘fixed-pitch’ +face. This is to ensure that those constructs remain monospaced even +when users opt for a mode that remaps typeface families, such as the +built-in ‘M-x variable-pitch-mode’. Otherwise the layout would appear +broken, due to how spacing is done. To disable this behaviour, set the +option to ‘t’. Users may prefer to use another package for handling mixed typeface configurations, rather than letting the theme do it, perhaps because a @@ -653,10 +662,8 @@ Symbol: ‘modus-themes-prompts’ Possible values: 1. ‘nil’ (default) - 2. ‘subtle-accented’ (‘subtle’ value remains for backward - compatibility) - 3. ‘intense-accented’ (‘intense’ value remains for backward - compatibility) + 2. ‘subtle-accented’ (‘subtle’ remains for backward compatibility) + 3. ‘intense-accented’ (‘intense’ remains for backward compatibility) 4. ‘subtle-gray’ 5. ‘intense-gray’ @@ -845,7 +852,7 @@ background, and a suitable foreground. All are color-coded. This is the most intense combination of face properties. The present variable affects packages and/or face groups such as -those of ‘flyspell’, ‘flymake’, ‘flycheck’, ‘artbollocks-mode’, +those of ‘flyspell’, ‘flymake’, ‘flycheck’, ‘artbollocks-mode’, and ‘writegood-mode’. NOTE: The placement of the straight underline, though not the wave @@ -931,7 +938,7 @@ of bold typographic weight (inherits the ‘bold’ face). bold weight. This customization variable affects tools such as the built-in -‘show-paren-mode’ and ‘smartparens’. +‘show-paren-mode’ and the ‘smartparens’ package.  File: modus-themes.info, Node: Active region, Next: Diffs, Prev: Matching parentheses, Up: Customization Options @@ -978,10 +985,10 @@ Symbol: ‘modus-themes-diffs’ 4. ‘bg-only’ By default the themes apply rich coloration to the output of diffs, -such as those of ‘diff-mode’, ‘ediff’, ‘smerge-mode’, and ‘magit’. -These are color combinations of an accented background and foreground so -that, for example, added lines have a pronounced green background with -an appropriate shade of green for the affected text. Word-wise or +such as those of ‘diff-mode’, ‘ediff’, ‘smerge-mode’, and Magit. These +are color combinations of an accented background and foreground so that, +for example, added lines have a pronounced green background with an +appropriate shade of green for the affected text. Word-wise or “refined” changes follow this pattern but use different shades of those colors to remain distinct. @@ -1042,9 +1049,10 @@ for users who work on literate programming documents that mix and match several languages. Note that the “rainbow” blocks may require you to also reload the -major-mode so that the colors are applied properly: use ‘M-x org-mode’ -or ‘M-x org-mode-restart’ to refresh the buffer. Or start typing in -each code block (inefficient at scale, but it still works). +major-mode so that the colors are applied consistently throughout: use +‘M-x org-mode’ or ‘M-x org-mode-restart’ to refresh the buffer. Or +start typing in each code block (inefficient at scale, but it still +works).  File: modus-themes.info, Node: Org agenda habits, Next: Heading styles, Prev: Org mode blocks, Up: Customization Options @@ -1635,7 +1643,7 @@ File: modus-themes.info, Node: Override colors (DIY), Next: Font configuration The themes provide a mechanism for overriding their color values. This is controlled by the variables ‘modus-themes-operandi-color-overrides’ and ‘modus-themes-vivendi-color-overrides’, which are alists that should -mirror a subset of the associations in ‘modus-=themes-operandi-colors’ +mirror a subset of the associations in ‘modus-themes-operandi-colors’ and ‘modus-themes-vivendi-colors’ respectively. As with all customisations, overriding must be done before loading the affected theme. @@ -1802,8 +1810,8 @@ themes. Please bear in mind that the end result of those is not controlled by the active Modus theme but by how Org maps faces to its constructs. -Editing those while ‘org-mode’ is active requires ‘M-x org-mode-restart’ -for changes to take effect. +Editing those while ‘org-mode’ is active requires re-initialization of +the mode with ‘M-x org-mode-restart’ for changes to take effect. Let us assume you wish to visually differentiate your keywords. You have something like this: @@ -1849,8 +1857,8 @@ configuration of the priority cookies: (?C . '(shadow org-priority)))) To find all the faces that are loaded in your current Emacs session, -use ‘M-x list-faces-display’. Also try ‘M-x describe-variable’ and then -specify the name of each of those Org variables demonstrated above. +use ‘M-x list-faces-display’. Try ‘M-x describe-variable’ as well and +then specify the name of each of those Org variables demonstrated above. Their documentation strings will offer you further guidance. Recall that the themes let you retrieve a color from their palette. @@ -1938,7 +1946,7 @@ automatically at sunrise and sunset. This can be accomplished by specifying the coordinates of one’s location using the built-in ‘solar.el’ and then configuring the -‘circadian’ library: +‘circadian’ package: (use-package solar ; built-in :config @@ -1963,9 +1971,9 @@ varying skill levels, from beginners to experts. This means that we try to make things easier by not expecting anyone reading this document to be proficient in Emacs Lisp or programming in general. - One such case is with the use of the -‘modus-themes-after-load-theme-hook’, which runs every time -‘modus-themes-toggle,’ ‘modus-themes-load-operandi’, or + Such a case is with the use of the +‘modus-themes-after-load-theme-hook’, which runs after +‘modus-themes-toggle’, ‘modus-themes-load-operandi’, or ‘modus-themes-load-vivendi’ is evaluated. We recommend using that hook for advanced customizations, because (1) we know for sure that it is available once the themes are loaded, and (2) anyone consulting this @@ -2050,7 +2058,7 @@ have lots of extensions, so the “full support” may not be 100% true… • calfw • centaur-tabs • cfrs - • change-log and log-view (such as ‘vc-print-log’ and + • change-log and log-view (such as ‘vc-print-log’, ‘vc-print-root-log’) • cider • circe @@ -2069,7 +2077,7 @@ have lots of extensions, so the “full support” may not be 100% true… • cperl-mode • csv-mode • ctrlf - • custom (‘M-x customize’) + • custom (what you get with ‘M-x customize’) • dap-mode • dashboard (emacs-dashboard) • deadgrep @@ -2231,7 +2239,7 @@ have lots of extensions, so the “full support” may not be 100% true… • origami • outline-mode • outline-minor-faces - • package (‘M-x list-packages’) + • package (what you get with ‘M-x list-packages’) • page-break-lines • paradox • paren-face @@ -2301,7 +2309,7 @@ have lots of extensions, so the “full support” may not be 100% true… • typescript • undo-tree • vc (built-in mode line status for version control) - • vc-annotate (‘C-x v g’) + • vc-annotate (the out put of ‘C-x v g’) • vdiff • vimish-fold • visible-mark @@ -2408,7 +2416,7 @@ File: modus-themes.info, Node: Note for prism, Next: Note on company-mode over 7.2 Note for prism.el ===================== -This library by Adam Porter, aka “alphapapa” or “github-alphapapa”, +This package by Adam Porter, aka “alphapapa” or “github-alphapapa”, implements an alternative to the typical coloration of code. Instead of highligting the syntactic constructs, it applies color to different levels of depth in the code. @@ -2533,7 +2541,7 @@ accessibility standard of the themes: Modus Operandi Use foreground color 1 for all backgrounds from 2-15. Like so: - ‘C-q C-c1,N’ where ‘N’ is the background. + ‘C-q C-c1’ where ‘N’ is the background. Modus Vivendi Use foreground color 0 for all backgrounds from 2-13. Use @@ -2565,7 +2573,9 @@ File: modus-themes.info, Node: Note on SHR colors, Next: Note for Helm grep, Emacs’ HTML rendering library (‘shr.el’) may need explicit configuration to respect the theme’s colors instead of whatever specifications the -webpage provides. Consult ‘C-h v shr-use-colors’. +webpage provides. + + Consult ‘C-h v shr-use-colors’.  File: modus-themes.info, Node: Note for Helm grep, Next: Note on vc-annotate-background-mode, Prev: Note on SHR colors, Up: Notes for individual packages @@ -2579,7 +2589,8 @@ matches of a grep or grep-like command (‘ag’ or ‘ripgrep’). It is not pass ‘--color=always’ as a command-line option for their command. Here is the docstring for that face, which is defined in the -‘helm-grep.el’ library (view a library with ‘M-x find-library’). +‘helm-grep.el’ library (you can visit the source code with ‘M-x +find-library’). Face used to highlight grep matches. Have no effect when grep backend use “–color=” @@ -3371,6 +3382,8 @@ B.1 Function index * modus-themes-load-themes: Enable and load. (line 6) * modus-themes-load-vivendi: Enable and load. (line 6) * modus-themes-toggle: Enable and load. (line 6) +* modus-themes-wcag-formula: Measure color contrast (DIY). + (line 6) * modus-themes-with-colors: Face specs at scale using the themes' palette (DIY). (line 6) @@ -3450,79 +3463,79 @@ B.3 Concept index  Tag Table: Node: Top586 -Node: Overview4826 -Node: How do the themes look like6092 -Node: Learn about the latest changes6600 -Node: Installation6982 -Node: Install manually from source7463 -Node: Install from the archives8290 -Node: Install on GNU/Linux9067 -Node: Debian 11 Bullseye9515 -Node: GNU Guix9990 -Node: Enable and load10279 -Node: Sample configuration for use-package12619 -Node: Differences between loading and enabling13881 -Node: Customization Options15919 -Node: Bold constructs18136 -Node: Slanted constructs18725 -Node: Syntax styles19272 -Node: No mixed fonts20950 -Node: Link styles21987 -Node: Command prompts23593 -Node: Mode line24816 -Node: Completion UIs28007 -Node: Fringes29839 -Node: Language checkers30499 -Node: Line highlighting32444 -Node: Line numbers33061 -Node: Matching parentheses34175 -Node: Active region35053 -Node: Diffs35989 -Node: Org mode blocks38280 -Node: Org agenda habits39623 -Node: Heading styles41458 -Node: Scaled headings45457 -Node: Scaled heading sizes46060 -Node: UI typeface49194 -Node: Headings' typeface50040 -Node: Advanced customization (do-it-yourself)50664 -Node: Per-theme customization settings (DIY)51822 -Node: Case-by-case face specs using the themes' palette (DIY)53168 -Node: Face specs at scale using the themes' palette (DIY)57534 -Node: Override colors (DIY)64359 -Node: Font configurations for Org and others (DIY)68982 -Ref: Font configurations for Org and others (DIY)-Footnote-171305 -Node: Custom Org user faces (DIY)71492 -Node: Measure color contrast (DIY)74808 -Node: Load theme depending on time of day77575 -Node: A theme-agnostic hook for theme loading (DIY)78612 -Node: Face coverage80971 -Node: Supported packages81441 -Node: Indirectly covered packages88005 -Node: Notes for individual packages88488 -Node: Note for display-fill-column-indicator-mode89074 -Node: Note for prism90652 -Node: Note on company-mode overlay pop-up93617 -Ref: Note on company-mode overlay pop-up-Footnote-194304 -Ref: Note on company-mode overlay pop-up-Footnote-294371 -Node: Note for ERC escaped color sequences94426 -Ref: Note for ERC escaped color sequences-Footnote-195859 -Node: Note for powerline or spaceline95969 -Node: Note on SHR colors96385 -Node: Note for Helm grep96795 -Node: Note on vc-annotate-background-mode98240 -Node: Note on pdf-tools link hints99125 -Node: Contributing101556 -Node: Sources of the themes101956 -Node: Issues you can help with102694 -Node: Patches require copyright assignment to the FSF103894 -Node: Acknowledgements106189 -Node: Meta108307 -Node: GNU Free Documentation License110147 -Node: Indices135157 -Node: Function index135336 -Node: Variable index136429 -Node: Concept index138351 +Node: Overview5158 +Node: How do the themes look like6424 +Node: Learn about the latest changes6932 +Node: Installation7314 +Node: Install manually from source7795 +Node: Install from the archives8620 +Node: Install on GNU/Linux9397 +Node: Debian 11 Bullseye9845 +Node: GNU Guix10320 +Node: Enable and load10609 +Node: Sample configuration for use-package12937 +Node: Differences between loading and enabling14199 +Node: Customization Options16237 +Node: Bold constructs18409 +Node: Slanted constructs18998 +Node: Syntax styles19545 +Node: No mixed fonts21223 +Node: Link styles22320 +Node: Command prompts23926 +Node: Mode line25127 +Node: Completion UIs28318 +Node: Fringes30150 +Node: Language checkers30810 +Node: Line highlighting32759 +Node: Line numbers33376 +Node: Matching parentheses34490 +Node: Active region35380 +Node: Diffs36316 +Node: Org mode blocks38602 +Node: Org agenda habits39960 +Node: Heading styles41795 +Node: Scaled headings45794 +Node: Scaled heading sizes46397 +Node: UI typeface49531 +Node: Headings' typeface50377 +Node: Advanced customization (do-it-yourself)51001 +Node: Per-theme customization settings (DIY)52159 +Node: Case-by-case face specs using the themes' palette (DIY)53505 +Node: Face specs at scale using the themes' palette (DIY)57871 +Node: Override colors (DIY)64696 +Node: Font configurations for Org and others (DIY)69318 +Ref: Font configurations for Org and others (DIY)-Footnote-171641 +Node: Custom Org user faces (DIY)71828 +Node: Measure color contrast (DIY)75182 +Node: Load theme depending on time of day77949 +Node: A theme-agnostic hook for theme loading (DIY)78986 +Node: Face coverage81338 +Node: Supported packages81808 +Node: Indirectly covered packages88420 +Node: Notes for individual packages88903 +Node: Note for display-fill-column-indicator-mode89489 +Node: Note for prism91067 +Node: Note on company-mode overlay pop-up94032 +Ref: Note on company-mode overlay pop-up-Footnote-194719 +Ref: Note on company-mode overlay pop-up-Footnote-294786 +Node: Note for ERC escaped color sequences94841 +Ref: Note for ERC escaped color sequences-Footnote-196272 +Node: Note for powerline or spaceline96382 +Node: Note on SHR colors96798 +Node: Note for Helm grep97211 +Node: Note on vc-annotate-background-mode98671 +Node: Note on pdf-tools link hints99556 +Node: Contributing101987 +Node: Sources of the themes102387 +Node: Issues you can help with103125 +Node: Patches require copyright assignment to the FSF104325 +Node: Acknowledgements106620 +Node: Meta108738 +Node: GNU Free Documentation License110578 +Node: Indices135588 +Node: Function index135767 +Node: Variable index137004 +Node: Concept index138926  End Tag Table diff --git a/doc/modus-themes.org b/doc/modus-themes.org index 4020fbd..5af246a 100644 --- a/doc/modus-themes.org +++ b/doc/modus-themes.org @@ -7,22 +7,33 @@ #+TEXINFO_DIR_TITLE: Modus Themes: (modus-themes) #+TEXINFO_DIR_DESC: Highly accessible themes (WCAG AAA) #+OPTIONS: ':t toc:nil author:t email:t +#+TEXINFO_HEADER: @set MAINTAINERSITE @uref{https://protesilaos.com,maintainer webpage} +#+TEXINFO_HEADER: @set MAINTAINER Protesilaos Stavrou +#+TEXINFO_HEADER: @set MAINTAINEREMAIL @email{info@protesilaos.com} +#+TEXINFO_HEADER: @set MAINTAINERCONTACT @uref{mailto:info@protesilaos.com,contact the maintainer} #+MACRO: stable-version 1.1.1 #+MACRO: release-date 2021-01-25 #+MACRO: development-version 1.2.0-dev #+MACRO: export-date (eval (format-time-string "%F %R %z" (current-time))) +#+MACRO: file @@texinfo:@file{@@$1@@texinfo:}@@ +# The "kbd" macro turns KBD into @kbd{KBD}. Additionally, it +# encloses case-sensitive special keys (SPC, RET...) within @key{...}. +# I got this from the Org source code. +#+MACRO: kbd (eval (let ((case-fold-search nil) (regexp (regexp-opt '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "Ctrl" "Meta" "Alt" "Cmd" "Super" "UP" "LEFT" "RIGHT" "DOWN") 'words))) (format "@@texinfo:@kbd{@@%s@@texinfo:}@@" (replace-regexp-in-string regexp "@@texinfo:@key{@@\\&@@texinfo:}@@" $1 t)))) + +#+TEXINFO: @insertcopying This manual, written by Protesilaos Stavrou, describes the customization -options for the =modus-operandi= and =modus-vivendi= themes, and provides -every other piece of information pertinent to them. +options for the ~modus-operandi~ and ~modus-vivendi~ themes, and +provides every other piece of information pertinent to them. The documentation furnished herein corresponds to stable version -{{{stable-version}}}, released on {{{release-date}}}. Any reference to a newer -feature which does not yet form part of the latest tagged commit, is -explicitly marked as such. +{{{stable-version}}}, released on {{{release-date}}}. Any reference to +a newer feature which does not yet form part of the latest tagged +commit, is explicitly marked as such. -Current development target is {{{development-version}}}. This manual was -rebuilt on {{{export-date}}}. +Current development target is {{{development-version}}}. This manual +was rebuilt on {{{export-date}}}. #+TOC: headlines 8 insert TOC here, with eight headline levels @@ -53,8 +64,8 @@ combination of background and foreground values. This corresponds to the WCAG AAA standard, which specifies a minimum rate of distance in relative luminance of 7:1. -Modus Operandi (=modus-operandi=) is a light theme, while Modus Vivendi -(=modus-vivendi=) is dark. Each theme's color palette is designed to +Modus Operandi (~modus-operandi~) is a light theme, while Modus Vivendi +(~modus-vivendi~) is dark. Each theme's color palette is designed to meet the needs of the numerous interfaces that are possible in the Emacs computing environment. @@ -114,12 +125,10 @@ stored in =~/.emacs.d= and that you want to place the Modus themes in 1. Get the source and store it in the desired path by running the following in the command line shell: -#+begin_src sh -git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes -#+end_src +: $ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes 2. Add that path to your known Elisp libraries' list, by placing this - snippet of Emacs Lisp in your init file (say, your =init.el=): + snippet of Emacs Lisp in your init file (e.g. {{{file(init.el)}}}): #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/modus-themes") @@ -136,8 +145,9 @@ The =modus-themes= package is available from the GNU ELPA archive, which is configured by default. Prior to querying any package archive, make sure to have updated the -index, with =M-x package-refresh-contents=. Then all you need to do is -type =M-x package-install= and specify the =modus-themes=. +index, with {{{kbd(M-x package-refresh-contents)}}}. Then all you need +to do is type {{{kbd(M-x package-install)}}} and specify the +~modus-themes~. Note that older versions of the themes used to be distributed as standalone packages. This practice has been discontinued starting with @@ -203,7 +213,7 @@ Before you load a theme, it is necessary to require the main library: #+end_src Then load the individual theme files with the helper function -=modus-themes-load-themes=: +~modus-themes-load-themes~: #+begin_src emacs-lisp ;; Load the theme files before enabling a theme (else you get an error). @@ -243,13 +253,13 @@ setup should look like: [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration for use-package]]. With those granted, bear in mind a couple of technical points on -=modus-themes-load-operandi= and =modus-themes-load-vivendi=, as well as -=modus-themes-toggle= which relies on them: +~modus-themes-load-operandi~ and ~modus-themes-load-vivendi~, as well as +~modus-themes-toggle~ which relies on them: -1. Those functions use =load-theme=. Some users may not want that, opting - for =enable-theme= instead ([[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]). +1. Those functions use ~load-theme~. Some users prefer opting for + ~enable-theme~ instead ([[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]). -2. The functions will run the =modus-themes-after-load-theme-hook= as +2. The functions will run the ~modus-themes-after-load-theme-hook~ as their final step. This can be employed for bespoke configurations ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization (do-it-yourself)]]). Experienced users may not wish to rely on such a hook and the functions that run it: they may @@ -261,7 +271,7 @@ With those granted, bear in mind a couple of technical points on :END: #+CINDEX: use-package configuration -It is common for Emacs users to rely on =use-package= for declaring +It is common for Emacs users to rely on ~use-package~ for declaring package configurations in their setup. We use this as an example: #+begin_src emacs-lisp @@ -282,9 +292,9 @@ package configurations in their setup. We use this as an example: [[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]. -Note: make sure not to customize the variable =custom-theme-load-path= or -=custom-theme-directory= after the themes' package declaration. That will -lead to failures in loading the files. If either or both of those +Note: make sure not to customize the variable ~custom-theme-load-path~ +or ~custom-theme-directory~ after the themes' package declaration. That +will lead to failures in loading the files. If either or both of those variables need to be changed, their values should be defined before the package declaration of the themes. @@ -294,26 +304,26 @@ package declaration of the themes. :END: #+CINDEX: load-theme VS enable-theme -The reason we recommend =load-theme= instead of the other option of -=enable-theme= is that the former does a kind of "reset" on the face +The reason we recommend ~load-theme~ instead of the other option of +~enable-theme~ is that the former does a kind of "reset" on the face specs. It quite literally loads (or re-loads) the theme. Whereas the latter simply puts an already loaded theme at the top of the list of enabled items, re-using whatever state was last loaded. -As such, =load-theme= reads all customizations that may happen during any -given Emacs session: even after the initial setup of a theme. Examples -are calls to =custom-set-faces=, as well as new values assigned to the -options the Modus themes provide ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). +As such, ~load-theme~ reads all customizations that may happen during +any given Emacs session: even after the initial setup of a theme. +Examples are calls to ~custom-set-faces~, as well as new values assigned +to the options the Modus themes provide ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). -Our tests show that =enable-theme= does not read such variables anew, so +Our tests show that ~enable-theme~ does not read such variables anew, so it might appear to the unsuspecting user that the themes are somehow -broken whenever they try to assign a new value to a customization -option or some face. +broken whenever they try to assign a new value to a customization option +or some face. -This "reset" that =load-theme= conducts does, however, come at the cost of -being somewhat slower than =enable-theme=. Users who have a stable setup -and who seldom update their variables during a given Emacs session, are -better off using something like this: +This "reset" that ~load-theme~ conducts does, however, come at the cost +of being somewhat slower than ~enable-theme~. Users who have a stable +setup and who seldom update their variables during a given Emacs +session, are better off using something like this: #+begin_src emacs-lisp (require 'modus-themes) @@ -326,8 +336,8 @@ better off using something like this: [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration for use-package]]. With the above granted, other sections of the manual discuss how to -configure custom faces, where =load-theme= is expected, though -=enable-theme= could still apply in stable setups: +configure custom faces, where ~load-theme~ is expected, though +~enable-theme~ could still apply in stable setups: [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]. @@ -340,7 +350,7 @@ configure custom faces, where =load-theme= is expected, though The Modus themes are highly configurable, though they should work well without any further tweaks. By default, all customization options are -set to =nil=. +set to nil. Remember that all customization options must be evaluated before loading a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). @@ -353,7 +363,7 @@ a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). :END: #+VINDEX: modus-themes-bold-constructs -Symbol: =modus-themes-bold-constructs= +Symbol: ~modus-themes-bold-constructs~ Possible values: @@ -376,7 +386,7 @@ prompts. :END: #+VINDEX: modus-themes-slanted-constructs -Symbol: =modus-themes-slanted-constructs= +Symbol: ~modus-themes-slanted-constructs~ Possible values: @@ -397,46 +407,46 @@ This typically affects documentation strings and code comments. :END: #+VINDEX: modus-themes-syntax -Symbol: =modus-themes-syntax= +Symbol: ~modus-themes-syntax~ Possible values: 1. =nil= (default) -2. =faint= -3. =yellow-comments= -4. =green-strings= -5. =yellow-comments-green-strings= -6. =alt-syntax= -7. =alt-syntax-yellow-comments= -8. =faint-yellow-comments= (coming in version =1.2.0=) +2. ~faint~ +3. ~yellow-comments~ +4. ~green-strings~ +5. ~yellow-comments-green-strings~ +6. ~alt-syntax~ +7. ~alt-syntax-yellow-comments~ +8. ~faint-yellow-comments~ (coming in version =1.2.0=) The default style (nil) for code syntax highlighting is a balanced combination of colors on the cyan-blue-magenta side of the spectrum. There is little to no use of greens, yellows, or reds, except when it is necessary. -Option =faint= is like the default in terms of the choice of palette but +Option ~faint~ is like the default in terms of the choice of palette but applies desaturated color values. -Option =yellow-comments= applies a yellow tint to comments. The rest of +Option ~yellow-comments~ applies a yellow tint to comments. The rest of the syntax is the same as the default. -Option =green-strings= replaces the blue/cyan/cold color variants in +Option ~green-strings~ replaces the blue/cyan/cold color variants in strings with greener alternatives. The rest of the syntax remains the same. -Option =yellow-comments-green-strings= combines yellow comments with green -strings and the rest of the default syntax highlighting style. +Option ~yellow-comments-green-strings~ combines yellow comments with +green strings and the rest of the default syntax highlighting style. -Option =alt-syntax= expands the active spectrum by applying color +Option ~alt-syntax~ expands the active spectrum by applying color combinations with more contrasting hues between them. Expect to find more red and green variants in addition to cyan, blue, magenta. -Option =alt-syntax-yellow-comments= combines =alt-syntax= with -=yellow-comments=. +Option ~alt-syntax-yellow-comments~ combines ~alt-syntax~ with +~yellow-comments~. -Option =faint-yellow-comments= combines the =faint= style with -=yellow-comments=. +Option ~faint-yellow-comments~ combines the ~faint~ style with +~yellow-comments~. ** Option for no font mixing :PROPERTIES: @@ -446,74 +456,75 @@ Option =faint-yellow-comments= combines the =faint= style with :END: #+VINDEX: modus-themes-no-mixed-fonts -Symbol: =modus-themes-no-mixed-fonts= +Symbol: ~modus-themes-no-mixed-fonts~ Possible values: 1. =nil= (default) 2. =t= -By default, the themes configure some spacing-sensitive faces, such as -Org tables and code blocks, to always inherit from the =fixed-pitch= face. -This is to ensure that those constructs remain monospaced when users opt -for something like the built-in =M-x variable-pitch-mode=. Otherwise the -layout would appear broken. To disable this behaviour, set the option -to =t=. +By default, the themes configure some spacing-sensitive faces like Org +tables and code blocks to always inherit from the ~fixed-pitch~ face. +This is to ensure that those constructs remain monospaced even when +users opt for a mode that remaps typeface families, such as the built-in +{{{kbd(M-x variable-pitch-mode)}}}. Otherwise the layout would appear +broken, due to how spacing is done. To disable this behaviour, set the +option to =t=. Users may prefer to use another package for handling mixed typeface configurations, rather than letting the theme do it, perhaps because a purpose-specific package has extra functionality. Two possible options -are =org-variable-pitch= and =mixed-pitch=. +are ~org-variable-pitch~ and ~mixed-pitch~. [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org (and others)]]. ** Option for links :PROPERTIES: :ALT_TITLE: Link styles -:DESCRIPTION: Choose link color intensity for the text or underline, or no underline at all +:DESCRIPTION: Choose among several styles, with or without underline :CUSTOM_ID: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 :END: #+VINDEX: modus-themes-links -Symbol: =modus-themes-links= +Symbol: ~modus-themes-links~ Possible values: 1. =nil= (default) -2. =faint= -3. =neutral-underline= -4. =faint-neutral-underline= -5. =no-underline= -6. =underline-only= -7. =neutral-underline-only= (coming in version =1.2.0=) +2. ~faint~ +3. ~neutral-underline~ +4. ~faint-neutral-underline~ +5. ~no-underline~ +6. ~underline-only~ +7. ~neutral-underline-only~ (coming in version =1.2.0=) The default style (nil) for links is to apply an underline and a saturated color to the affected text. The color of the two is the same, which makes the link fairly prominent. -Option =faint= follows the same approach as the default, but uses less +Option ~faint~ follows the same approach as the default, but uses less intense colors. -Option =neutral-underline= changes the underline's color to a subtle +Option ~neutral-underline~ changes the underline's color to a subtle gray, while retaining the default text color. -Option =faint-neutral-underline= combines a desaturated text color with a -subtle gray underline. +Option ~faint-neutral-underline~ combines a desaturated text color with +a subtle gray underline. -Option =no-underline= removes link underlines altogether, while retaining -their original fairly vivid color. +Option ~no-underline~ removes link underlines altogether, while +retaining their original fairly vivid color. -Option =underline-only= applies a prominent underline while making the +Option ~underline-only~ applies a prominent underline while making the affected text colorless (it uses the same foreground as the theme's default). -Option =neutral-underline-only= makes the text colorless while using a +Option ~neutral-underline-only~ makes the text colorless while using a subtle gray underline below it. NOTE: The placement of the underline, i.e. its proximity to the affected -text, is controlled by the built-in =x-underline-at-descent-line=, -=x-use-underline-position-properties=, =underline-minimum-offset=. Please -refer to their documentation strings. +text, is controlled by the built-in ~x-underline-at-descent-line~, +~x-use-underline-position-properties~, ~underline-minimum-offset~. +Please refer to their documentation strings. ** Option for command prompt styles :PROPERTIES: @@ -523,20 +534,20 @@ refer to their documentation strings. :END: #+VINDEX: modus-themes-prompts -Symbol: =modus-themes-prompts= +Symbol: ~modus-themes-prompts~ Possible values: 1. =nil= (default) -2. =subtle-accented= (=subtle= value remains for backward compatibility) -3. =intense-accented= (=intense= value remains for backward compatibility) -4. =subtle-gray= -5. =intense-gray= +2. ~subtle-accented~ (~subtle~ remains for backward compatibility) +3. ~intense-accented~ (~intense~ remains for backward compatibility) +4. ~subtle-gray~ +5. ~intense-gray~ The default does not use any background for minibuffer and command line prompts. It relies exclusively on an accented foreground color. -Options =subtle-accented= and =intense-accented= will change both the +Options ~subtle-accented~ and ~intense-accented~ will change both the background and the foreground values to use accented color combinations that follow the hue of the default styles' foreground (e.g. the default minibuffer prompt is cyan text, so these combinations will involved a @@ -544,72 +555,72 @@ cyan background and an appropriate cyan foreground). The difference between the two is that the latter has a more pronounced/noticeable effect than the former. -Options =subtle-gray=, =intense-gray= are like their accented counterparts, -except they use grayscale values. +Options ~subtle-gray~, ~intense-gray~ are like their accented +counterparts, except they use grayscale values. ** Option for mode line presentation :PROPERTIES: :ALT_TITLE: Mode line -:DESCRIPTION: Choose among plain, three-dimensional, or Moody-compliant styles +:DESCRIPTION: Choose among several styles, with or without borders :CUSTOM_ID: h:27943af6-d950-42d0-bc23-106e43f50a24 :END: #+VINDEX: modus-themes-mode-line -Symbol: =modus-themes-mode-line= +Symbol: ~modus-themes-mode-line~ Possible values: 1. =nil= (default) -2. =3d= -3. =moody= -4. =borderless= -5. =borderless-3d= -6. =borderless-moody= +2. ~3d~ +3. ~moody~ +4. ~borderless~ +5. ~borderless-3d~ +6. ~borderless-moody~ The default produces a two-dimensional effect both for the active and inactive modelines. The differences between the two are limited to distinct shades of grayscale values, with the active being more intense than the inactive. -Option =3d= will make the active modeline look like a three-dimensional +Option ~3d~ will make the active modeline look like a three-dimensional rectangle. Inactive modelines remain 2D, though they are slightly toned down relative to the default. This aesthetic is virtually the same as -what you get when you run Emacs without any customizations (=emacs -Q= on -the command line). +what you get when you run Emacs without any customizations (=emacs -Q= +on the command line). -While =moody= removes all box effects from the modelines and applies +While ~moody~ removes all box effects from the modelines and applies underline and overline properties instead. It also tones down a bit the inactive modelines. This is meant to optimize things for use with the [[https://github.com/tarsius/moody][moody package]] (hereinafter referred to as "Moody"), though it can work fine even without it. -The =borderless= option uses the same colors as the default (nil value), +The ~borderless~ option uses the same colors as the default (nil value), but removes the border effect. This is done by making the box property use the same color as the background, effectively blending the two and creating some padding. -The =borderless-3d= and =borderless-moody= approximate the =3d= and =moody= -options respectively, while removing the borders. However, to ensure -that the inactive modelines remain visible, they apply a slightly more -prominent background to them than what their counterparts do (same +The ~borderless-3d~ and ~borderless-moody~ approximate the ~3d~ and +~moody~ options respectively, while removing the borders. However, to +ensure that the inactive modelines remain visible, they apply a slightly +more prominent background to them than what their counterparts do (same inactive background as with the default). Note that Moody does not expose any faces that the themes could style directly. Instead it re-purposes existing ones to render its tabs and ribbons. As such, there may be cases where the contrast ratio falls below the 7:1 target that the themes conform with (WCAG AAA). To hedge -against this, we configure a fallback foreground for the =moody= option, +against this, we configure a fallback foreground for the ~moody~ option, which will come into effect when the background of the modeline changes to something less accessible, such as Moody ribbons (read the doc string -of =set-face-attribute=, specifically =:distant-foreground=). This fallback -is activated when Emacs determines that the background and foreground of -the given construct are too close to each other in terms of color -distance. In effect, users would need to experiment with the variable -=face-near-same-color-threshold= to trigger the effect. We find that a -value of =45000= will suffice, contrary to the default =30000=. Do not set -the value too high, because that would have the adverse effect of always -overriding the default color (which has been carefully designed to be -highly accessible). +of ~set-face-attribute~, specifically ~:distant-foreground~). This +fallback is activated when Emacs determines that the background and +foreground of the given construct are too close to each other in terms +of color distance. In effect, users would need to experiment with the +variable ~face-near-same-color-threshold~ to trigger the effect. We +find that a value of =45000= will suffice, contrary to the default +=30000=. Do not set the value too high, because that would have the +adverse effect of always overriding the default color (which has been +carefully designed to be highly accessible). Furthermore, because Moody expects an underline and overline instead of a box style, it is advised you include this in your setup: @@ -626,13 +637,13 @@ a box style, it is advised you include this in your setup: :END: #+VINDEX: modus-themes-completions -Symbol: =modus-themes-completions= +Symbol: ~modus-themes-completions~ Possible values: 1. =nil= (default) -2. =moderate= -3. =opinionated= +2. ~moderate~ +3. ~opinionated~ This is a special option that has different effects depending on the completion UI. The interfaces can be grouped in two categories, based @@ -643,48 +654,49 @@ The former category encompasses Icomplete, Ido, Selectrum as well as pattern matching styles like Orderless and Flx. The latter covers Helm, Ivy, and similar. -A value of =nil= will respect the metaphors of each completion framework. +A value of =nil= will respect the metaphors of each completion +framework. -Option =moderate= applies a combination of background and foreground that -is fairly subtle. For Icomplete and friends this constitutes a +Option ~moderate~ applies a combination of background and foreground +that is fairly subtle. For Icomplete and friends this constitutes a departure from their default aesthetics, however the difference is small. While Helm, Ivy et al appear slightly different than their original looks, as they are toned down a bit. -Option =opinionated= uses color combinations that refashion the completion -UI. For the Icomplete camp this means that intense background and -foreground combinations are used: in effect their looks emulate those of -Helm, Ivy and co. in their original style. Whereas the other group of -packages will revert to an even more nuanced aesthetic with some -additional changes to the choice of hues. +Option ~opinionated~ uses color combinations that refashion the +completion UI. For the Icomplete camp this means that intense +background and foreground combinations are used: in effect their looks +emulate those of Helm, Ivy and co. in their original style. Whereas the +other group of packages will revert to an even more nuanced aesthetic +with some additional changes to the choice of hues. To appreciate the scope of this customization option, you should spend -some time with every one of the =nil= (default), =moderate=, and =opinionated= -possibilities. +some time with every one of the =nil= (default), ~moderate~, and +~opinionated~ possibilities. ** Option for fringe visibility :PROPERTIES: :ALT_TITLE: Fringes -:DESCRIPTION: Choose among invisible, subtle, or intense fringe visibility +:DESCRIPTION: Choose among invisible, subtle, or intense fringe styles :CUSTOM_ID: h:1983c3fc-74f6-44f3-b917-967c403bebae :END: #+VINDEX: modus-themes-fringes -Symbol: =modus-themes-fringes= +Symbol: ~modus-themes-fringes~ Possible values: 1. =nil= (default) -2. =subtle= -3. =intense= +2. ~subtle~ +3. ~intense~ The default is to use the same color as that of the main background, meaning that the fringes are not obvious though they still occupy the -space given to them by =fringe-mode=. +space given to them by ~fringe-mode~. -Options =subtle= and =intense= apply a gray background, making the fringes -visible. The difference between the two is one of degree, as their -names imply. +Options ~subtle~ and ~intense~ apply a gray background, making the +fringes visible. The difference between the two is one of degree, as +their names imply. ** Option for language checkers :PROPERTIES: @@ -694,45 +706,46 @@ names imply. :END: #+VINDEX: modus-themes-lang-checkers -Symbol: =modus-themes-lang-checkers= +Symbol: ~modus-themes-lang-checkers~ Possible values: 1. =nil= (default) -2. =subtle-foreground= -3. =intense-foreground= -4. =straight-underline= -5. =subtle-foreground-straight-underline= -6. =intense-foreground-straight-underline= -7. =colored-background= +2. ~subtle-foreground~ +3. ~intense-foreground~ +4. ~straight-underline~ +5. ~subtle-foreground-straight-underline~ +6. ~intense-foreground-straight-underline~ +7. ~colored-background~ Nil (the default) applies a color-coded underline to the affected text, while it leaves the original foreground in tact. If the display spec where Emacs runs in has support for it (e.g. Emacs GUI), the underline's style is that of a wave, otherwise it is a straight line. -Options =subtle-foreground= and =intense-foreground= follow the same +Options ~subtle-foreground~ and ~intense-foreground~ follow the same color-coding pattern and wavy underline of the default, while extending it with a corresponding foreground value for the affected text. The difference between the two options is one of degree, as their names suggest. -Option =straight-underline= is like the default but always applies a +Option ~straight-underline~ is like the default but always applies a straight line under the affected text. Same principle for -=subtle-foreground-straight-underline= and its counterpart -=intense-foreground-straight-underline=. +~subtle-foreground-straight-underline~ and its counterpart +~intense-foreground-straight-underline~. -Option =colored-background= uses a straight underline, a tinted +Option ~colored-background~ uses a straight underline, a tinted background, and a suitable foreground. All are color-coded. This is the most intense combination of face properties. The present variable affects packages and/or face groups such as those -of =flyspell=, =flymake=, =flycheck=, =artbollocks-mode=, =writegood-mode=. +of =flyspell=, =flymake=, =flycheck=, ~artbollocks-mode~, and +~writegood-mode~. NOTE: The placement of the straight underline, though not the wave -style, is controlled by the built-in =x-underline-at-descent-line=, -=x-use-underline-position-properties=, =underline-minimum-offset=. Please -refer to their documentation strings. +style, is controlled by the built-in ~x-underline-at-descent-line~, +~x-use-underline-position-properties~, ~underline-minimum-offset~. +Please refer to their documentation strings. ** Option for line highlighting (hl-line-mode) :PROPERTIES: @@ -742,20 +755,21 @@ refer to their documentation strings. :END: #+VINDEX: modus-themes-intense-hl-line -Symbol: =modus-themes-intense-hl-line= +Symbol: ~modus-themes-intense-hl-line~ Possible values: 1. =nil= (default) 2. =t= -The default is to use a subtle gray background for =hl-line-mode= and its -global equivalent. +The default is to use a subtle gray background for ~hl-line-mode~ and +its global equivalent. -With a non-nil value (=t=) use a more prominent background color instead. +With a non-nil value (=t=) use a more prominent background color +instead. -This affects several packages that enable =hl-line-mode=, such as =elfeed= -and =mu4e=. +This affects several packages that enable ~hl-line-mode~, such as +=elfeed= and =mu4e=. ** Option for line numbers (display-line-numbers-mode) :PROPERTIES: @@ -767,26 +781,26 @@ and =mu4e=. (coming in version =1.2.0=) -Symbol: =modus-themes-subtle-line-numbers= +Symbol: ~modus-themes-subtle-line-numbers~ Possible value: 1. =nil= (default) 2. =t= -The default style for =display-line-numbers-mode= and its global variant +The default style for ~display-line-numbers-mode~ and its global variant is to apply a subtle gray background to the line numbers. The current line has a more pronounced background and foreground combination to bring more attention to itself. -Similarly, the faces for =display-line-numbers-major-tick= and its -counterpart =display-line-numbers-minor-tick= use appropriate styles that -involve a bespoke background and foreground combination. +Similarly, the faces for ~display-line-numbers-major-tick~ and its +counterpart ~display-line-numbers-minor-tick~ use appropriate styles +that involve a bespoke background and foreground combination. -With a non-nil value (=t=), line numbers have no background of their own. -Instead they retain the primary background of the theme, blending with -the rest of the buffer. Foreground values for all relevant faces are -updated to accommodate this aesthetic. +With a non-nil value (=t=), line numbers have no background of their +own. Instead they retain the primary background of the theme, blending +with the rest of the buffer. Foreground values for all relevant faces +are updated to accommodate this aesthetic. ** Option for parenthesis matching (show-paren-mode) :PROPERTIES: @@ -796,28 +810,28 @@ updated to accommodate this aesthetic. :END: #+VINDEX: modus-themes-paren-match -Symbol: =modus-themes-paren-match= +Symbol: ~modus-themes-paren-match~ Possible values: 1. =nil= (default) -2. =subtle-bold= -3. =intense= -4. =intense-bold= +2. ~subtle-bold~ +3. ~intense~ +4. ~intense-bold~ Nil means to use a subtle tinted background color for the matching delimiters. -Option =intense= applies a saturated background color. +Option ~intense~ applies a saturated background color. -Option =subtle-bold= is the same as the default, but also makes use of -bold typographic weight (inherits the =bold= face). +Option ~subtle-bold~ is the same as the default, but also makes use of +bold typographic weight (inherits the ~bold~ face). -Option =intense-bold= is the same as =intense=, while it also uses a bold -weight. +Option ~intense-bold~ is the same as ~intense~, while it also uses a +bold weight. This customization variable affects tools such as the built-in -=show-paren-mode= and =smartparens=. +~show-paren-mode~ and the =smartparens= package. ** Option for active region :PROPERTIES: @@ -827,28 +841,28 @@ This customization variable affects tools such as the built-in :END: #+VINDEX: modus-themes-region -Symbol: =modus-themes-region= +Symbol: ~modus-themes-region~ Possible values: 1. =nil= (default) -2. =no-extend= -3. =bg-only= -4. =bg-only-no-extend= +2. ~no-extend~ +3. ~bg-only~ +4. ~bg-only-no-extend~ Nil means to only use a prominent gray background with a neutral foreground. The foreground overrides all syntax highlighting. The region extends to the edge of the window. -Option =no-extend= preserves the default aesthetic but prevents the +Option ~no-extend~ preserves the default aesthetic but prevents the region from extending to the edge of the window. -Option =bg-only= applies a faint tinted background that is distinct from +Option ~bg-only~ applies a faint tinted background that is distinct from all others used in the theme, while it does not override any existing colors. It extends to the edge of the window. -Option =bg-only-no-extend= is a combination of the =bg-only= and -=no-extend= options. +Option ~bg-only-no-extend~ is a combination of the ~bg-only~ and +~no-extend~ options. ** Option for diff buffer looks :PROPERTIES: @@ -858,45 +872,45 @@ Option =bg-only-no-extend= is a combination of the =bg-only= and :END: #+VINDEX: modus-themes-diffs -Symbol: =modus-themes-diffs= +Symbol: ~modus-themes-diffs~ Possible values: 1. =nil= (default) -2. =desaturated= -3. =fg-only= -4. =bg-only= +2. ~desaturated~ +3. ~fg-only~ +4. ~bg-only~ By default the themes apply rich coloration to the output of diffs, such -as those of =diff-mode=, =ediff=, =smerge-mode=, and =magit=. These are color -combinations of an accented background and foreground so that, for +as those of ~diff-mode~, ~ediff~, ~smerge-mode~, and Magit. These are +color combinations of an accented background and foreground so that, for example, added lines have a pronounced green background with an appropriate shade of green for the affected text. Word-wise or "refined" changes follow this pattern but use different shades of those colors to remain distinct. -Option =desaturated= tones down all relevant color values. It still +Option ~desaturated~ tones down all relevant color values. It still combines an accented background with an appropriate foreground, yet its overall impression is fairly subtle. Refined changes are a bit more intense to fulfil their intended function, though still less saturated than default. -Option =fg-only= will remove most accented backgrounds and instead rely on -color-coded text to denote changes. For instance, added lines use a +Option ~fg-only~ will remove most accented backgrounds and instead rely +on color-coded text to denote changes. For instance, added lines use a green foreground, while their background is the same as the rest of the buffer. Word-wise highlights still use a background value which is, nonetheless, more subtle than its default equivalent. -Option =bg-only= applies color-coded backgrounds but does not override any -syntax highlighting that may be present. This makes it suitable for use -with a non-nil value for =diff-font-lock-syntax= (which is the default for -=diff-mode= buffers in Emacs 27 or higher). +Option ~bg-only~ applies color-coded backgrounds but does not override +any syntax highlighting that may be present. This makes it suitable for +use with a non-nil value for ~diff-font-lock-syntax~ (which is the +default for ~diff-mode~ buffers in Emacs 27 or higher). Concerning Magit, an extra set of tweaks are introduced for the effect of highlighting the current diff hunk, so as to remain aligned with the overall experience of that mode. Expect changes that are consistent with the overall intent of the aforementioned. Note, however, that the -=bg-only= option will not deliver the intended results in Magit diffs +~bg-only~ option will not deliver the intended results in Magit diffs because no syntax highlighting is used there (last checked with Magit version 20201116.1057, though upstream has a plan to eventually support such a feature---this entry shall be updated accordingly). @@ -909,33 +923,34 @@ such a feature---this entry shall be updated accordingly). :END: #+VINDEX: modus-themes-org-blocks -Symbol: =modus-themes-org-blocks= +Symbol: ~modus-themes-org-blocks~ Possible values: 1. =nil= (default) -2. =grayscale= -3. =rainbow= +2. ~grayscale~ +3. ~rainbow~ The default is to use the same background as the rest of the buffer for the contents of the block. -Option =grayscale= applies a subtle neutral gray background to the block's -contents. It will also extend to the edge of the window the background -of the "begin" and "end" block delimiter lines (only relevant for Emacs -versions >= 27 where the 'extend' keyword is part of the face +Option ~grayscale~ applies a subtle neutral gray background to the +block's contents. It will also extend to the edge of the window the +background of the "begin" and "end" block delimiter lines (only relevant +for Emacs versions >= 27 where the 'extend' keyword is part of the face specifications). -Option =rainbow= uses an accented background for the contents of the +Option ~rainbow~ uses an accented background for the contents of the block. The exact color will depend on the programming language and is -controlled by the =org-src-block-faces= variable. This is most suitable +controlled by the ~org-src-block-faces~ variable. This is most suitable for users who work on literate programming documents that mix and match several languages. Note that the "rainbow" blocks may require you to also reload the -major-mode so that the colors are applied properly: use =M-x org-mode= or -=M-x org-mode-restart= to refresh the buffer. Or start typing in each -code block (inefficient at scale, but it still works). +major-mode so that the colors are applied consistently throughout: use +{{{kbd(M-x org-mode)}}} or {{{kbd(M-x org-mode-restart)}}} to refresh +the buffer. Or start typing in each code block (inefficient at scale, +but it still works). ** Option for org-habit graph styles :PROPERTIES: @@ -945,13 +960,13 @@ code block (inefficient at scale, but it still works). :END: #+VINDEX: modus-themes-org-habit -Symbol: =modus-themes-org-habit= +Symbol: ~modus-themes-org-habit~ Possible values: 1. =nil= (default) -2. =simplified= -3. =traffic-light= +2. ~simplified~ +3. ~traffic-light~ The default is meant to conform with the original aesthetic of =org-habit=. It employs all four color codes that correspond to the @@ -961,7 +976,7 @@ in a total of eight colors in use: red, yellow, green, blue, in tinted and shaded versions. They cover the full set of information provided by the =org-habit= consistency graph. -Option =simplified= is like the default except that it removes the +Option ~simplified~ is like the default except that it removes the dichotomy between current and future variants by applying uniform color-coded values. It applies a total of four colors: red, yellow, green, blue. They produce a simplified consistency graph that is more @@ -969,12 +984,12 @@ legible (or less "busy") than the default. The intent is to shift focus towards the distinction between the four states of a habit task, rather than each state's present/future outlook. -Option =traffic-light= further reduces the available colors to red, -yellow, and green. As in =simplified=, present and future variants appear -uniformly, but differently from it, the 'clear' state is rendered in a -green hue, instead of the original blue. This is meant to capture the -use-case where a habit task being "too early" is less important than it -being "too late". The difference between ready and clear states is +Option ~traffic-light~ further reduces the available colors to red, +yellow, and green. As in ~simplified~, present and future variants +appear uniformly, but differently from it, the 'clear' state is rendered +in a green hue, instead of the original blue. This is meant to capture +the use-case where a habit task being "too early" is less important than +it being "too late". The difference between ready and clear states is attenuated by painting both of them using shades of green. This option thus highlights the alert and overdue states. @@ -989,29 +1004,29 @@ thus highlights the alert and overdue states. This is defined as an alist and, therefore, uses a different approach than other customization options documented in this manual. -Symbol: =modus-themes-headings= +Symbol: ~modus-themes-headings~ Possible values, which can be specified for each heading level (examples further below): + nil (default fallback option---covers all heading levels) + =t= (default style for a single heading, when the fallback differs) -+ =no-bold= -+ =line= -+ =line-no-bold= -+ =rainbow= -+ =rainbow-line= -+ =rainbow-line-no-bold= -+ =highlight= -+ =highlight-no-bold= -+ =rainbow-highlight= -+ =rainbow-highlight-no-bold= -+ =section= -+ =section-no-bold= -+ =rainbow-section= -+ =rainbow-section-no-bold= -+ =no-color= -+ =no-color-no-bold= ++ ~no-bold~ ++ ~line~ ++ ~line-no-bold~ ++ ~rainbow~ ++ ~rainbow-line~ ++ ~rainbow-line-no-bold~ ++ ~highlight~ ++ ~highlight-no-bold~ ++ ~rainbow-highlight~ ++ ~rainbow-highlight-no-bold~ ++ ~section~ ++ ~section-no-bold~ ++ ~rainbow-section~ ++ ~rainbow-section-no-bold~ ++ ~no-color~ ++ ~no-color-no-bold~ To control faces per level from 1-8, use something like this: @@ -1023,9 +1038,9 @@ To control faces per level from 1-8, use something like this: (t . rainbow-line-no-bold))) #+end_src -The above uses the =section= value for heading levels 1, =section-no-bold= -for headings 2, =rainbow-line= for 3. All other levels fall back to -=rainbow-line-no-bold=. +The above uses the ~section~ value for heading levels 1, +~section-no-bold~ for headings 2, ~rainbow-line~ for 3. All other +levels fall back to ~rainbow-line-no-bold~. To set a uniform value for all heading levels, use this pattern: @@ -1053,51 +1068,51 @@ option, just specify the value =t= like this: A description of all other possible styles beyond the default: -+ =no-bold= retains the default text color while removing the bold ++ ~no-bold~ retains the default text color while removing the bold typographic weight. -+ =line= is the same as the default plus an overline across the heading's - length. ++ ~line~ is the same as the default plus an overline across the + heading's length. -+ =line-no-bold= is the same as =line= without bold weight. ++ ~line-no-bold~ is the same as ~line~ without bold weight. -+ =rainbow= uses a more colorful foreground in combination with bold ++ ~rainbow~ uses a more colorful foreground in combination with bold typographic weight. -+ =rainbow-line= is the same as =rainbow= plus an overline. ++ ~rainbow-line~ is the same as ~rainbow~ plus an overline. -+ =rainbow-line-no-bold= is the same as =rainbow-line= without the bold ++ ~rainbow-line-no-bold~ is the same as ~rainbow-line~ without the bold weight. -+ =highlight= retains the default style of a fairly desaturated foreground - combined with a bold weight and adds to it a subtle accented - background. ++ ~highlight~ retains the default style of a fairly desaturated + foreground combined with a bold weight and adds to it a subtle + accented background. -+ =highlight-no-bold= is the same as =highlight= without a bold weight. ++ ~highlight-no-bold~ is the same as ~highlight~ without a bold weight. -+ =rainbow-highlight= is the same as =highlight= but with a more colorful ++ ~rainbow-highlight~ is the same as ~highlight~ but with a more + colorful foreground. + ++ ~rainbow-highlight-no-bold~ is the same as ~rainbow-highlight~ without + a bold weight. + ++ ~section~ retains the default looks and adds to them both an overline + and a slightly accented background. It is, in effect, a combination + of the ~line~ and ~highlight~ values. + ++ ~section-no-bold~ is the same as ~section~ without a bold weight. + ++ ~rainbow-section~ is the same as ~section~ but with a more colorful foreground. -+ =rainbow-highlight-no-bold= is the same as =rainbow-highlight= without a ++ ~rainbow-section-no-bold~ is the same as ~rainbow-section~ without a bold weight. -+ =section= retains the default looks and adds to them both an overline - and a slightly accented background. It is, in effect, a combination - of the =line= and =highlight= values. ++ ~no-color~ does not apply any color to the heading, meaning that it + uses the foreground of the ~default~ face. It still renders the text + with a bold typographic weight. -+ =section-no-bold= is the same as =section= without a bold weight. - -+ =rainbow-section= is the same as =section= but with a more colorful - foreground. - -+ =rainbow-section-no-bold= is the same as =rainbow-section= without a bold - weight. - -+ =no-color= does not apply any color to the heading, meaning that it uses - the foreground of the =default= face. It still renders the text with a - bold typographic weight. - -+ =no-color-no-bold= is like =no-color= but without the bold weight. ++ ~no-color-no-bold~ is like ~no-color~ but without the bold weight. ** Option for scaled headings :PROPERTIES: @@ -1107,7 +1122,7 @@ A description of all other possible styles beyond the default: :END: #+VINDEX: modus-themes-scale-headings -Symbol: =modus-themes-scale-headings= +Symbol: ~modus-themes-scale-headings~ Possible values: @@ -1116,8 +1131,9 @@ Possible values: The default is to use the same size for headings and paragraph text. -With a non-nil value (=t=) make headings larger in height relative to the -main text. This is noticeable in modes like Org, Markdown, and Info. +With a non-nil value (=t=) make headings larger in height relative to +the main text. This is noticeable in modes like Org, Markdown, and +Info. *** Control the scale of headings :PROPERTIES: @@ -1132,21 +1148,21 @@ specify a number of their own. + If it is a floating point, say, =1.5=, it is interpreted as a multiple of the base font size. This is the recommended method, because it will always adapt to changes in the base font size, such as while - using the =text-scale-adjust= command. + using the ~text-scale-adjust~ command. + If it is an integer, it is read as an absolute font height that is 1/10 of the typographic point size. Thus a value of =18pt= must be expressed as =180=. Setting an absolute value is discouraged, as it will break the layout in cases where the base font size must change, - such as with the =text-scale-adjust= command ([[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations]]). + such as with the ~text-scale-adjust~ command ([[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations]]). While we discourage using absolute values, we still provide for this option for users who do not need to perform text-scaling operations or who are content with whatever discrepancies in height. Below are the variables in their default values, using the floating point paradigm. The numbers are very conservative, but one is free to -change them to their liking, such as =1.2=, =1.4=, =1.6=, =1.8=, =2.0=---or use a -resource for finding a consistent scale: +change them to their liking, such as =1.2=, =1.4=, =1.6=, =1.8=, +=2.0=---or use a resource for finding a consistent scale: #+begin_src emacs-lisp (setq modus-themes-scale-1 1.05 @@ -1157,25 +1173,25 @@ resource for finding a consistent scale: #+end_src As for the application of that scale, the variables that range from -=modus-themes-scale-1= up to =modus-themes-scale-4= apply to regular +~modus-themes-scale-1~ up to ~modus-themes-scale-4~ apply to regular headings within the context of the given major mode. The former is the smallest, while the latter is the largest. "Regular headings" are those that have a standard syntax for their scale, such as Org mode's eight levels of asterisks or Markdown's six columns. -Whereas =modus-themes-scale-5= is applied to special headings that do not -conform with the aforementioned syntax, yet which are expected to be +Whereas ~modus-themes-scale-5~ is applied to special headings that do +not conform with the aforementioned syntax, yet which are expected to be larger than the largest value on that implied scale. Put concretely, -Org's =#+title= meta datum is not part of the eight levels of headings in -an Org file, yet is supposed to signify the primary header. Similarly, -the Org Agenda's structure headings are not part of a recognisable scale -and so they also get =modus-themes-scale-5=. +Org's =#+title= meta datum is not part of the eight levels of headings +in an Org file, yet is supposed to signify the primary header. +Similarly, the Org Agenda's structure headings are not part of a +recognisable scale and so they also get ~modus-themes-scale-5~. Users who wish to maintain scaled headings for the normal syntax while -preventing special headings from standing out, can assign a value of =1.0= -to =modus-themes-scale-5= to make it the same as body text (or whatever -value would render it indistinguishable from the desired point of -reference). +preventing special headings from standing out, can assign a value of +=1.0= to ~modus-themes-scale-5~ to make it the same as body text (or +whatever value would render it indistinguishable from the desired point +of reference). Note that in earlier versions of Org, scaling would only increase the size of the heading, but not of keywords that were added to it, like @@ -1190,7 +1206,7 @@ size of the heading, but not of keywords that were added to it, like :END: #+VINDEX: modus-themes-variable-pitch-ui -Symbol: =modus-themes-variable-pitch-ui= +Symbol: ~modus-themes-variable-pitch-ui~ Possible values: @@ -1204,8 +1220,9 @@ and tab line. The default is to use the same font as the rest of Emacs, which usually is a monospaced family. -With a non-nil value (=t=) apply a proportionately spaced typeface. This -is done by assigning the =variable-pitch= face to the relevant items. +With a non-nil value (=t=) apply a proportionately spaced typeface. +This is done by assigning the ~variable-pitch~ face to the relevant +items. [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. @@ -1217,14 +1234,15 @@ is done by assigning the =variable-pitch= face to the relevant items. :END: #+VINDEX: modus-themes-variable-pitch-headings -Symbol: =modus-themes-variable-pitch-headings= +Symbol: ~modus-themes-variable-pitch-headings~ Possible values: 1. =nil= (default) 2. =t= -The default is to use the main font family, which typically is monospaced. +The default is to use the main font family, which typically is +monospaced. With a non-nil value (=t=) apply a proportionately spaced typeface, else "variable-pitch", to headings (such as in Org mode). @@ -1275,11 +1293,11 @@ other). (my-demo-modus-operandi))) #+end_src -Then assign =my-demo-modus-themes-toggle= to a key instead of the +Then assign ~my-demo-modus-themes-toggle~ to a key instead of the equivalent the themes provide. For a more elaborate design, it is better to inspect the source code of -=modus-themes-toggle= and relevant functions. +~modus-themes-toggle~ and relevant functions. ** Case-by-case face specs using the themes' palette (DIY) :PROPERTIES: @@ -1297,12 +1315,12 @@ and how to configure options prior to loading. We also explained that some of the functions made available to users will fire up a hook that can be used to pass tweaks in the post-theme-load phase. -Now assume you wish to change a single face, say, the =cursor=. And you +Now assume you wish to change a single face, say, the ~cursor~. And you would like to get the standard "blue" color value of the active Modus theme, whether it is Modus Operandi or Modus Vivendi. To do that, you -can use the =modus-themes-color= function. It accepts a symbol that is -associated with a color in =modus-themes-operandi-colors= and -=modus-themes-vivendi-colors=. Like this: +can use the ~modus-themes-color~ function. It accepts a symbol that is +associated with a color in ~modus-themes-operandi-colors~ and +~modus-themes-vivendi-colors~. Like this: #+begin_src emacs-lisp (modus-themes-color 'blue) @@ -1320,27 +1338,27 @@ The function always extracts the color value of the active Modus theme. (modus-themes-color 'blue)) ; "#2fafff" for `modus-vivendi' #+end_src -Do =C-h v= on the aforementioned variables to check all the available -symbols that can be passed to this function. +Do {{{kbd(C-h v)}}} on the aforementioned variables to check all the +available symbols that can be passed to this function. With that granted, let us expand the example to actually change the -=cursor= face's background property. We employ the built-in function of -=set-face-attribute=: +~cursor~ face's background property. We employ the built-in function of +~set-face-attribute~: #+begin_src emacs-lisp (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) #+end_src If you evaluate this form, your cursor will become blue. But if you -change themes, such as with =modus-themes-toggle=, your edits will be +change themes, such as with ~modus-themes-toggle~, your edits will be lost, because the newly loaded theme will override the =:background= attribute you had assigned to that face. For such changes to persist, we need to make them after loading the -theme. So we rely on =modus-themes-after-load-theme-hook=, which gets -called from =modus-themes-load-operandi=, =modus-themes-load-vivendi=, as -well as the command =modus-themes-toggle=. Here is a sample function that -tweaks two faces and then gets added to the hook: +theme. So we rely on ~modus-themes-after-load-theme-hook~, which gets +called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, +as well as the command ~modus-themes-toggle~. Here is a sample function +that tweaks two faces and then gets added to the hook: #+begin_src emacs-lisp (defun my-modus-themes-custom-faces () @@ -1356,7 +1374,7 @@ without having to find color values for each case. Another application is to control the precise weight for bold constructs. This is particularly useful if your typeface has several variants such as "heavy", "extrabold", "semibold". All you have to do -is edit the =bold= face. For example: +is edit the ~bold~ face. For example: #+begin_src emacs-lisp (set-face-attribute 'bold nil :weight 'semibold) @@ -1370,13 +1388,13 @@ throughout the interface. Finally, there are cases where you want to tweak colors though wish to apply different ones to each theme, say, a blue hue for Modus Operandi and a shade of red for Modus Vivendi. To this end, we provide -=modus-themes-color-alts= as a convenience function to save you from the +~modus-themes-color-alts~ as a convenience function to save you from the trouble of writing separate wrappers for each theme. It still returns a -single value by querying either of =modus-themes-operandi-colors= and -=modus-themes-vivendi-colors=, only here you pass the two keys you want, -first for =modus-operandi= then =modus-vivendi=. +single value by querying either of ~modus-themes-operandi-colors~ and +~modus-themes-vivendi-colors~, only here you pass the two keys you want, +first for ~modus-operandi~ then ~modus-vivendi~. -Take the previous example with the =cursor= face: +Take the previous example with the ~cursor~ face: #+begin_src emacs-lisp ;; Blue for `modus-operandi' and red for `modus-vivendi' @@ -1394,14 +1412,14 @@ The examples here are for large scale operations. For simple, one-off tweaks, you may prefer the approach documented in the previous section ([[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]). -The =modus-themes-with-colors= macro lets you retrieve multiple color +The ~modus-themes-with-colors~ macro lets you retrieve multiple color values by employing the backquote/backtick and comma notation. The -values are stored in the alists =modus-themes-operandi-colors= and -=modus-themes-vivendi-colors=, while the macro always queries that of the -active Modus theme. +values are stored in the alists ~modus-themes-operandi-colors~ and +~modus-themes-vivendi-colors~, while the macro always queries that of +the active Modus theme. Here is an abstract example that just returns a list of color values -while =modus-operandi= is enabled: +while ~modus-operandi~ is enabled: #+begin_src emacs-lisp (modus-themes-with-colors @@ -1431,9 +1449,9 @@ while =modus-operandi= is enabled: Getting a list of colors may have its applications, though what you are most likely interested in is how to use those variables to configure several faces at once. To do so we can rely on the built-in -=custom-set-faces= function, which sets face specifications for the -special =user= theme. That "theme" gets applied on top of regular themes -like =modus-operandi= and =modus-vivendi=. +~custom-set-faces~ function, which sets face specifications for the +special =user= theme. That "theme" gets applied on top of regular +themes like ~modus-operandi~ and ~modus-vivendi~. This is how it works: @@ -1457,17 +1475,17 @@ value so that you can appreciate how a theme can be written. Otherwise you can identify the color variables by the comma prefixed to them. The above snippet will immediately refashion the faces it names once it -is evaluated. However, if you switch themes, say, from =modus-operandi= -to =modus-vivendi=, the colors will not get updated to match those of the -new theme. To make things work across themes, we need to employ the +is evaluated. However, if you switch themes, say, from ~modus-operandi~ +to ~modus-vivendi~, the colors will not get updated to match those of +the new theme. To make things work across themes, we need to employ the same technique we discussed in the previous section, namely, to pass our changes at the post-theme-load phase via a hook. -The themes provide the =modus-themes-after-load-theme-hook=, which gets -called from =modus-themes-load-operandi=, =modus-themes-load-vivendi=, as -well as the command =modus-themes-toggle=. With this knowledge, you can -wrap the macro in a function and then assign that function to the hook. -Thus: +The themes provide the ~modus-themes-after-load-theme-hook~, which gets +called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, +as well as the command ~modus-themes-toggle~. With this knowledge, you +can wrap the macro in a function and then assign that function to the +hook. Thus: #+begin_src emacs-lisp (defun my-modus-themes-custom-faces () @@ -1488,10 +1506,11 @@ Thus: #+end_src To discover the faces defined by all loaded libraries, you may invoke -=M-x list-faces-display=. Be warned that when you =:inherit= a face you are -introducing an implicit dependency, so try to avoid doing so for -libraries other than the built-in =faces.el= (or at least understand that -things may break if you inherit from a yet-to-be-loaded face). +{{{kbd(M-x list-faces-display)}}}. Be warned that when you =:inherit= a +face you are introducing an implicit dependency, so try to avoid doing +so for libraries other than the built-in {{{file(faces.el)}}} (or at +least understand that things may break if you inherit from a +yet-to-be-loaded face). Also bear in mind that these examples are meant to work with the Modus themes. If you are cycling between multiple themes you may encounter @@ -1499,7 +1518,7 @@ unforeseen issues, such as the colors of the Modus themes being applied to a non-Modus item. Finally, note that you can still use other functions where those make -sense. For example, the =modus-themes-color-alts= that was discussed in +sense. For example, the ~modus-themes-color-alts~ that was discussed in the previous section. Adapt the above example like this: #+begin_src emacs-lisp @@ -1542,11 +1561,12 @@ A complete example with some more opinionated stylistic choices: #+CINDEX: Change a theme's colors The themes provide a mechanism for overriding their color values. This -is controlled by the variables =modus-themes-operandi-color-overrides= and -=modus-themes-vivendi-color-overrides=, which are alists that should -mirror a subset of the associations in =modus-=themes-operandi-colors= and -=modus-themes-vivendi-colors= respectively. As with all customisations, -overriding must be done before loading the affected theme. +is controlled by the variables ~modus-themes-operandi-color-overrides~ +and ~modus-themes-vivendi-color-overrides~, which are alists that should +mirror a subset of the associations in ~modus-themes-operandi-colors~ +and ~modus-themes-vivendi-colors~ respectively. As with all +customisations, overriding must be done before loading the affected +theme. Let us approach the present topic one step at a time. Here is a simplified excerpt of the default palette for Modus Operandi with some @@ -1577,7 +1597,7 @@ like this, which adds a subtle ochre tint: (bg-inactive . "#f6ece5"))) #+end_src -Once this is evaluated, any subsequent loading of =modus-operandi= will +Once this is evaluated, any subsequent loading of ~modus-operandi~ will use those values instead of the defaults. No further intervention is required. @@ -1627,19 +1647,19 @@ themes and expands to some more assosiations: modus-themes-vivendi-color-overrides nil))) #+end_src -With this in place, one can invoke =M-x my-modus-themes-tinted= and then -load the Modus theme of their choice. The new colors will come into -effect. Switching between the themes will also use the overrides. +With this in place, one can invoke {{{kbd(M-x my-modus-themes-tinted)}}} +and then load the Modus theme of their choice. The new colors will come +into effect. Switching between the themes will also use the overrides. Given that this is a user-level customisation, one is free to implement whatever color values they desire, even if the possible combinations fall below the minimum 7:1 contrast ratio that governs the design of the themes (the WCAG AAA legibility standard). Preferences aside, it is -advised to inspect the source code of =modus-themes-operandi-colors= and -=modus-themes-vivendi-colors= to read the inline commentary: it explains +advised to inspect the source code of ~modus-themes-operandi-colors~ and +~modus-themes-vivendi-colors~ to read the inline commentary: it explains what the intended use of each subset is. -Furthermore, users may benefit from the =modus-themes-contrast= function +Furthermore, users may benefit from the ~modus-themes-contrast~ function that we provide: [[#h:02e25930-e71a-493d-828a-8907fc80f874][test color combinations]]. It measures the contrast ratio between two color values, so it can help in overriding the palette (or a subset thereof) without making the end result inaccessible. @@ -1654,24 +1674,24 @@ The themes are designed to cope well with mixed font configurations. [[#h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b][Option for no font mixing]]. -This mostly concerns =org-mode= and =markdown-mode=, though expect to find -it elsewhere like in =Info-mode=. +This mostly concerns ~org-mode~ and ~markdown-mode~, though expect to +find it elsewhere like in ~Info-mode~. In practice it means that the user can safely opt for a more prose-friendly proportionately spaced typeface as their default, while letting spacing-sensitive elements like tables and inline code always -use a monospaced font, by inheriting from the =fixed-pitch= face. +use a monospaced font, by inheriting from the ~fixed-pitch~ face. -Users can try the built-in =M-x variable-pitch-mode= to see the effect in -action. +Users can try the built-in {{{kbd(M-x variable-pitch-mode)}}} to see the +effect in action. To make everything use your desired font families, you need to configure -the =variable-pitch= (proportional spacing) and =fixed-pitch= (monospaced) -faces respectively. It may also be convenient to set your main typeface -by configuring the =default= face the same way. +the ~variable-pitch~ (proportional spacing) and ~fixed-pitch~ +(monospaced) faces respectively. It may also be convenient to set your +main typeface by configuring the ~default~ face the same way. Put something like this in your initialization file (also consider -reading the doc string of =set-face-attribute=): +reading the doc string of ~set-face-attribute~): #+begin_src emacs-lisp ;; Main typeface @@ -1686,15 +1706,16 @@ reading the doc string of =set-face-attribute=): Note the differences in the =:height= property. The =default= face must specify an absolute value, which is the point size × 10. So if you want -to use a font at point size =11=, you set the height to =110=.[fn:: =:height= -values do not need to be rounded to multiples of ten: the likes of =115= -are perfectly valid—some typefaces will change to account for those -finer increments.] Whereas every other face must have a value that is -relative to the default, represented as a floating point (if you use an -integer, then that means an absolute height). This is of paramount -importance: it ensures that all fonts can scale gracefully when using -something like the =text-scale-adjust= command which only operates on the -base font size (i.e. the =default= face's absolute height). +to use a font at point size =11=, you set the height to =110=.[fn:: +=:height= values do not need to be rounded to multiples of ten: the +likes of =115= are perfectly valid—some typefaces will change to account +for those finer increments.] Whereas every other face must have a value +that is relative to the default, represented as a floating point (if you +use an integer, then that means an absolute height). This is of +paramount importance: it ensures that all fonts can scale gracefully +when using something like the ~text-scale-adjust~ command which only +operates on the base font size (i.e. the ~default~ face's absolute +height). ** Custom Org user faces (DIY) :PROPERTIES: @@ -1702,9 +1723,9 @@ base font size (i.e. the =default= face's absolute height). :END: #+CINDEX: Org extra faces -Users of =org-mode= have the option to configure various keywords and +Users of ~org-mode~ have the option to configure various keywords and priority cookies to better match their workflow. User options are -=org-todo-keyword-faces= and =org-priority-faces=. +~org-todo-keyword-faces~ and ~org-priority-faces~. As those are meant to be custom faces, it is futile to have the themes guess what each user wants to use, which keywords to target, and so on. @@ -1713,8 +1734,9 @@ liking with the intent of retaining the overall aesthetic of the themes. Please bear in mind that the end result of those is not controlled by the active Modus theme but by how Org maps faces to its constructs. -Editing those while =org-mode= is active requires =M-x org-mode-restart= for -changes to take effect. +Editing those while ~org-mode~ is active requires re-initialization of +the mode with {{{kbd(M-x org-mode-restart)}}} for changes to take +effect. Let us assume you wish to visually differentiate your keywords. You have something like this: @@ -1729,7 +1751,7 @@ have something like this: You could then use a variant of the following to inherit from a face that uses the styles you want and also to preserve the properties -applied by the =org-todo= face: +applied by the ~org-todo~ face: #+begin_src emacs-lisp (setq org-todo-keyword-faces @@ -1739,10 +1761,10 @@ applied by the =org-todo= face: #+end_src This will refashion the keywords you specify, while letting the other -items in =org-todo-keywords= use their original styles (which are defined -in the =org-todo= and =org-done= faces). +items in ~org-todo-keywords~ use their original styles (which are +defined in the ~org-todo~ and ~org-done~ faces). -If you want back the defaults, try specifying just the =org-todo= face: +If you want back the defaults, try specifying just the ~org-todo~ face: #+begin_src emacs-lisp (setq org-todo-keyword-faces @@ -1767,9 +1789,10 @@ configuration of the priority cookies: #+end_src To find all the faces that are loaded in your current Emacs session, use -=M-x list-faces-display=. Also try =M-x describe-variable= and then specify -the name of each of those Org variables demonstrated above. Their -documentation strings will offer you further guidance. +{{{kbd(M-x list-faces-display)}}}. Try {{{kbd(M-x describe-variable)}}} +as well and then specify the name of each of those Org variables +demonstrated above. Their documentation strings will offer you further +guidance. Recall that the themes let you retrieve a color from their palette. Do it if you plan to control face attributes. @@ -1783,17 +1806,18 @@ it if you plan to control face attributes. :CUSTOM_ID: h:02e25930-e71a-493d-828a-8907fc80f874 :END: #+FINDEX: modus-themes-contrast +#+FINDEX: modus-themes-wcag-formula #+CINDEX: Color contrast -The themes provide the functions =modus-themes-wcag-formula= and -=modus-themes-contrast=. The former is a direct implementation of the +The themes provide the functions ~modus-themes-wcag-formula~ and +~modus-themes-contrast~. The former is a direct implementation of the WCAG formula: . It calculates the relative luminance of a color value that is expressed in hexadecimal RGB notation. While the latter function is just a convenient wrapper for comparing the relative luminance between two colors. -In practice, one needs to work only with =modus-themes-contrast=. It +In practice, one needs to work only with ~modus-themes-contrast~. It accepts two color values and returns their contrast ratio. Values range from 1 to 21 (lowest to highest). The themes are designed to always be equal or higher than 7 for each combination of background and foreground @@ -1826,11 +1850,11 @@ try something like this: While it is fine to perform such calculations on a case-by-case basis, it is preferable to implement formulas and tables for more demanding -tasks. Such instruments are provided by =org-mode= or =orgtbl-mode=, both -of which are built into Emacs. Below is such a table that derives the -contrast ratio of all colors in the first column (pure red, green, blue) -relative to the color specified in the first row of the second column -(pure white) and rounds the results: +tasks. Such instruments are provided by ~org-mode~ or ~orgtbl-mode~, +both of which are built into Emacs. Below is such a table that derives +the contrast ratio of all colors in the first column (pure red, green, +blue) relative to the color specified in the first row of the second +column (pure white) and rounds the results: #+begin_example | | #ffffff | @@ -1855,12 +1879,13 @@ the themes' colors: [[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]] :CUSTOM_ID: h:1d1ef4b4-8600-4a09-993c-6de3af0ddd26 :END: -While we do provide =modus-themes-toggle= to manually switch between the +While we do provide ~modus-themes-toggle~ to manually switch between the themes, users may also set up their system to perform such a task automatically at sunrise and sunset. This can be accomplished by specifying the coordinates of one's location -using the built-in =solar.el= and then configuring the =circadian= library: +using the built-in {{{file(solar.el)}}} and then configuring the +=circadian= package: #+begin_src emacs-lisp (use-package solar ; built-in @@ -1886,9 +1911,9 @@ varying skill levels, from beginners to experts. This means that we try to make things easier by not expecting anyone reading this document to be proficient in Emacs Lisp or programming in general. -One such case is with the use of the =modus-themes-after-load-theme-hook=, -which runs every time =modus-themes-toggle,= =modus-themes-load-operandi=, -or =modus-themes-load-vivendi= is evaluated. We recommend using that hook +Such a case is with the use of the ~modus-themes-after-load-theme-hook~, +which runs after ~modus-themes-toggle~, ~modus-themes-load-operandi~, or +~modus-themes-load-vivendi~ is evaluated. We recommend using that hook for advanced customizations, because (1) we know for sure that it is available once the themes are loaded, and (2) anyone consulting this manual, especially the sections on enabling and loading the themes, will @@ -1910,11 +1935,11 @@ A theme-agnostic setup can be configured thus: (run-hooks 'after-enable-theme-hook)) #+end_src -This creates the =after-enable-theme-hook= and makes it run after each -call to =enable-theme=, which means that it will work for all themes and +This creates the ~after-enable-theme-hook~ and makes it run after each +call to ~enable-theme~, which means that it will work for all themes and also has the benefit that it does not depend on functions such as -=modus-themes-toggle= and the others mentioned above. =enable-theme= is -called internally by =load-theme=, so the hook works everywhere. +~modus-themes-toggle~ and the others mentioned above. ~enable-theme~ is +called internally by ~load-theme~, so the hook works everywhere. Now this specific piece of Elisp may be simple for experienced users, but it is not easy to read for newcomers, including the author of the @@ -1963,13 +1988,13 @@ have lots of extensions, so the "full support" may not be 100% true… + bm + bongo + boon -+ breakpoint (provided by the built-in =gdb-mi.el= library) ++ breakpoint (provided by the built-in {{{file(gdb-mi.el)}}} library) + buffer-expose + calendar and diary + calfw + centaur-tabs + cfrs -+ change-log and log-view (such as =vc-print-log= and =vc-print-root-log=) ++ change-log and log-view (such as ~vc-print-log~, ~vc-print-root-log~) + cider + circe + color-rg @@ -1987,7 +2012,7 @@ have lots of extensions, so the "full support" may not be 100% true… + cperl-mode + csv-mode + ctrlf -+ custom (=M-x customize=) ++ custom (what you get with {{{kbd(M-x customize)}}}) + dap-mode + dashboard (emacs-dashboard) + deadgrep @@ -2072,7 +2097,7 @@ have lots of extensions, so the "full support" may not be 100% true… + helpful + highlight-blocks + highlight-defined -+ highlight-escape-sequences (=hes-mode=) ++ highlight-escape-sequences (~hes-mode~) + highlight-indentation + highlight-numbers + highlight-symbol @@ -2107,7 +2132,7 @@ have lots of extensions, so the "full support" may not be 100% true… + jupyter + kaocha-runner + keycast -+ line numbers (=display-line-numbers-mode= and global variant) ++ line numbers (~display-line-numbers-mode~ and global variant) + lsp-mode + lsp-ui + macrostep @@ -2117,7 +2142,7 @@ have lots of extensions, so the "full support" may not be 100% true… + man + marginalia + markdown-mode -+ markup-faces (=adoc-mode=) ++ markup-faces (~adoc-mode~) + mentor + messages + minibuffer-line @@ -2149,7 +2174,7 @@ have lots of extensions, so the "full support" may not be 100% true… + origami + outline-mode + outline-minor-faces -+ package (=M-x list-packages=) ++ package (what you get with {{{kbd(M-x list-packages)}}}) + page-break-lines + paradox + paren-face @@ -2175,7 +2200,7 @@ have lots of extensions, so the "full support" may not be 100% true… + rainbow-delimiters + rcirc + recursion-indicator -+ regexp-builder (also known as =re-builder=) ++ regexp-builder (also known as ~re-builder~) + rg (rg.el) + ripgrep + rmail @@ -2219,7 +2244,7 @@ have lots of extensions, so the "full support" may not be 100% true… + typescript + undo-tree + vc (built-in mode line status for version control) -+ vc-annotate (=C-x v g=) ++ vc-annotate (the out put of {{{kbd(C-x v g)}}}) + vdiff + vimish-fold + visible-mark @@ -2279,21 +2304,21 @@ individual packages. :CUSTOM_ID: h:2a602816-bc1b-45bf-9675-4cbbd7bf6cab :END: -While designing the style for =display-fill-column-indicator-mode=, we +While designing the style for ~display-fill-column-indicator-mode~, we stayed close to the mode's defaults: to apply a subtle foreground color -to the =fill-column-indicator= face, which blends well with the rest of +to the ~fill-column-indicator~ face, which blends well with the rest of theme and is consistent with the role of that mode. This is to not upset the expectations of users. -Nevertheless, =display-fill-column-indicator-mode= has some known +Nevertheless, ~display-fill-column-indicator-mode~ has some known limitations pertaining to its choice of using typographic characters to draw its indicator. What should be a continuous vertical line might appear as a series of dashes in certain contexts or under specific -conditions: a non-default value for =line-spacing=, scaled and/or +conditions: a non-default value for ~line-spacing~, scaled and/or variable-pitch headings have been observed to cause this effect. Given that we cannot control such factors, it may be better for affected -users to deviate from the default style of the =fill-column-indicator= +users to deviate from the default style of the ~fill-column-indicator~ face. Instead of setting a foreground color, one could use a background and have the foreground be indistinguishable from it. For example: @@ -2312,16 +2337,16 @@ and have the foreground be indistinguishable from it. For example: :CUSTOM_ID: h:a94272e0-99da-4149-9e80-11a7e67a2cf2 :END: -This library by Adam Porter, aka "alphapapa" or "github-alphapapa", +This package by Adam Porter, aka "alphapapa" or "github-alphapapa", implements an alternative to the typical coloration of code. Instead of highligting the syntactic constructs, it applies color to different levels of depth in the code. -As =prism.el= is highly configurable, we cannot style it directly at the -theme level. Instead, we may offer sample presets. Those should offer -a starting point for users to adapt to their needs. +As {{{file(prism.el)}}} is highly configurable, we cannot style it +directly at the theme level. Instead, we may offer sample presets. +Those should offer a starting point for users to adapt to their needs. -In the following code snippets, we employ the =modus-themes-with-colors= +In the following code snippets, we employ the ~modus-themes-with-colors~ macro: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. With 16 colors: @@ -2404,9 +2429,9 @@ prism.el documentation recommends, like this: :CUSTOM_ID: h:20cef8c4-d11f-4053-8b2c-2872925780b1 :END: -By default, the =company-mode= pop-up that lists completion candidates is -drawn using an overlay. This creates alignment issues every time it is -placed above a piece of text that has a different height than the +By default, the ~company-mode~ pop-up that lists completion candidates +is drawn using an overlay. This creates alignment issues every time it +is placed above a piece of text that has a different height than the default. The solution recommended by the project's maintainer is to use an @@ -2420,10 +2445,10 @@ https://github.com/tumashu/company-posframe/] :CUSTOM_ID: h:98bdf319-1e32-4469-8a01-771200fba65c :END: -The built-in IRC client =erc= has the ability to colorise any text using -escape sequences that start with =^C= (inserted with =C-q C-c=) and are -followed by a number for the foreground and background.[fn:: This page -explains the basics, though it is not specific to Emacs: +The built-in IRC client ~erc~ has the ability to colorise any text using +escape sequences that start with =^C= (inserted with {{{kbd(C-q C-c)}}}) +and are followed by a number for the foreground and background.[fn:: +This page explains the basics, though it is not specific to Emacs: https://www.mirc.com/colors.html] Possible numbers are 0-15, with the first entry being the foreground and the second the background, separated by a comma. Like this =^C1,6=. The minimum setup is this: @@ -2440,7 +2465,7 @@ we do is provide guidance on the combinations that satisfy the accessibility standard of the themes: + Modus Operandi :: Use foreground color 1 for all backgrounds from - 2-15. Like so: =C-q C-c1,N= where =N= is the background. + 2-15. Like so: {{{kbd(C-q C-c1,N)}}} where =N= is the background. + Modus Vivendi :: Use foreground color 0 for all backgrounds from 2-13. Use foreground =1= for backgrounds 14, 15. @@ -2454,7 +2479,7 @@ together, if you must. :END: Both Powerline and Spaceline package users will likely need to use the -command =powerline-reset= whenever they make changes to their themes +command ~powerline-reset~ whenever they make changes to their themes and/or modeline setup. ** Note on SHR colors @@ -2462,9 +2487,11 @@ and/or modeline setup. :CUSTOM_ID: h:4cc767dc-ffef-4c5c-9f10-82eb7b8921bf :END: -Emacs' HTML rendering library (=shr.el=) may need explicit configuration -to respect the theme's colors instead of whatever specifications the -webpage provides. Consult =C-h v shr-use-colors=. +Emacs' HTML rendering library ({{{file(shr.el)}}}) may need explicit +configuration to respect the theme's colors instead of whatever +specifications the webpage provides. + +Consult {{{kbd(C-h v shr-use-colors)}}}. ** Note for Helm grep :PROPERTIES: @@ -2473,11 +2500,12 @@ webpage provides. Consult =C-h v shr-use-colors=. There is one face from the Helm package that is meant to highlight the matches of a grep or grep-like command (=ag= or =ripgrep=). It is -=helm-grep-match=. However, this face can only apply when the user does +~helm-grep-match~. However, this face can only apply when the user does not pass =--color=always= as a command-line option for their command. Here is the docstring for that face, which is defined in the -=helm-grep.el= library (view a library with =M-x find-library=). +{{{file(helm-grep.el)}}} library (you can visit the source code with +{{{kbd(M-x find-library)}}}). #+begin_quote Face used to highlight grep matches. Have no effect when grep backend @@ -2487,24 +2515,24 @@ use "--color=" The user must either remove =--color= from the flags passed to the grep function, or explicitly use =--color=never= (or equivalent). Helm provides user-facing customization options for controlling the grep -function's parameters, such as =helm-grep-default-command= and -=helm-grep-git-grep-command=. +function's parameters, such as ~helm-grep-default-command~ and +~helm-grep-git-grep-command~. When =--color=always= is in effect, the grep output will use red text in bold letter forms to present the matching part in the list of candidates. That style still meets the contrast ratio target of >= 7:1 (accessibility standard WCAG AAA), because it draws the reference to ANSI color number 1 (red) from the already-supported array of -=ansi-color-names-vector=. +~ansi-color-names-vector~. ** Note on vc-annotate-background-mode :PROPERTIES: :CUSTOM_ID: h:5095cbd1-e17a-419c-93e8-951c186362a3 :END: -Due to the unique way =vc-annotate= (=C-x v g=) applies colors, support for -its background mode (=vc-annotate-background-mode=) is disabled at the -theme level. +Due to the unique way ~vc-annotate~ ({{{kbd(C-x v g)}}}) applies colors, +support for its background mode (~vc-annotate-background-mode~) is +disabled at the theme level. Normally, such a drastic measure should not belong in a theme: assuming the user's preferences is bad practice. However, it has been deemed @@ -2579,7 +2607,7 @@ in which you can contribute to their ongoing development. :END: #+CINDEX: Sources of the themes -The =modus-operandi= and =modus-vivendi= themes are built into Emacs. +The ~modus-operandi~ and ~modus-vivendi~ themes are built into Emacs. Currently they are in Emacs' git main branch (trunk), which is tracking the next development release target. diff --git a/doc/modus-themes.texi b/doc/modus-themes.texi new file mode 100644 index 0000000..d9b5018 --- /dev/null +++ b/doc/modus-themes.texi @@ -0,0 +1,3833 @@ +\input texinfo @c -*- texinfo -*- +@c %**start of header +@setfilename modus-themes.info +@settitle Modus themes for GNU Emacs +@documentencoding UTF-8 +@documentlanguage en +@set MAINTAINERSITE @uref{https://protesilaos.com,maintainer webpage} +@set MAINTAINER Protesilaos Stavrou +@set MAINTAINEREMAIL @email{info@protesilaos.com} +@set MAINTAINERCONTACT @uref{mailto:info@protesilaos.com,contact the maintainer} +@c %**end of header + +@copying +Copyright (C) 2020-2021 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this +document under the terms of the GNU Free Documentation License, +Version 1.3 or any later version published by the Free Software +Foundation; with no Invariant Sections, with no Front-Cover Texts, +and with no Back-Cover Texts. + +@end quotation +@end copying + +@dircategory Emacs +@direntry +* Modus Themes: (modus-themes). Highly accessible themes (WCAG AAA). +@end direntry + +@finalout +@titlepage +@title Modus themes for GNU Emacs +@author Protesilaos Stavrou (@email{info@@protesilaos.com}) +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@ifnottex +@node Top +@top Modus themes for GNU Emacs + +@insertcopying + +This manual, written by Protesilaos Stavrou, describes the customization +options for the @code{modus-operandi} and @code{modus-vivendi} themes, and +provides every other piece of information pertinent to them. + +The documentation furnished herein corresponds to stable version +1.1.1, released on 2021-01-25. Any reference to +a newer feature which does not yet form part of the latest tagged +commit, is explicitly marked as such. + +Current development target is 1.2.0-dev. This manual +was rebuilt on 2021-02-24 09:09 +0200. + +@end ifnottex + +@menu +* Overview:: +* Installation:: +* Enable and load:: +* Customization Options:: +* Advanced customization (do-it-yourself):: +* Face coverage:: +* Notes for individual packages:: +* Contributing:: +* Acknowledgements:: +* Meta:: +* GNU Free Documentation License:: +* Indices:: + +@detailmenu +--- The Detailed Node Listing --- + +Overview + +* How do the themes look like:: +* Learn about the latest changes:: + +Installation + +* Install manually from source:: +* Install from the archives:: +* Install on GNU/Linux:: + +Install on GNU/Linux + +* Debian 11 Bullseye:: +* GNU Guix:: + +Enable and load + +* Sample configuration for use-package:: +* Differences between loading and enabling:: + +Customization Options + +* Bold constructs:: Toggle bold constructs in code +* Slanted constructs:: Toggle slanted constructs (italics) in code +* Syntax styles:: Choose the overall aesthetic of code syntax +* No mixed fonts:: Toggle mixing of font families +* Link styles:: Choose among several styles, with or without underline +* Command prompts:: Choose among plain, subtle, or intense prompts +* Mode line:: Choose among several styles, with or without borders +* Completion UIs:: Choose among standard, moderate, or opinionated looks +* Fringes:: Choose among invisible, subtle, or intense fringe styles +* Language checkers:: Control the style of language checkers/linters +* Line highlighting:: Toggle intense style for current line highlighting +* Line numbers:: Toggle subtle style for line numbers +* Matching parentheses:: Choose between various styles for matching delimiters/parentheses +* Active region:: Choose between various styles for the active region +* Diffs:: Choose among intense, desaturated, or text-only diffs +* Org mode blocks:: Choose among plain, grayscale, or rainbow styles +* Org agenda habits:: Choose among standard, simplified, or traffic light styles +* Heading styles:: Choose among several styles, also per heading level +* Scaled headings:: Toggle scaling of headings +* UI typeface:: Toggle the use of variable-pitch across the User Interface +* Headings' typeface:: Toggle the use of variable-pitch in headings + +Scaled headings + +* Scaled heading sizes:: Specify rate of increase for scaled headings + +Advanced customization (do-it-yourself) + +* Per-theme customization settings (DIY):: +* Case-by-case face specs using the themes' palette (DIY):: +* Face specs at scale using the themes' palette (DIY):: +* Override colors (DIY):: +* Font configurations for Org and others (DIY):: +* Custom Org user faces (DIY):: +* Measure color contrast (DIY):: +* Load theme depending on time of day:: +* A theme-agnostic hook for theme loading (DIY):: + +Face coverage + +* Supported packages:: Full list of covered face groups +* Indirectly covered packages:: + +Notes for individual packages + +* Note for display-fill-column-indicator-mode:: +* Note for prism:: +* Note on company-mode overlay pop-up:: +* Note for ERC escaped color sequences:: +* Note for powerline or spaceline:: +* Note on SHR colors:: +* Note for Helm grep:: +* Note on vc-annotate-background-mode:: +* Note on pdf-tools link hints:: + +Contributing + +* Sources of the themes:: +* Issues you can help with:: +* Patches require copyright assignment to the FSF:: + +Indices + +* Function index:: +* Variable index:: +* Concept index:: + +@end detailmenu +@end menu + +@node Overview +@chapter Overview + +The Modus themes are designed for accessible readability. They conform +with the highest standard for color contrast between any given +combination of background and foreground values. This corresponds to +the WCAG AAA standard, which specifies a minimum rate of distance in +relative luminance of 7:1. + +Modus Operandi (@code{modus-operandi}) is a light theme, while Modus Vivendi +(@code{modus-vivendi}) is dark. Each theme's color palette is designed to +meet the needs of the numerous interfaces that are possible in the Emacs +computing environment. + +The overarching objective of this project is to always offer accessible +color combinations. There shall never be a compromise on this +principle. If there arises an inescapable trade-off between readability +and stylistic considerations, we will always opt for the former. + +To ensure that users have a consistently accessible experience, the +themes strive to achieve as close to full face coverage as possible +(@ref{Face coverage}). + +Starting with version 0.12.0 and onwards, the themes are built into GNU +Emacs. + +@menu +* How do the themes look like:: +* Learn about the latest changes:: +@end menu + +@node How do the themes look like +@section How do the themes look like + +@cindex Screenshots + +Check the web page with @uref{https://protesilaos.com/modus-themes-pictures/, the screen shots}. There are lots of scenarios +on display that draw attention to details and important aspects in the +design of the themes. They also showcase the numerous customization +options. + +@ref{Customization Options, , Customization options}. + +@node Learn about the latest changes +@section Learn about the latest changes + +@cindex Changelog + +Please refer to the @uref{https://protesilaos.com/modus-themes-changelog, web page with the change log}. It is comprehensive +and covers everything that goes into every tagged release of the themes. + +@node Installation +@chapter Installation + +The Modus themes are distributed with Emacs starting with version 28.1. +On older versions of Emacs, they can be installed using Emacs' package +manager or manually from their code repository. There also exist +packages for distributions of GNU/Linux. + +@menu +* Install manually from source:: +* Install from the archives:: +* Install on GNU/Linux:: +@end menu + +@node Install manually from source +@section Install manually from source + +In the following example, we are assuming that your Emacs files are +stored in @samp{~/.emacs.d} and that you want to place the Modus themes in +@samp{~/.emacs.d/modus-themes}. + +@enumerate +@item +Get the source and store it in the desired path by running the +following in the command line shell: +@end enumerate + +@example +$ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes +@end example + + +@enumerate +@item +Add that path to your known Elisp libraries' list, by placing this +snippet of Emacs Lisp in your init file (e.g. @file{init.el}): +@end enumerate + +@lisp +(add-to-list 'load-path "~/.emacs.d/modus-themes") +@end lisp + +The themes are now ready to be used: @ref{Enable and load}. + +@node Install from the archives +@section Install from the archives + +The @samp{modus-themes} package is available from the GNU ELPA archive, which +is configured by default. + +Prior to querying any package archive, make sure to have updated the +index, with @kbd{M-x package-refresh-contents}. Then all you need +to do is type @kbd{M-x package-install} and specify the +@code{modus-themes}. + +Note that older versions of the themes used to be distributed as +standalone packages. This practice has been discontinued starting with +version 1.0.0 of this project. + +Once installed, the themes are ready to be used: @ref{Enable and load}. + +@node Install on GNU/Linux +@section Install on GNU/Linux + +The themes are also available from the archives of some distributions of +GNU/Linux. These should correspond to a tagged release rather than +building directly from the latest Git commit. It all depends on the +distro's packaging policies. + +@menu +* Debian 11 Bullseye:: +* GNU Guix:: +@end menu + +@node Debian 11 Bullseye +@subsection Debian 11 Bullseye + +The two themes are distributed as a single package for Debian and its +derivatives. Currently in the unstable and testing suites and should be +available in time for Debian 11 Bullseye (next stable). + +Get them with: + +@example +sudo apt install elpa-modus-themes +@end example + +The themes are now ready to be used: @ref{Enable and load}. + +@node GNU Guix +@subsection GNU Guix + +Users of Guix can get the themes with this command: + +@example +guix package -i emacs-modus-themes +@end example + +The themes are now ready to be used: @ref{Enable and load}. + +@node Enable and load +@chapter Enable and load + +@findex modus-themes-load-themes +@findex modus-themes-toggle +@findex modus-themes-load-operandi +@findex modus-themes-load-vivendi +@cindex Essential configuration +@vindex modus-themes-after-load-theme-hook + +Before you load a theme, it is necessary to require the main library: + +@lisp +(require 'modus-themes) +@end lisp + +Then load the individual theme files with the helper function +@code{modus-themes-load-themes}: + +@lisp +;; Load the theme files before enabling a theme (else you get an error). +(modus-themes-load-themes) +@end lisp + +Once the libraries that define the themes are enabled, you can load a +theme with either of the following expressions: + +@lisp +(modus-themes-load-operandi) ; Light theme +;; OR +(modus-themes-load-vivendi) ; Dark theme +@end lisp + +You may want to make some changes to the available customization options +before loading a theme (@ref{Customization Options}). So this is how a basic +setup should look like: + +@lisp +(require 'modus-themes) + +;; Your customisations here. For example: +(setq modus-themes-bold-constructs t + modus-themes-mode-line '3d) + +;; Load the theme files before enabling a theme (else you get an error). +(modus-themes-load-themes) + +;; Enable the theme of your preference: +(modus-themes-load-operandi) + +;; Optionally add a key binding for the toggle between the themes: +(define-key global-map (kbd "") #'modus-themes-toggle) +@end lisp + +@ref{Sample configuration for use-package}. + +With those granted, bear in mind a couple of technical points on +@code{modus-themes-load-operandi} and @code{modus-themes-load-vivendi}, as well as +@code{modus-themes-toggle} which relies on them: + +@enumerate +@item +Those functions use @code{load-theme}. Some users prefer opting for +@code{enable-theme} instead (@ref{Differences between loading and enabling}). + +@item +The functions will run the @code{modus-themes-after-load-theme-hook} as +their final step. This can be employed for bespoke configurations +(@ref{Advanced customization (do-it-yourself)}). Experienced users may not +wish to rely on such a hook and the functions that run it: they may +prefer a custom solution (@ref{A theme-agnostic hook for theme loading (DIY), , A theme-agnostic hook for theme loading}). +@end enumerate + +@menu +* Sample configuration for use-package:: +* Differences between loading and enabling:: +@end menu + +@node Sample configuration for use-package +@section Sample configuration for use-package + +@cindex use-package configuration + +It is common for Emacs users to rely on @code{use-package} for declaring +package configurations in their setup. We use this as an example: + +@lisp +(use-package modus-themes + :ensure + :init + ;; Add all your customizations prior to loading the themes + (setq modus-themes-slanted-constructs t + modus-themes-bold-constructs nil) + + ;; Load the theme files before enabling a theme (else you get an error). + (modus-themes-load-themes) + :config + ;; Load the theme of your choice: + (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) + :bind ("" . modus-themes-toggle)) +@end lisp + +@ref{Differences between loading and enabling}. + +Note: make sure not to customize the variable @code{custom-theme-load-path} +or @code{custom-theme-directory} after the themes' package declaration. That +will lead to failures in loading the files. If either or both of those +variables need to be changed, their values should be defined before the +package declaration of the themes. + +@node Differences between loading and enabling +@section Differences between loading and enabling + +@cindex load-theme VS enable-theme + +The reason we recommend @code{load-theme} instead of the other option of +@code{enable-theme} is that the former does a kind of ``reset'' on the face +specs. It quite literally loads (or re-loads) the theme. Whereas the +latter simply puts an already loaded theme at the top of the list of +enabled items, re-using whatever state was last loaded. + +As such, @code{load-theme} reads all customizations that may happen during +any given Emacs session: even after the initial setup of a theme. +Examples are calls to @code{custom-set-faces}, as well as new values assigned +to the options the Modus themes provide (@ref{Customization Options}). + +Our tests show that @code{enable-theme} does not read such variables anew, so +it might appear to the unsuspecting user that the themes are somehow +broken whenever they try to assign a new value to a customization option +or some face. + +This ``reset'' that @code{load-theme} conducts does, however, come at the cost +of being somewhat slower than @code{enable-theme}. Users who have a stable +setup and who seldom update their variables during a given Emacs +session, are better off using something like this: + +@lisp +(require 'modus-themes) +(require 'modus-operandi-theme) +(require 'modus-vivendi-theme) + +(enable-theme 'modus-operandi) ;; OR (enable-theme 'modus-vivendi) +@end lisp + +@ref{Sample configuration for use-package}. + +With the above granted, other sections of the manual discuss how to +configure custom faces, where @code{load-theme} is expected, though +@code{enable-theme} could still apply in stable setups: + +@ref{Case-by-case face specs using the themes' palette (DIY), , Case-by-case face specs using the themes' palette}. + +@ref{Face specs at scale using the themes' palette (DIY), , Face specs at scale using the themes' palette}. + +@node Customization Options +@chapter Customization Options + +The Modus themes are highly configurable, though they should work well +without any further tweaks. By default, all customization options are +set to nil. + +Remember that all customization options must be evaluated before loading +a theme (@ref{Enable and load}). + +@menu +* Bold constructs:: Toggle bold constructs in code +* Slanted constructs:: Toggle slanted constructs (italics) in code +* Syntax styles:: Choose the overall aesthetic of code syntax +* No mixed fonts:: Toggle mixing of font families +* Link styles:: Choose among several styles, with or without underline +* Command prompts:: Choose among plain, subtle, or intense prompts +* Mode line:: Choose among several styles, with or without borders +* Completion UIs:: Choose among standard, moderate, or opinionated looks +* Fringes:: Choose among invisible, subtle, or intense fringe styles +* Language checkers:: Control the style of language checkers/linters +* Line highlighting:: Toggle intense style for current line highlighting +* Line numbers:: Toggle subtle style for line numbers +* Matching parentheses:: Choose between various styles for matching delimiters/parentheses +* Active region:: Choose between various styles for the active region +* Diffs:: Choose among intense, desaturated, or text-only diffs +* Org mode blocks:: Choose among plain, grayscale, or rainbow styles +* Org agenda habits:: Choose among standard, simplified, or traffic light styles +* Heading styles:: Choose among several styles, also per heading level +* Scaled headings:: Toggle scaling of headings +* UI typeface:: Toggle the use of variable-pitch across the User Interface +* Headings' typeface:: Toggle the use of variable-pitch in headings +@end menu + +@node Bold constructs +@section Option for more bold constructs + +@vindex modus-themes-bold-constructs + +Symbol: @code{modus-themes-bold-constructs} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default is to use a bold typographic weight only when it is +required. + +With a non-nil value (@samp{t}) display several syntactic constructs in bold +weight. This concerns keywords and other important aspects of code +syntax. It also affects certain mode line indicators and command-line +prompts. + +@node Slanted constructs +@section Option for more slanted constructs + +@vindex modus-themes-slanted-constructs + +Symbol: @code{modus-themes-slanted-constructs} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default is to not use slanted text (italics) unless it is absolutely +necessary. + +With a non-nil value (@samp{t}) choose to render more faces in slanted text. +This typically affects documentation strings and code comments. + +@node Syntax styles +@section Option for syntax highlighting + +@vindex modus-themes-syntax + +Symbol: @code{modus-themes-syntax} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{faint} +@item +@code{yellow-comments} +@item +@code{green-strings} +@item +@code{yellow-comments-green-strings} +@item +@code{alt-syntax} +@item +@code{alt-syntax-yellow-comments} +@item +@code{faint-yellow-comments} (coming in version @samp{1.2.0}) +@end enumerate + +The default style (nil) for code syntax highlighting is a balanced +combination of colors on the cyan-blue-magenta side of the spectrum. +There is little to no use of greens, yellows, or reds, except when it is +necessary. + +Option @code{faint} is like the default in terms of the choice of palette but +applies desaturated color values. + +Option @code{yellow-comments} applies a yellow tint to comments. The rest of +the syntax is the same as the default. + +Option @code{green-strings} replaces the blue/cyan/cold color variants in +strings with greener alternatives. The rest of the syntax remains the +same. + +Option @code{yellow-comments-green-strings} combines yellow comments with +green strings and the rest of the default syntax highlighting style. + +Option @code{alt-syntax} expands the active spectrum by applying color +combinations with more contrasting hues between them. Expect to find +more red and green variants in addition to cyan, blue, magenta. + +Option @code{alt-syntax-yellow-comments} combines @code{alt-syntax} with +@code{yellow-comments}. + +Option @code{faint-yellow-comments} combines the @code{faint} style with +@code{yellow-comments}. + +@node No mixed fonts +@section Option for no font mixing + +@vindex modus-themes-no-mixed-fonts + +Symbol: @code{modus-themes-no-mixed-fonts} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +By default, the themes configure some spacing-sensitive faces like Org +tables and code blocks to always inherit from the @code{fixed-pitch} face. +This is to ensure that those constructs remain monospaced even when +users opt for a mode that remaps typeface families, such as the built-in +@kbd{M-x variable-pitch-mode}. Otherwise the layout would appear +broken, due to how spacing is done. To disable this behaviour, set the +option to @samp{t}. + +Users may prefer to use another package for handling mixed typeface +configurations, rather than letting the theme do it, perhaps because a +purpose-specific package has extra functionality. Two possible options +are @code{org-variable-pitch} and @code{mixed-pitch}. + +@ref{Font configurations for Org and others (DIY), , Font configurations for Org (and others)}. + +@node Link styles +@section Option for links + +@vindex modus-themes-links + +Symbol: @code{modus-themes-links} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{faint} +@item +@code{neutral-underline} +@item +@code{faint-neutral-underline} +@item +@code{no-underline} +@item +@code{underline-only} +@item +@code{neutral-underline-only} (coming in version @samp{1.2.0}) +@end enumerate + +The default style (nil) for links is to apply an underline and a +saturated color to the affected text. The color of the two is the same, +which makes the link fairly prominent. + +Option @code{faint} follows the same approach as the default, but uses less +intense colors. + +Option @code{neutral-underline} changes the underline's color to a subtle +gray, while retaining the default text color. + +Option @code{faint-neutral-underline} combines a desaturated text color with +a subtle gray underline. + +Option @code{no-underline} removes link underlines altogether, while +retaining their original fairly vivid color. + +Option @code{underline-only} applies a prominent underline while making the +affected text colorless (it uses the same foreground as the theme's +default). + +Option @code{neutral-underline-only} makes the text colorless while using a +subtle gray underline below it. + +NOTE: The placement of the underline, i.e. its proximity to the affected +text, is controlled by the built-in @code{x-underline-at-descent-line}, +@code{x-use-underline-position-properties}, @code{underline-minimum-offset}. +Please refer to their documentation strings. + +@node Command prompts +@section Option for command prompt styles + +@vindex modus-themes-prompts + +Symbol: @code{modus-themes-prompts} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{subtle-accented} (@code{subtle} remains for backward compatibility) +@item +@code{intense-accented} (@code{intense} remains for backward compatibility) +@item +@code{subtle-gray} +@item +@code{intense-gray} +@end enumerate + +The default does not use any background for minibuffer and command line +prompts. It relies exclusively on an accented foreground color. + +Options @code{subtle-accented} and @code{intense-accented} will change both the +background and the foreground values to use accented color combinations +that follow the hue of the default styles' foreground (e.g. the default +minibuffer prompt is cyan text, so these combinations will involved a +cyan background and an appropriate cyan foreground). The difference +between the two is that the latter has a more pronounced/noticeable +effect than the former. + +Options @code{subtle-gray}, @code{intense-gray} are like their accented +counterparts, except they use grayscale values. + +@node Mode line +@section Option for mode line presentation + +@vindex modus-themes-mode-line + +Symbol: @code{modus-themes-mode-line} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{3d} +@item +@code{moody} +@item +@code{borderless} +@item +@code{borderless-3d} +@item +@code{borderless-moody} +@end enumerate + +The default produces a two-dimensional effect both for the active and +inactive modelines. The differences between the two are limited to +distinct shades of grayscale values, with the active being more intense +than the inactive. + +Option @code{3d} will make the active modeline look like a three-dimensional +rectangle. Inactive modelines remain 2D, though they are slightly toned +down relative to the default. This aesthetic is virtually the same as +what you get when you run Emacs without any customizations (@samp{emacs -Q} +on the command line). + +While @code{moody} removes all box effects from the modelines and applies +underline and overline properties instead. It also tones down a bit the +inactive modelines. This is meant to optimize things for use with the +@uref{https://github.com/tarsius/moody, moody package} (hereinafter referred to as ``Moody''), though it can work +fine even without it. + +The @code{borderless} option uses the same colors as the default (nil value), +but removes the border effect. This is done by making the box property +use the same color as the background, effectively blending the two and +creating some padding. + +The @code{borderless-3d} and @code{borderless-moody} approximate the @code{3d} and +@code{moody} options respectively, while removing the borders. However, to +ensure that the inactive modelines remain visible, they apply a slightly +more prominent background to them than what their counterparts do (same +inactive background as with the default). + +Note that Moody does not expose any faces that the themes could style +directly. Instead it re-purposes existing ones to render its tabs and +ribbons. As such, there may be cases where the contrast ratio falls +below the 7:1 target that the themes conform with (WCAG AAA). To hedge +against this, we configure a fallback foreground for the @code{moody} option, +which will come into effect when the background of the modeline changes +to something less accessible, such as Moody ribbons (read the doc string +of @code{set-face-attribute}, specifically @code{:distant-foreground}). This +fallback is activated when Emacs determines that the background and +foreground of the given construct are too close to each other in terms +of color distance. In effect, users would need to experiment with the +variable @code{face-near-same-color-threshold} to trigger the effect. We +find that a value of @samp{45000} will suffice, contrary to the default +@samp{30000}. Do not set the value too high, because that would have the +adverse effect of always overriding the default color (which has been +carefully designed to be highly accessible). + +Furthermore, because Moody expects an underline and overline instead of +a box style, it is advised you include this in your setup: + +@lisp +(setq x-underline-at-descent-line t) +@end lisp + +@node Completion UIs +@section Option for completion framework aesthetics + +@vindex modus-themes-completions + +Symbol: @code{modus-themes-completions} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{moderate} +@item +@code{opinionated} +@end enumerate + +This is a special option that has different effects depending on the +completion UI@. The interfaces can be grouped in two categories, based +on their default aesthetics: (i) those that only or mostly use +foreground colors for their interaction model, and (ii) those that +combine background and foreground values for some of their metaphors. +The former category encompasses Icomplete, Ido, Selectrum as well as +pattern matching styles like Orderless and Flx. The latter covers Helm, +Ivy, and similar. + +A value of @samp{nil} will respect the metaphors of each completion +framework. + +Option @code{moderate} applies a combination of background and foreground +that is fairly subtle. For Icomplete and friends this constitutes a +departure from their default aesthetics, however the difference is +small. While Helm, Ivy et al appear slightly different than their +original looks, as they are toned down a bit. + +Option @code{opinionated} uses color combinations that refashion the +completion UI@. For the Icomplete camp this means that intense +background and foreground combinations are used: in effect their looks +emulate those of Helm, Ivy and co. in their original style. Whereas the +other group of packages will revert to an even more nuanced aesthetic +with some additional changes to the choice of hues. + +To appreciate the scope of this customization option, you should spend +some time with every one of the @samp{nil} (default), @code{moderate}, and +@code{opinionated} possibilities. + +@node Fringes +@section Option for fringe visibility + +@vindex modus-themes-fringes + +Symbol: @code{modus-themes-fringes} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{subtle} +@item +@code{intense} +@end enumerate + +The default is to use the same color as that of the main background, +meaning that the fringes are not obvious though they still occupy the +space given to them by @code{fringe-mode}. + +Options @code{subtle} and @code{intense} apply a gray background, making the +fringes visible. The difference between the two is one of degree, as +their names imply. + +@node Language checkers +@section Option for language checkers + +@vindex modus-themes-lang-checkers + +Symbol: @code{modus-themes-lang-checkers} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{subtle-foreground} +@item +@code{intense-foreground} +@item +@code{straight-underline} +@item +@code{subtle-foreground-straight-underline} +@item +@code{intense-foreground-straight-underline} +@item +@code{colored-background} +@end enumerate + +Nil (the default) applies a color-coded underline to the affected text, +while it leaves the original foreground in tact. If the display spec +where Emacs runs in has support for it (e.g. Emacs GUI), the underline's +style is that of a wave, otherwise it is a straight line. + +Options @code{subtle-foreground} and @code{intense-foreground} follow the same +color-coding pattern and wavy underline of the default, while extending +it with a corresponding foreground value for the affected text. The +difference between the two options is one of degree, as their names +suggest. + +Option @code{straight-underline} is like the default but always applies a +straight line under the affected text. Same principle for +@code{subtle-foreground-straight-underline} and its counterpart +@code{intense-foreground-straight-underline}. + +Option @code{colored-background} uses a straight underline, a tinted +background, and a suitable foreground. All are color-coded. This is +the most intense combination of face properties. + +The present variable affects packages and/or face groups such as those +of @samp{flyspell}, @samp{flymake}, @samp{flycheck}, @code{artbollocks-mode}, and +@code{writegood-mode}. + +NOTE: The placement of the straight underline, though not the wave +style, is controlled by the built-in @code{x-underline-at-descent-line}, +@code{x-use-underline-position-properties}, @code{underline-minimum-offset}. +Please refer to their documentation strings. + +@node Line highlighting +@section Option for line highlighting (hl-line-mode) + +@vindex modus-themes-intense-hl-line + +Symbol: @code{modus-themes-intense-hl-line} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default is to use a subtle gray background for @code{hl-line-mode} and +its global equivalent. + +With a non-nil value (@samp{t}) use a more prominent background color +instead. + +This affects several packages that enable @code{hl-line-mode}, such as +@samp{elfeed} and @samp{mu4e}. + +@node Line numbers +@section Option for line numbers (display-line-numbers-mode) + +@vindex modus-themes-subtle-line-numbers + +(coming in version @samp{1.2.0}) + +Symbol: @code{modus-themes-subtle-line-numbers} + +Possible value: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default style for @code{display-line-numbers-mode} and its global variant +is to apply a subtle gray background to the line numbers. The current +line has a more pronounced background and foreground combination to +bring more attention to itself. + +Similarly, the faces for @code{display-line-numbers-major-tick} and its +counterpart @code{display-line-numbers-minor-tick} use appropriate styles +that involve a bespoke background and foreground combination. + +With a non-nil value (@samp{t}), line numbers have no background of their +own. Instead they retain the primary background of the theme, blending +with the rest of the buffer. Foreground values for all relevant faces +are updated to accommodate this aesthetic. + +@node Matching parentheses +@section Option for parenthesis matching (show-paren-mode) + +@vindex modus-themes-paren-match + +Symbol: @code{modus-themes-paren-match} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{subtle-bold} +@item +@code{intense} +@item +@code{intense-bold} +@end enumerate + +Nil means to use a subtle tinted background color for the matching +delimiters. + +Option @code{intense} applies a saturated background color. + +Option @code{subtle-bold} is the same as the default, but also makes use of +bold typographic weight (inherits the @code{bold} face). + +Option @code{intense-bold} is the same as @code{intense}, while it also uses a +bold weight. + +This customization variable affects tools such as the built-in +@code{show-paren-mode} and the @samp{smartparens} package. + +@node Active region +@section Option for active region + +@vindex modus-themes-region + +Symbol: @code{modus-themes-region} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{no-extend} +@item +@code{bg-only} +@item +@code{bg-only-no-extend} +@end enumerate + +Nil means to only use a prominent gray background with a neutral +foreground. The foreground overrides all syntax highlighting. The +region extends to the edge of the window. + +Option @code{no-extend} preserves the default aesthetic but prevents the +region from extending to the edge of the window. + +Option @code{bg-only} applies a faint tinted background that is distinct from +all others used in the theme, while it does not override any existing +colors. It extends to the edge of the window. + +Option @code{bg-only-no-extend} is a combination of the @code{bg-only} and +@code{no-extend} options. + +@node Diffs +@section Option for diff buffer looks + +@vindex modus-themes-diffs + +Symbol: @code{modus-themes-diffs} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{desaturated} +@item +@code{fg-only} +@item +@code{bg-only} +@end enumerate + +By default the themes apply rich coloration to the output of diffs, such +as those of @code{diff-mode}, @code{ediff}, @code{smerge-mode}, and Magit. These are +color combinations of an accented background and foreground so that, for +example, added lines have a pronounced green background with an +appropriate shade of green for the affected text. Word-wise or +``refined'' changes follow this pattern but use different shades of those +colors to remain distinct. + +Option @code{desaturated} tones down all relevant color values. It still +combines an accented background with an appropriate foreground, yet its +overall impression is fairly subtle. Refined changes are a bit more +intense to fulfil their intended function, though still less saturated +than default. + +Option @code{fg-only} will remove most accented backgrounds and instead rely +on color-coded text to denote changes. For instance, added lines use a +green foreground, while their background is the same as the rest of the +buffer. Word-wise highlights still use a background value which is, +nonetheless, more subtle than its default equivalent. + +Option @code{bg-only} applies color-coded backgrounds but does not override +any syntax highlighting that may be present. This makes it suitable for +use with a non-nil value for @code{diff-font-lock-syntax} (which is the +default for @code{diff-mode} buffers in Emacs 27 or higher). + +Concerning Magit, an extra set of tweaks are introduced for the effect +of highlighting the current diff hunk, so as to remain aligned with the +overall experience of that mode. Expect changes that are consistent +with the overall intent of the aforementioned. Note, however, that the +@code{bg-only} option will not deliver the intended results in Magit diffs +because no syntax highlighting is used there (last checked with Magit +version 20201116.1057, though upstream has a plan to eventually support +such a feature---this entry shall be updated accordingly). + +@node Org mode blocks +@section Option for org-mode block styles + +@vindex modus-themes-org-blocks + +Symbol: @code{modus-themes-org-blocks} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{grayscale} +@item +@code{rainbow} +@end enumerate + +The default is to use the same background as the rest of the buffer for +the contents of the block. + +Option @code{grayscale} applies a subtle neutral gray background to the +block's contents. It will also extend to the edge of the window the +background of the ``begin'' and ``end'' block delimiter lines (only relevant +for Emacs versions >= 27 where the 'extend' keyword is part of the face +specifications). + +Option @code{rainbow} uses an accented background for the contents of the +block. The exact color will depend on the programming language and is +controlled by the @code{org-src-block-faces} variable. This is most suitable +for users who work on literate programming documents that mix and match +several languages. + +Note that the ``rainbow'' blocks may require you to also reload the +major-mode so that the colors are applied consistently throughout: use +@kbd{M-x org-mode} or @kbd{M-x org-mode-restart} to refresh +the buffer. Or start typing in each code block (inefficient at scale, +but it still works). + +@node Org agenda habits +@section Option for org-habit graph styles + +@vindex modus-themes-org-habit + +Symbol: @code{modus-themes-org-habit} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@code{simplified} +@item +@code{traffic-light} +@end enumerate + +The default is meant to conform with the original aesthetic of +@samp{org-habit}. It employs all four color codes that correspond to the +org-habit states---clear, ready, alert, and overdue---while +distinguishing between their present and future variants. This results +in a total of eight colors in use: red, yellow, green, blue, in tinted +and shaded versions. They cover the full set of information provided by +the @samp{org-habit} consistency graph. + +Option @code{simplified} is like the default except that it removes the +dichotomy between current and future variants by applying uniform +color-coded values. It applies a total of four colors: red, yellow, +green, blue. They produce a simplified consistency graph that is more +legible (or less ``busy'') than the default. The intent is to shift focus +towards the distinction between the four states of a habit task, rather +than each state's present/future outlook. + +Option @code{traffic-light} further reduces the available colors to red, +yellow, and green. As in @code{simplified}, present and future variants +appear uniformly, but differently from it, the 'clear' state is rendered +in a green hue, instead of the original blue. This is meant to capture +the use-case where a habit task being ``too early'' is less important than +it being ``too late''. The difference between ready and clear states is +attenuated by painting both of them using shades of green. This option +thus highlights the alert and overdue states. + +@node Heading styles +@section Option for the headings' overall style + +@vindex modus-themes-headings + +This is defined as an alist and, therefore, uses a different approach +than other customization options documented in this manual. + +Symbol: @code{modus-themes-headings} + +Possible values, which can be specified for each heading level (examples +further below): + +@itemize +@item +nil (default fallback option---covers all heading levels) +@item +@samp{t} (default style for a single heading, when the fallback differs) +@item +@code{no-bold} +@item +@code{line} +@item +@code{line-no-bold} +@item +@code{rainbow} +@item +@code{rainbow-line} +@item +@code{rainbow-line-no-bold} +@item +@code{highlight} +@item +@code{highlight-no-bold} +@item +@code{rainbow-highlight} +@item +@code{rainbow-highlight-no-bold} +@item +@code{section} +@item +@code{section-no-bold} +@item +@code{rainbow-section} +@item +@code{rainbow-section-no-bold} +@item +@code{no-color} +@item +@code{no-color-no-bold} +@end itemize + +To control faces per level from 1-8, use something like this: + +@lisp +(setq modus-themes-headings + '((1 . section) + (2 . section-no-bold) + (3 . rainbow-line) + (t . rainbow-line-no-bold))) +@end lisp + +The above uses the @code{section} value for heading levels 1, +@code{section-no-bold} for headings 2, @code{rainbow-line} for 3. All other +levels fall back to @code{rainbow-line-no-bold}. + +To set a uniform value for all heading levels, use this pattern: + +@lisp +;; A given style for every heading +(setq modus-themes-headings + '((t . section))) + +;; Default aesthetic for every heading +(setq modus-themes-headings + '()) +@end lisp + +The default style for headings uses a fairly desaturated foreground +value in combination with bold typographic weight. To specify this +style for a given level N, assuming you wish to have another fallback +option, just specify the value @samp{t} like this: + +@lisp +(setq modus-themes-headings + '((1 . t) + (2 . line) + (t . rainbow-line-no-bold))) +@end lisp + +A description of all other possible styles beyond the default: + +@itemize +@item +@code{no-bold} retains the default text color while removing the bold +typographic weight. + +@item +@code{line} is the same as the default plus an overline across the +heading's length. + +@item +@code{line-no-bold} is the same as @code{line} without bold weight. + +@item +@code{rainbow} uses a more colorful foreground in combination with bold +typographic weight. + +@item +@code{rainbow-line} is the same as @code{rainbow} plus an overline. + +@item +@code{rainbow-line-no-bold} is the same as @code{rainbow-line} without the bold +weight. + +@item +@code{highlight} retains the default style of a fairly desaturated +foreground combined with a bold weight and adds to it a subtle +accented background. + +@item +@code{highlight-no-bold} is the same as @code{highlight} without a bold weight. + +@item +@code{rainbow-highlight} is the same as @code{highlight} but with a more +colorful foreground. + +@item +@code{rainbow-highlight-no-bold} is the same as @code{rainbow-highlight} without +a bold weight. + +@item +@code{section} retains the default looks and adds to them both an overline +and a slightly accented background. It is, in effect, a combination +of the @code{line} and @code{highlight} values. + +@item +@code{section-no-bold} is the same as @code{section} without a bold weight. + +@item +@code{rainbow-section} is the same as @code{section} but with a more colorful +foreground. + +@item +@code{rainbow-section-no-bold} is the same as @code{rainbow-section} without a +bold weight. + +@item +@code{no-color} does not apply any color to the heading, meaning that it +uses the foreground of the @code{default} face. It still renders the text +with a bold typographic weight. + +@item +@code{no-color-no-bold} is like @code{no-color} but without the bold weight. +@end itemize + +@node Scaled headings +@section Option for scaled headings + +@vindex modus-themes-scale-headings + +Symbol: @code{modus-themes-scale-headings} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default is to use the same size for headings and paragraph text. + +With a non-nil value (@samp{t}) make headings larger in height relative to +the main text. This is noticeable in modes like Org, Markdown, and +Info. + +@menu +* Scaled heading sizes:: Specify rate of increase for scaled headings +@end menu + +@node Scaled heading sizes +@subsection Control the scale of headings + +In addition to the toggle for enabling scaled headings, users can also +specify a number of their own. + +@itemize +@item +If it is a floating point, say, @samp{1.5}, it is interpreted as a multiple +of the base font size. This is the recommended method, because it +will always adapt to changes in the base font size, such as while +using the @code{text-scale-adjust} command. + +@item +If it is an integer, it is read as an absolute font height that is +1/10 of the typographic point size. Thus a value of @samp{18pt} must be +expressed as @samp{180}. Setting an absolute value is discouraged, as it +will break the layout in cases where the base font size must change, +such as with the @code{text-scale-adjust} command (@ref{Font configurations for Org and others (DIY), , Font configurations}). +While we discourage using absolute values, we still provide for this +option for users who do not need to perform text-scaling operations or +who are content with whatever discrepancies in height. +@end itemize + +Below are the variables in their default values, using the floating +point paradigm. The numbers are very conservative, but one is free to +change them to their liking, such as @samp{1.2}, @samp{1.4}, @samp{1.6}, @samp{1.8}, +@samp{2.0}---or use a resource for finding a consistent scale: + +@lisp +(setq modus-themes-scale-1 1.05 + modus-themes-scale-2 1.1 + modus-themes-scale-3 1.15 + modus-themes-scale-4 1.2 + modus-themes-scale-5 1.3) +@end lisp + +As for the application of that scale, the variables that range from +@code{modus-themes-scale-1} up to @code{modus-themes-scale-4} apply to regular +headings within the context of the given major mode. The former is the +smallest, while the latter is the largest. ``Regular headings'' are those +that have a standard syntax for their scale, such as Org mode's eight +levels of asterisks or Markdown's six columns. + +Whereas @code{modus-themes-scale-5} is applied to special headings that do +not conform with the aforementioned syntax, yet which are expected to be +larger than the largest value on that implied scale. Put concretely, +Org's @samp{#+title} meta datum is not part of the eight levels of headings +in an Org file, yet is supposed to signify the primary header. +Similarly, the Org Agenda's structure headings are not part of a +recognisable scale and so they also get @code{modus-themes-scale-5}. + +Users who wish to maintain scaled headings for the normal syntax while +preventing special headings from standing out, can assign a value of +@samp{1.0} to @code{modus-themes-scale-5} to make it the same as body text (or +whatever value would render it indistinguishable from the desired point +of reference). + +Note that in earlier versions of Org, scaling would only increase the +size of the heading, but not of keywords that were added to it, like +``TODO''. The issue has been fixed upstream: +@uref{https://protesilaos.com/codelog/2020-09-24-org-headings-adapt/}. + +@node UI typeface +@section Option for variable-pitch font in UI elements + +@vindex modus-themes-variable-pitch-ui + +Symbol: @code{modus-themes-variable-pitch-ui} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +This option concerns User Interface elements that are under the direct +control of Emacs. In particular: the mode line, header line, tab bar, +and tab line. + +The default is to use the same font as the rest of Emacs, which usually +is a monospaced family. + +With a non-nil value (@samp{t}) apply a proportionately spaced typeface. +This is done by assigning the @code{variable-pitch} face to the relevant +items. + +@ref{Font configurations for Org and others (DIY), , Font configurations for Org and others}. + +@node Headings' typeface +@section Option for variable-pitch font in headings + +@vindex modus-themes-variable-pitch-headings + +Symbol: @code{modus-themes-variable-pitch-headings} + +Possible values: + +@enumerate +@item +@samp{nil} (default) +@item +@samp{t} +@end enumerate + +The default is to use the main font family, which typically is +monospaced. + +With a non-nil value (@samp{t}) apply a proportionately spaced typeface, else +``variable-pitch'', to headings (such as in Org mode). + +@ref{Font configurations for Org and others (DIY), , Font configurations for Org and others}. + +@node Advanced customization (do-it-yourself) +@chapter Advanced customization (do-it-yourself) + +Unlike the predefined customization options which follow a clear pattern +of allowing the user to quickly specify their preference, the themes +also provide a more flexible, albeit difficult, mechanism to control +things with precision (@ref{Customization Options}). + +This section is of interest only to users who are prepared to maintain +their own local tweaks and who are willing to deal with any possible +incompatibilities between versioned releases of the themes. As such, +they are labelled as ``do-it-yourself'' or ``DIY''. + +@menu +* Per-theme customization settings (DIY):: +* Case-by-case face specs using the themes' palette (DIY):: +* Face specs at scale using the themes' palette (DIY):: +* Override colors (DIY):: +* Font configurations for Org and others (DIY):: +* Custom Org user faces (DIY):: +* Measure color contrast (DIY):: +* Load theme depending on time of day:: +* A theme-agnostic hook for theme loading (DIY):: +@end menu + +@node Per-theme customization settings (DIY) +@section Per-theme customization settings (DIY) + +If you prefer to maintain different customization options between the +two themes, it is best you write your own functions that first set those +options and then load the relevant theme. The following code does +exactly that by simply differentiating the two themes on the choice of +bold constructs in code syntax (enabled for one, disabled for the +other). + +@lisp +(defun my-demo-modus-operandi () + (interactive) + (setq modus-themes-bold-constructs t) ; ENABLE bold + (modus-themes-load-operandi)) + +(defun my-demo-modus-vivendi () + (interactive) + (setq modus-themes-bold-constructs nil) ; DISABLE bold + (modus-themes-load-vivendi)) + +(defun my-demo-modus-themes-toggle () + (if (eq (car custom-enabled-themes) 'modus-operandi) + (my-demo-modus-vivendi) + (my-demo-modus-operandi))) +@end lisp + +Then assign @code{my-demo-modus-themes-toggle} to a key instead of the +equivalent the themes provide. + +For a more elaborate design, it is better to inspect the source code of +@code{modus-themes-toggle} and relevant functions. + +@node Case-by-case face specs using the themes' palette (DIY) +@section Case-by-case face specs using the themes' palette (DIY) + +@findex modus-themes-color +@findex modus-themes-color-alts +@cindex Extracting individual colors + +This section is about tweaking individual faces. If you plan to do +things at scale, consult the next section: @ref{Face specs at scale using the themes' palette (DIY), , Set multiple faces}. + +We already covered in previous sections how to toggle between the themes +and how to configure options prior to loading. We also explained that +some of the functions made available to users will fire up a hook that +can be used to pass tweaks in the post-theme-load phase. + +Now assume you wish to change a single face, say, the @code{cursor}. And you +would like to get the standard ``blue'' color value of the active Modus +theme, whether it is Modus Operandi or Modus Vivendi. To do that, you +can use the @code{modus-themes-color} function. It accepts a symbol that is +associated with a color in @code{modus-themes-operandi-colors} and +@code{modus-themes-vivendi-colors}. Like this: + +@lisp +(modus-themes-color 'blue) +@end lisp + +The function always extracts the color value of the active Modus theme. + +@lisp +(progn + (load-theme 'modus-operandi t) + (modus-themes-color 'blue)) ; "#0031a9" for `modus-operandi' + +(progn + (load-theme 'modus-vivendi t) + (modus-themes-color 'blue)) ; "#2fafff" for `modus-vivendi' +@end lisp + +Do @kbd{C-h v} on the aforementioned variables to check all the +available symbols that can be passed to this function. + +With that granted, let us expand the example to actually change the +@code{cursor} face's background property. We employ the built-in function of +@code{set-face-attribute}: + +@lisp +(set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) +@end lisp + +If you evaluate this form, your cursor will become blue. But if you +change themes, such as with @code{modus-themes-toggle}, your edits will be +lost, because the newly loaded theme will override the @samp{:background} +attribute you had assigned to that face. + +For such changes to persist, we need to make them after loading the +theme. So we rely on @code{modus-themes-after-load-theme-hook}, which gets +called from @code{modus-themes-load-operandi}, @code{modus-themes-load-vivendi}, +as well as the command @code{modus-themes-toggle}. Here is a sample function +that tweaks two faces and then gets added to the hook: + +@lisp +(defun my-modus-themes-custom-faces () + (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) + (set-face-attribute 'font-lock-type-face nil :foreground (modus-themes-color 'magenta-alt))) + +(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) +@end lisp + +Using this principle, it is possible to override the styles of faces +without having to find color values for each case. + +Another application is to control the precise weight for bold +constructs. This is particularly useful if your typeface has several +variants such as ``heavy'', ``extrabold'', ``semibold''. All you have to do +is edit the @code{bold} face. For example: + +@lisp +(set-face-attribute 'bold nil :weight 'semibold) +@end lisp + +Remember to use the custom function and hook combo we demonstrated +above. Because the themes do not hard-wire a specific weight, this +simple form is enough to change the weight of all bold constructs +throughout the interface. + +Finally, there are cases where you want to tweak colors though wish to +apply different ones to each theme, say, a blue hue for Modus Operandi +and a shade of red for Modus Vivendi. To this end, we provide +@code{modus-themes-color-alts} as a convenience function to save you from the +trouble of writing separate wrappers for each theme. It still returns a +single value by querying either of @code{modus-themes-operandi-colors} and +@code{modus-themes-vivendi-colors}, only here you pass the two keys you want, +first for @code{modus-operandi} then @code{modus-vivendi}. + +Take the previous example with the @code{cursor} face: + +@lisp +;; Blue for `modus-operandi' and red for `modus-vivendi' +(set-face-attribute 'cursor nil :background (modus-themes-color-alts 'blue 'red)) +@end lisp + +@node Face specs at scale using the themes' palette (DIY) +@section Face specs at scale using the themes' palette (DIY) + +@findex modus-themes-with-colors +@cindex Extracting colors en masse + +The examples here are for large scale operations. For simple, one-off +tweaks, you may prefer the approach documented in the previous section +(@ref{Case-by-case face specs using the themes' palette (DIY), , Case-by-case face specs using the themes' palette}). + +The @code{modus-themes-with-colors} macro lets you retrieve multiple color +values by employing the backquote/backtick and comma notation. The +values are stored in the alists @code{modus-themes-operandi-colors} and +@code{modus-themes-vivendi-colors}, while the macro always queries that of +the active Modus theme. + +Here is an abstract example that just returns a list of color values +while @code{modus-operandi} is enabled: + +@lisp +(modus-themes-with-colors + (list fg-main + blue-faint + magenta + magenta-alt-other + cyan-alt-other + fg-special-cold + blue-alt + magenta-faint + cyan + fg-main + green-faint + red-alt-faint + blue-alt-faint + fg-special-warm + cyan-alt + blue)) +;; => +;; ("#000000" "#002f88" "#721045" "#5317ac" +;; "#005a5f" "#093060" "#2544bb" "#752f50" +;; "#00538b" "#000000" "#104410" "#702f00" +;; "#003f78" "#5d3026" "#30517f" "#0031a9") +@end lisp + +Getting a list of colors may have its applications, though what you are +most likely interested in is how to use those variables to configure +several faces at once. To do so we can rely on the built-in +@code{custom-set-faces} function, which sets face specifications for the +special @samp{user} theme. That ``theme'' gets applied on top of regular +themes like @code{modus-operandi} and @code{modus-vivendi}. + +This is how it works: + +@lisp +(modus-themes-with-colors + (custom-set-faces + `(cursor ((,class :background ,blue))) + `(mode-line ((,class :inherit variable-pitch + :background ,yellow-nuanced-bg + :foreground ,yellow-nuanced-fg))) + `(mode-line-inactive ((,class :inherit variable-pitch + :background ,blue-nuanced-bg + :foreground ,blue-nuanced-fg))) + `(line-number ((,class :background unspecified :foreground ,fg-unfocused))) + `(line-number-current-line ((,class :background unspecified + :foreground ,red-alt-other))))) +@end lisp + +We are showing some uses of @samp{:inherit} and of the special @samp{unspecified} +value so that you can appreciate how a theme can be written. Otherwise +you can identify the color variables by the comma prefixed to them. + +The above snippet will immediately refashion the faces it names once it +is evaluated. However, if you switch themes, say, from @code{modus-operandi} +to @code{modus-vivendi}, the colors will not get updated to match those of +the new theme. To make things work across themes, we need to employ the +same technique we discussed in the previous section, namely, to pass our +changes at the post-theme-load phase via a hook. + +The themes provide the @code{modus-themes-after-load-theme-hook}, which gets +called from @code{modus-themes-load-operandi}, @code{modus-themes-load-vivendi}, +as well as the command @code{modus-themes-toggle}. With this knowledge, you +can wrap the macro in a function and then assign that function to the +hook. Thus: + +@lisp +(defun my-modus-themes-custom-faces () + (modus-themes-with-colors + (custom-set-faces + `(cursor ((,class :background ,blue))) + `(mode-line ((,class :inherit variable-pitch + :background ,yellow-nuanced-bg + :foreground ,yellow-nuanced-fg))) + `(mode-line-inactive ((,class :inherit variable-pitch + :background ,blue-nuanced-bg + :foreground ,blue-nuanced-fg))) + `(line-number ((,class :background unspecified :foreground ,fg-unfocused))) + `(line-number-current-line ((,class :background unspecified + :foreground ,red-alt-other)))))) + +(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) +@end lisp + +To discover the faces defined by all loaded libraries, you may invoke +@kbd{M-x list-faces-display}. Be warned that when you @samp{:inherit} a +face you are introducing an implicit dependency, so try to avoid doing +so for libraries other than the built-in @file{faces.el} (or at +least understand that things may break if you inherit from a +yet-to-be-loaded face). + +Also bear in mind that these examples are meant to work with the Modus +themes. If you are cycling between multiple themes you may encounter +unforeseen issues, such as the colors of the Modus themes being applied +to a non-Modus item. + +Finally, note that you can still use other functions where those make +sense. For example, the @code{modus-themes-color-alts} that was discussed in +the previous section. Adapt the above example like this: + +@lisp +... +(modus-themes-with-colors + (custom-set-faces + `(cursor ((,class :background ,(modus-themes-color-alts 'blue 'green)))) + ...)) +@end lisp + +A complete example with some more opinionated stylistic choices: + +@lisp +(defun my-modus-themes-custom-faces () + (modus-themes-with-colors + (custom-set-faces + `(cursor ((,class :background ,(modus-themes-color-alts 'blue 'green)))) + `(header-line ((,class :inherit variable-pitch))) + `(tab-bar ((,class :inherit variable-pitch))) + `(mode-line + ((,class :inherit variable-pitch + :box ,(modus-themes-color-alts 'yellow-subtle-bg 'magenta-subtle-bg) + :background ,(modus-themes-color-alts 'yellow-nuanced-bg 'magenta-nuanced-bg) + :foreground ,(modus-themes-color-alts 'yellow-nuanced-fg 'magenta-nuanced-fg)))) + `(mode-line-inactive ((,class :inherit variable-pitch))) + `(line-number ((,class :background unspecified :foreground ,fg-unfocused))) + `(line-number-current-line + ((,class :background ,(modus-themes-color-alts 'yellow-nuanced-bg 'magenta-nuanced-bg) + :foreground ,(modus-themes-color-alts 'red-alt 'magenta-alt-other))))))) + +(add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) +@end lisp + +@node Override colors (DIY) +@section Override colors (DIY) + +@vindex modus-themes-operandi-color-overrides +@vindex modus-themes-vivendi-color-overrides +@cindex Change a theme's colors + +The themes provide a mechanism for overriding their color values. This +is controlled by the variables @code{modus-themes-operandi-color-overrides} +and @code{modus-themes-vivendi-color-overrides}, which are alists that should +mirror a subset of the associations in @code{modus-themes-operandi-colors} +and @code{modus-themes-vivendi-colors} respectively. As with all +customisations, overriding must be done before loading the affected +theme. + +Let us approach the present topic one step at a time. Here is a +simplified excerpt of the default palette for Modus Operandi with some +basic background values that apply to buffers and the mode line +(remember to inspect the actual value to find out all the associations +you can override): + +@lisp +(defconst modus-themes-colors-operandi + '((bg-main . "#ffffff") + (bg-dim . "#f8f8f8") + (bg-alt . "#f0f0f0") + (bg-active . "#d7d7d7") + (bg-inactive . "#efefef"))) +@end lisp + +As you can see, we bind a key to a hexadecimal RGB color value. Now say +you wish to override those specific values and have your changes +propagate to all faces that use those keys. You could write something +like this, which adds a subtle ochre tint: + +@lisp +(setq modus-themes-operandi-color-overrides + '((bg-main . "#fefcf4") + (bg-dim . "#faf6ef") + (bg-alt . "#f7efe5") + (bg-active . "#e8dfd1") + (bg-inactive . "#f6ece5"))) +@end lisp + +Once this is evaluated, any subsequent loading of @code{modus-operandi} will +use those values instead of the defaults. No further intervention is +required. + +To reset your changes, apply this and reload the theme: + +@lisp +(setq modus-themes-operandi-color-overrides nil) +@end lisp + +Users who wish to leverage such a mechanism can opt to implement it +on-demand by means of a minor mode. The following snippet covers both +themes and expands to some more assosiations: + +@lisp +(define-minor-mode my-modus-themes-tinted + "Tweak some Modus themes colors." + :init-value nil + :global t + (if my-modus-themes-tinted + (setq modus-themes-operandi-color-overrides + '((bg-main . "#fefcf4") + (bg-dim . "#faf6ef") + (bg-alt . "#f7efe5") + (bg-hl-line . "#f4f0e3") + (bg-active . "#e8dfd1") + (bg-inactive . "#f6ece5") + (bg-region . "#c6bab1") + (bg-header . "#ede3e0") + (bg-tab-bar . "#dcd3d3") + (bg-tab-active . "#fdf6eb") + (bg-tab-inactive . "#c8bab8") + (fg-unfocused . "#55556f")) + modus-themes-vivendi-color-overrides + '((bg-main . "#100b17") + (bg-dim . "#161129") + (bg-alt . "#181732") + (bg-hl-line . "#191628") + (bg-active . "#282e46") + (bg-inactive . "#1a1e39") + (bg-region . "#393a53") + (bg-header . "#202037") + (bg-tab-bar . "#262b41") + (bg-tab-active . "#120f18") + (bg-tab-inactive . "#3a3a5a") + (fg-unfocused . "#9a9aab"))) + (setq modus-themes-operandi-color-overrides nil + modus-themes-vivendi-color-overrides nil))) +@end lisp + +With this in place, one can invoke @kbd{M-x my-modus-themes-tinted} +and then load the Modus theme of their choice. The new colors will come +into effect. Switching between the themes will also use the overrides. + +Given that this is a user-level customisation, one is free to implement +whatever color values they desire, even if the possible combinations +fall below the minimum 7:1 contrast ratio that governs the design of the +themes (the WCAG AAA legibility standard). Preferences aside, it is +advised to inspect the source code of @code{modus-themes-operandi-colors} and +@code{modus-themes-vivendi-colors} to read the inline commentary: it explains +what the intended use of each subset is. + +Furthermore, users may benefit from the @code{modus-themes-contrast} function +that we provide: @ref{Measure color contrast (DIY), , test color combinations}. It measures the contrast +ratio between two color values, so it can help in overriding the palette +(or a subset thereof) without making the end result inaccessible. + +@node Font configurations for Org and others (DIY) +@section Font configurations for Org and others (DIY) + +@cindex Font configurations + +The themes are designed to cope well with mixed font configurations. + +@ref{No mixed fonts, , Option for no font mixing}. + +This mostly concerns @code{org-mode} and @code{markdown-mode}, though expect to +find it elsewhere like in @code{Info-mode}. + +In practice it means that the user can safely opt for a more +prose-friendly proportionately spaced typeface as their default, while +letting spacing-sensitive elements like tables and inline code always +use a monospaced font, by inheriting from the @code{fixed-pitch} face. + +Users can try the built-in @kbd{M-x variable-pitch-mode} to see the +effect in action. + +To make everything use your desired font families, you need to configure +the @code{variable-pitch} (proportional spacing) and @code{fixed-pitch} +(monospaced) faces respectively. It may also be convenient to set your +main typeface by configuring the @code{default} face the same way. + +Put something like this in your initialization file (also consider +reading the doc string of @code{set-face-attribute}): + +@lisp +;; Main typeface +(set-face-attribute 'default nil :family "DejaVu Sans Mono" :height 110) + +;; Proportionately spaced typeface +(set-face-attribute 'variable-pitch nil :family "DejaVu Serif" :height 1.0) + +;; Monospaced typeface +(set-face-attribute 'fixed-pitch nil :family "DejaVu Sans Mono" :height 1.0) +@end lisp + +Note the differences in the @samp{:height} property. The @samp{default} face must +specify an absolute value, which is the point size × 10. So if you want +to use a font at point size @samp{11}, you set the height to @samp{110}.@footnote{@samp{:height} values do not need to be rounded to multiples of ten: the +likes of @samp{115} are perfectly valid—some typefaces will change to account +for those finer increments.} Whereas every other face must have a value +that is relative to the default, represented as a floating point (if you +use an integer, then that means an absolute height). This is of +paramount importance: it ensures that all fonts can scale gracefully +when using something like the @code{text-scale-adjust} command which only +operates on the base font size (i.e. the @code{default} face's absolute +height). + +@node Custom Org user faces (DIY) +@section Custom Org user faces (DIY) + +@cindex Org extra faces + +Users of @code{org-mode} have the option to configure various keywords and +priority cookies to better match their workflow. User options are +@code{org-todo-keyword-faces} and @code{org-priority-faces}. + +As those are meant to be custom faces, it is futile to have the themes +guess what each user wants to use, which keywords to target, and so on. +Instead, we can provide guidelines on how to customize things to one's +liking with the intent of retaining the overall aesthetic of the themes. + +Please bear in mind that the end result of those is not controlled by +the active Modus theme but by how Org maps faces to its constructs. +Editing those while @code{org-mode} is active requires re-initialization of +the mode with @kbd{M-x org-mode-restart} for changes to take +effect. + +Let us assume you wish to visually differentiate your keywords. You +have something like this: + +@lisp +(setq org-todo-keywords + '((sequence "TODO(t)" "|" "DONE(D)" "CANCEL(C)") + (sequence "MEET(m)" "|" "MET(M)") + (sequence "STUDY(s)" "|" "STUDIED(S)") + (sequence "WRITE(w)" "|" "WROTE(W)"))) +@end lisp + +You could then use a variant of the following to inherit from a face +that uses the styles you want and also to preserve the properties +applied by the @code{org-todo} face: + +@lisp +(setq org-todo-keyword-faces + '(("MEET" . '(font-lock-preprocessor-face org-todo)) + ("STUDY" . '(font-lock-variable-name-face org-todo)) + ("WRITE" . '(font-lock-type-face org-todo)))) +@end lisp + +This will refashion the keywords you specify, while letting the other +items in @code{org-todo-keywords} use their original styles (which are +defined in the @code{org-todo} and @code{org-done} faces). + +If you want back the defaults, try specifying just the @code{org-todo} face: + +@lisp +(setq org-todo-keyword-faces + '(("MEET" . org-todo) + ("STUDY" . org-todo) + ("WRITE" . org-todo))) +@end lisp + +When you inherit from multiple faces, you need to quote the list as +shown further above. The order is important: the last item is applied +over the previous ones. If you do not want to blend multiple faces, you +do not need a quoted list. A pattern of @samp{keyword . face} will suffice. + +Both approaches can be used simultaneously, as illustrated in this +configuration of the priority cookies: + +@lisp +(setq org-priority-faces + '((?A . '(org-scheduled-today org-priority)) + (?B . org-priority) + (?C . '(shadow org-priority)))) +@end lisp + +To find all the faces that are loaded in your current Emacs session, use +@kbd{M-x list-faces-display}. Try @kbd{M-x describe-variable} +as well and then specify the name of each of those Org variables +demonstrated above. Their documentation strings will offer you further +guidance. + +Recall that the themes let you retrieve a color from their palette. Do +it if you plan to control face attributes. + +@ref{Case-by-case face specs using the themes' palette (DIY), , Custom face specs using the themes' palette}. + +@ref{Measure color contrast (DIY), , Check color combinations}. + +@node Measure color contrast (DIY) +@section Measure color contrast (DIY) + +@findex modus-themes-contrast +@findex modus-themes-wcag-formula +@cindex Color contrast + +The themes provide the functions @code{modus-themes-wcag-formula} and +@code{modus-themes-contrast}. The former is a direct implementation of the +WCAG formula: @uref{https://www.w3.org/TR/WCAG20-TECHS/G18.html}. It +calculates the relative luminance of a color value that is expressed in +hexadecimal RGB notation. While the latter function is just a +convenient wrapper for comparing the relative luminance between two +colors. + +In practice, one needs to work only with @code{modus-themes-contrast}. It +accepts two color values and returns their contrast ratio. Values range +from 1 to 21 (lowest to highest). The themes are designed to always be +equal or higher than 7 for each combination of background and foreground +that they use (this is the WCAG AAA standard---the most demanding of its +kind). + +A couple of examples (rounded numbers): + +@lisp +;; Pure white with pure green +(modus-themes-contrast "#ffffff" "#00ff00") +;; => 1.37 +;; That is an outright inaccessible combo + +;; Pure black with pure green +(modus-themes-contrast "#000000" "#00ff00") +;; => 15.3 +;; That is is a highly accessible combo +@end lisp + +It does not matter which color value comes first. The ratio is always +the same. + +If one does not wish to read all the decimal points, it is possible to +try something like this: + +@lisp +(format "%0.2f" (modus-themes-contrast "#000000" "#00ff00")) +@end lisp + +While it is fine to perform such calculations on a case-by-case basis, +it is preferable to implement formulas and tables for more demanding +tasks. Such instruments are provided by @code{org-mode} or @code{orgtbl-mode}, +both of which are built into Emacs. Below is such a table that derives +the contrast ratio of all colors in the first column (pure red, green, +blue) relative to the color specified in the first row of the second +column (pure white) and rounds the results: + +@example +| | #ffffff | +|---------+---------| +| #ff0000 | 4.00 | +| #00ff00 | 1.37 | +| #0000ff | 8.59 | +#+TBLFM: $2='(modus-themes-contrast $1 @@1$2);%0.2f +@end example + +To measure color contrast one needs to start from a known value. This +typically is the background. The Modus themes define an expanded +palette in large part because certain colors are only meant to be used +in combination with some others. Consult the source code for the +minutia and relevant commentary. + +Such knowledge may prove valuable while attempting to override some of +the themes' colors: @ref{Override colors (DIY), , Override colors}. + +@node Load theme depending on time of day +@section Load theme depending on time of day + +While we do provide @code{modus-themes-toggle} to manually switch between the +themes, users may also set up their system to perform such a task +automatically at sunrise and sunset. + +This can be accomplished by specifying the coordinates of one's location +using the built-in @file{solar.el} and then configuring the +@samp{circadian} package: + +@lisp +(use-package solar ; built-in + :config + (setq calendar-latitude 35.17 + calendar-longitude 33.36)) + +(use-package circadian ; you need to install this + :ensure + :after solar + (setq circadian-themes '((:sunrise . modus-operandi) + (:sunset . modus-vivendi))) + (circadian-setup)) +@end lisp + +@node A theme-agnostic hook for theme loading (DIY) +@section A theme-agnostic hook for theme loading (DIY) + +The themes are designed with the intent to be useful to Emacs users of +varying skill levels, from beginners to experts. This means that we try +to make things easier by not expecting anyone reading this document to +be proficient in Emacs Lisp or programming in general. + +Such a case is with the use of the @code{modus-themes-after-load-theme-hook}, +which runs after @code{modus-themes-toggle}, @code{modus-themes-load-operandi}, or +@code{modus-themes-load-vivendi} is evaluated. We recommend using that hook +for advanced customizations, because (1) we know for sure that it is +available once the themes are loaded, and (2) anyone consulting this +manual, especially the sections on enabling and loading the themes, will +be in a good position to benefit from that hook. + +Advanced users who have a need to switch between the Modus themes and +other items will find that such a hook does not meet their requirements: +it only works with the Modus themes and only with the aforementioned +functions. + +A theme-agnostic setup can be configured thus: + +@lisp +(defvar after-enable-theme-hook nil + "Normal hook run after enabling a theme.") + +(define-advice enable-theme (:after (&rest _args) run-after-enable-theme-hook) + "Run `after-enable-theme-hook'." + (run-hooks 'after-enable-theme-hook)) +@end lisp + +This creates the @code{after-enable-theme-hook} and makes it run after each +call to @code{enable-theme}, which means that it will work for all themes and +also has the benefit that it does not depend on functions such as +@code{modus-themes-toggle} and the others mentioned above. @code{enable-theme} is +called internally by @code{load-theme}, so the hook works everywhere. + +Now this specific piece of Elisp may be simple for experienced users, +but it is not easy to read for newcomers, including the author of the +Modus themes for the first several months of their time as an Emacs +user. Hence our hesitation to recommend it as part of the standard +setup of the Modus themes (it is generally a good idea to understand +what the implications are of advising a function). + +@node Face coverage +@chapter Face coverage + +The Modus themes try to provide as close to full face coverage as +possible. This is necessary to ensure a consistently accessible reading +experience across all available interfaces. + +@menu +* Supported packages:: Full list of covered face groups +* Indirectly covered packages:: +@end menu + +@node Supported packages +@section Full support for packages or face groups + +@cindex Explicitly supported packages + +This list will always be updated to reflect the current state of the +project. The idea is to offer an overview of the known status of all +affected face groups. The items with an appended asterisk @samp{*} tend to +have lots of extensions, so the ``full support'' may not be 100% true… + +@itemize +@item +ace-window +@item +ag +@item +alert +@item +all-the-icons +@item +annotate +@item +anzu +@item +apropos +@item +apt-sources-list +@item +artbollocks-mode +@item +auctex and @TeX{} +@item +auto-dim-other-buffers +@item +avy +@item +awesome-tray +@item +bbdb +@item +binder +@item +bm +@item +bongo +@item +boon +@item +breakpoint (provided by the built-in @file{gdb-mi.el} library) +@item +buffer-expose +@item +calendar and diary +@item +calfw +@item +centaur-tabs +@item +cfrs +@item +change-log and log-view (such as @code{vc-print-log}, @code{vc-print-root-log}) +@item +cider +@item +circe +@item +color-rg +@item +column-enforce-mode +@item +company-mode* +@item +company-posframe +@item +compilation-mode +@item +completions +@item +consult +@item +counsel* +@item +counsel-css +@item +counsel-notmuch +@item +counsel-org-capture-string +@item +cov +@item +cperl-mode +@item +csv-mode +@item +ctrlf +@item +custom (what you get with @kbd{M-x customize}) +@item +dap-mode +@item +dashboard (emacs-dashboard) +@item +deadgrep +@item +debbugs +@item +define-word +@item +deft +@item +dictionary +@item +diff-hl +@item +diff-mode +@item +dim-autoload +@item +dir-treeview +@item +dired +@item +dired-async +@item +dired-git +@item +dired-git-info +@item +dired-narrow +@item +dired-subtree +@item +diredc +@item +diredfl +@item +diredp (dired+) +@item +disk-usage +@item +display-fill-column-indicator-mode +@item +doom-modeline +@item +dynamic-ruler +@item +easy-jekyll +@item +easy-kill +@item +ebdb +@item +ediff +@item +eglot +@item +el-search +@item +eldoc-box +@item +elfeed +@item +elfeed-score +@item +emms +@item +enhanced-ruby-mode +@item +epa +@item +equake +@item +erc +@item +eros +@item +ert +@item +eshell +@item +eshell-fringe-status +@item +eshell-git-prompt +@item +eshell-prompt-extras (epe) +@item +eshell-syntax-highlighting +@item +evil* (evil-mode) +@item +evil-goggles +@item +evil-snipe +@item +evil-visual-mark-mode +@item +eww +@item +exwm +@item +eyebrowse +@item +fancy-dabbrev +@item +flycheck +@item +flycheck-color-mode-line +@item +flycheck-indicator +@item +flycheck-posframe +@item +flymake +@item +flyspell +@item +flyspell-correct +@item +flx +@item +freeze-it +@item +frog-menu +@item +focus +@item +fold-this +@item +font-lock (generic syntax highlighting) +@item +forge +@item +fountain (fountain-mode) +@item +geiser +@item +git-commit +@item +git-gutter (and variants) +@item +git-lens +@item +git-rebase +@item +git-timemachine +@item +git-walktree +@item +gnus +@item +golden-ratio-scroll-screen +@item +helm* +@item +helm-ls-git +@item +helm-switch-shell +@item +helm-xref +@item +helpful +@item +highlight-blocks +@item +highlight-defined +@item +highlight-escape-sequences (@code{hes-mode}) +@item +highlight-indentation +@item +highlight-numbers +@item +highlight-symbol +@item +highlight-tail +@item +highlight-thing +@item +hl-defined +@item +hl-fill-column +@item +hl-line-mode +@item +hl-todo +@item +hydra +@item +hyperlist +@item +ibuffer +@item +icomplete +@item +icomplete-vertical +@item +ido-mode +@item +iedit +@item +iflipb +@item +imenu-list +@item +indium +@item +info +@item +info-colors +@item +interaction-log +@item +ioccur +@item +isearch, occur, etc. +@item +isl (isearch-light) +@item +ivy* +@item +ivy-posframe +@item +jira (org-jira) +@item +journalctl-mode +@item +js2-mode +@item +julia +@item +jupyter +@item +kaocha-runner +@item +keycast +@item +line numbers (@code{display-line-numbers-mode} and global variant) +@item +lsp-mode +@item +lsp-ui +@item +macrostep +@item +magit +@item +magit-imerge +@item +make-mode +@item +man +@item +marginalia +@item +markdown-mode +@item +markup-faces (@code{adoc-mode}) +@item +mentor +@item +messages +@item +minibuffer-line +@item +minimap +@item +modeline +@item +mood-line +@item +moody +@item +mpdel +@item +mu4e +@item +mu4e-conversation +@item +multiple-cursors +@item +neotree +@item +no-emoji +@item +notmuch +@item +num3-mode +@item +nxml-mode +@item +objed +@item +orderless +@item +org* +@item +org-journal +@item +org-noter +@item +org-pomodoro +@item +org-recur +@item +org-roam +@item +org-superstar +@item +org-table-sticky-header +@item +org-tree-slide +@item +org-treescope +@item +origami +@item +outline-mode +@item +outline-minor-faces +@item +package (what you get with @kbd{M-x list-packages}) +@item +page-break-lines +@item +paradox +@item +paren-face +@item +parrot +@item +pass +@item +pdf-tools +@item +persp-mode +@item +perspective +@item +phi-grep +@item +phi-search +@item +pkgbuild-mode +@item +pomidor +@item +popup +@item +powerline +@item +powerline-evil +@item +prism (@ref{Note for prism, , Note for prism.el}) +@item +proced +@item +prodigy +@item +quick-peek (Part of 1.2.0-dev) +@item +racket-mode +@item +rainbow-blocks +@item +rainbow-identifiers +@item +rainbow-delimiters +@item +rcirc +@item +recursion-indicator +@item +regexp-builder (also known as @code{re-builder}) +@item +rg (rg.el) +@item +ripgrep +@item +rmail +@item +ruler-mode +@item +sallet +@item +selectrum +@item +selectrum-prescient (Part of 1.2.0-dev) +@item +semantic +@item +sesman +@item +shell-script-mode +@item +show-paren-mode +@item +shr +@item +side-notes +@item +sieve-mode +@item +skewer-mode +@item +smart-mode-line +@item +smartparens +@item +smerge +@item +solaire +@item +spaceline +@item +speedbar +@item +spell-fu +@item +stripes +@item +suggest +@item +switch-window +@item +swiper +@item +swoop +@item +sx +@item +symbol-overlay +@item +syslog-mode +@item +table (built-in table.el) +@item +telephone-line +@item +terraform-mode +@item +term +@item +tomatinho +@item +transient (pop-up windows such as Magit's) +@item +trashed +@item +treemacs +@item +tty-menu +@item +tuareg +@item +typescript +@item +undo-tree +@item +vc (built-in mode line status for version control) +@item +vc-annotate (the out put of @kbd{C-x v g}) +@item +vdiff +@item +vimish-fold +@item +visible-mark +@item +visual-regexp +@item +volatile-highlights +@item +vterm +@item +wcheck-mode +@item +web-mode +@item +wgrep +@item +which-function-mode +@item +which-key +@item +whitespace-mode +@item +window-divider-mode +@item +winum +@item +writegood-mode +@item +woman +@item +xah-elisp-mode +@item +xref +@item +xterm-color (and ansi-colors) +@item +yaml-mode +@item +yasnippet +@item +ztree +@end itemize + +Plus many other miscellaneous faces that are provided by the upstream +GNU Emacs distribution. + +@node Indirectly covered packages +@section Indirectly covered packages + +@cindex Implicitly supported packages + +These do not require any extra styles because they are configured to +inherit from some basic faces. Please confirm. + +@itemize +@item +edit-indirect +@item +evil-owl +@item +fortran-mode +@item +goggles +@item +i3wm-config-mode +@item +perl-mode +@item +php-mode +@item +rjsx-mode +@item +swift-mode +@item +tab-bar-echo-area +@end itemize + +@node Notes for individual packages +@chapter Notes for individual packages + +This section covers information that may be of interest to users of +individual packages. + +@menu +* Note for display-fill-column-indicator-mode:: +* Note for prism:: +* Note on company-mode overlay pop-up:: +* Note for ERC escaped color sequences:: +* Note for powerline or spaceline:: +* Note on SHR colors:: +* Note for Helm grep:: +* Note on vc-annotate-background-mode:: +* Note on pdf-tools link hints:: +@end menu + +@node Note for display-fill-column-indicator-mode +@section Note for display-fill-column-indicator-mode + +While designing the style for @code{display-fill-column-indicator-mode}, we +stayed close to the mode's defaults: to apply a subtle foreground color +to the @code{fill-column-indicator} face, which blends well with the rest of +theme and is consistent with the role of that mode. This is to not +upset the expectations of users. + +Nevertheless, @code{display-fill-column-indicator-mode} has some known +limitations pertaining to its choice of using typographic characters to +draw its indicator. What should be a continuous vertical line might +appear as a series of dashes in certain contexts or under specific +conditions: a non-default value for @code{line-spacing}, scaled and/or +variable-pitch headings have been observed to cause this effect. + +Given that we cannot control such factors, it may be better for affected +users to deviate from the default style of the @code{fill-column-indicator} +face. Instead of setting a foreground color, one could use a background +and have the foreground be indistinguishable from it. For example: + +@lisp +(modus-themes-with-colors + (custom-set-faces + `(fill-column-indicator ((,class :background ,bg-inactive + :foreground ,bg-inactive))))) +@end lisp + +@ref{Face specs at scale using the themes' palette (DIY), , Face specs at scale using the themes' palette}. + +@node Note for prism +@section Note for prism.el + +This package by Adam Porter, aka ``alphapapa'' or ``github-alphapapa'', +implements an alternative to the typical coloration of code. Instead of +highligting the syntactic constructs, it applies color to different +levels of depth in the code. + +As @file{prism.el} is highly configurable, we cannot style it +directly at the theme level. Instead, we may offer sample presets. +Those should offer a starting point for users to adapt to their needs. + +In the following code snippets, we employ the @code{modus-themes-with-colors} +macro: @ref{Face specs at scale using the themes' palette (DIY), , Face specs at scale using the themes' palette}. + +With 16 colors: + +@lisp +(setq prism-num-faces 16) + +(prism-set-colors + :desaturations '(0) ; may lower the contrast ratio + :lightens '(0) ; same + :colors (modus-themes-with-colors + (list fg-main + magenta + cyan-alt-other + magenta-alt-other + blue + magenta-alt + cyan-alt + red-alt-other + green + fg-main + cyan + yellow + blue-alt + red-alt + green-alt-other + fg-special-warm))) +@end lisp + +With 8 colors: + +@lisp +(setq prism-num-faces 8) + +(prism-set-colors + :desaturations '(0) ; may lower the contrast ratio + :lightens '(0) ; same + :colors (modus-themes-with-colors + (list fg-special-cold + magenta + magenta-alt-other + cyan-alt-other + fg-main + blue-alt + red-alt-other + cyan))) +@end lisp + +With 4 colors (the closest to the themes' default): + +@lisp +(setq prism-num-faces 4) + +(prism-set-colors + :desaturations '(0) ; may lower the contrast ratio + :lightens '(0) ; same + :colors (modus-themes-with-colors + (list fg-main + cyan-alt-other + magenta-alt-other + magenta))) +@end lisp + +If you need to apply desaturation and ligthening, you can use what the +prism.el documentation recommends, like this: + +@lisp +(prism-set-colors + :desaturations (cl-loop for i from 0 below 16 collect (* i 2.5)) + :lightens (cl-loop for i from 0 below 16 collect (* i 2.5)) + :colors (modus-themes-with-colors + (list fg-main + cyan-alt-other + magenta-alt-other + magenta))) +@end lisp + +@node Note on company-mode overlay pop-up +@section Note on company-mode overlay pop-up + +By default, the @code{company-mode} pop-up that lists completion candidates +is drawn using an overlay. This creates alignment issues every time it +is placed above a piece of text that has a different height than the +default. + +The solution recommended by the project's maintainer is to use an +alternative front-end for drawing the pop-up which draws child frames +instead of overlays.@footnote{@uref{https://github.com/company-mode/company-mode/issues/1010}}@footnote{@uref{https://github.com/tumashu/company-posframe/}} + +@node Note for ERC escaped color sequences +@section Note for ERC escaped color sequences + +The built-in IRC client @code{erc} has the ability to colorise any text using +escape sequences that start with @samp{^C} (inserted with @kbd{C-q C-c}) +and are followed by a number for the foreground and background.@footnote{This page explains the basics, though it is not specific to Emacs: +@uref{https://www.mirc.com/colors.html}} Possible numbers are 0-15, with the +first entry being the foreground and the second the background, +separated by a comma. Like this @samp{^C1,6}. The minimum setup is this: + +@lisp +(add-to-list 'erc-modules 'irccontrols) +(setq erc-interpret-controls-p t + erc-interpret-mirc-color t) +@end lisp + +As this allows users the chance to make arbitrary combinations, it is +impossible to guarantee a consistently high contrast ratio. All we can +we do is provide guidance on the combinations that satisfy the +accessibility standard of the themes: + +@table @asis +@item Modus Operandi +Use foreground color 1 for all backgrounds from +2-15. Like so: @kbd{C-q C-c1} where @samp{N} is the background. + +@item Modus Vivendi +Use foreground color 0 for all backgrounds from +2-13. Use foreground @samp{1} for backgrounds 14, 15. +@end table + +Colors 0 and 1 are white and black respectively. So combine them +together, if you must. + +@node Note for powerline or spaceline +@section Note for powerline or spaceline + +Both Powerline and Spaceline package users will likely need to use the +command @code{powerline-reset} whenever they make changes to their themes +and/or modeline setup. + +@node Note on SHR colors +@section Note on SHR colors + +Emacs' HTML rendering library (@file{shr.el}) may need explicit +configuration to respect the theme's colors instead of whatever +specifications the webpage provides. + +Consult @kbd{C-h v shr-use-colors}. + +@node Note for Helm grep +@section Note for Helm grep + +There is one face from the Helm package that is meant to highlight the +matches of a grep or grep-like command (@samp{ag} or @samp{ripgrep}). It is +@code{helm-grep-match}. However, this face can only apply when the user does +not pass @samp{--color=always} as a command-line option for their command. + +Here is the docstring for that face, which is defined in the +@file{helm-grep.el} library (you can visit the source code with +@kbd{M-x find-library}). + +@quotation +Face used to highlight grep matches. Have no effect when grep backend +use ``--color='' + +@end quotation + +The user must either remove @samp{--color} from the flags passed to the grep +function, or explicitly use @samp{--color=never} (or equivalent). Helm +provides user-facing customization options for controlling the grep +function's parameters, such as @code{helm-grep-default-command} and +@code{helm-grep-git-grep-command}. + +When @samp{--color=always} is in effect, the grep output will use red text in +bold letter forms to present the matching part in the list of +candidates. That style still meets the contrast ratio target of >= 7:1 +(accessibility standard WCAG AAA), because it draws the reference to +ANSI color number 1 (red) from the already-supported array of +@code{ansi-color-names-vector}. + +@node Note on vc-annotate-background-mode +@section Note on vc-annotate-background-mode + +Due to the unique way @code{vc-annotate} (@kbd{C-x v g}) applies colors, +support for its background mode (@code{vc-annotate-background-mode}) is +disabled at the theme level. + +Normally, such a drastic measure should not belong in a theme: assuming +the user's preferences is bad practice. However, it has been deemed +necessary in the interest of preserving color contrast accessibility +while still supporting a useful built-in tool. + +If there actually is a way to avoid such a course of action, without +prejudice to the accessibility standard of this project, then please +report as much or send patches (@ref{Contributing}). + +@node Note on pdf-tools link hints +@section Note on pdf-tools link hints + +Hints are drawn by @uref{https://imagemagick.org/, ImageMagick}, not Emacs, i.e., ImageMagick doesn't +know about the hint face unless you tell ImageMagick about it. By +default, only the foreground and background color attributes are +passed. The below snippet adds to those the various font attributes. +As it queries various faces, specifically @code{pdf-links-read-link} and the +faces it inherits, it needs to be added to your initialization file +after you've customized any faces. + +@lisp +(use-package pdf-links + :config + (let ((spec + (apply #'append + (mapcar + (lambda (name) + (list name + (face-attribute 'pdf-links-read-link + name nil 'default))) + '(:family :width :weight :slant))))) + (setq pdf-links-read-link-convert-commands + `("-density" "96" + "-family" ,(plist-get spec :family) + "-stretch" ,(let* ((width (plist-get spec :width)) + (name (symbol-name width))) + (replace-regexp-in-string "-" "" + (capitalize name))) + "-weight" ,(pcase (plist-get spec :weight) + ('ultra-light "Thin") + ('extra-light "ExtraLight") + ('light "Light") + ('semi-bold "SemiBold") + ('bold "Bold") + ('extra-bold "ExtraBold") + ('ultra-bold "Black") + (_weight "Normal")) + "-style" ,(pcase (plist-get spec :slant) + ('italic "Italic") + ('oblique "Oblique") + (_slant "Normal")) + "-pointsize" "%P" + "-undercolor" "%f" + "-fill" "%b" + "-draw" "text %X,%Y '%c'")))) +@end lisp + +@node Contributing +@chapter Contributing + +This section documents the canonical sources of the themes and the ways +in which you can contribute to their ongoing development. + +@menu +* Sources of the themes:: +* Issues you can help with:: +* Patches require copyright assignment to the FSF:: +@end menu + +@node Sources of the themes +@section Sources of the themes + +@cindex Sources of the themes + +The @code{modus-operandi} and @code{modus-vivendi} themes are built into Emacs. +Currently they are in Emacs' git main branch (trunk), which is tracking +the next development release target. + +The source code of the themes is @uref{https://gitlab.com/protesilaos/modus-themes/, available on Gitlab}, for the time +being. A @uref{https://github.com/protesilaos/modus-themes/, mirror on Github} is also on offer. + +An HTML version of this manual is provided as an extension of the +@uref{https://protesilaos.com/modus-themes/, author's personal website} (does not rely on any non-free code). + +@node Issues you can help with +@section Issues you can help with + +@cindex Contributing + +A few tasks you can help with: + +@itemize +@item +Suggest refinements to packages that are covered. +@item +Report packages not covered thus far. +@item +Report bugs, inconsistencies, shortcomings. +@item +Help expand the documentation of covered-but-not-styled packages. +@item +Suggest refinements to the color palette. +@item +Help expand this document or any other piece of documentation. +@item +Merge requests for code refinements. +@end itemize + +@ref{Patches require copyright assignment to the FSF}. + +It is preferable that your feedback includes some screenshots, GIFs, or +short videos, as well as further instructions to reproduce a given +setup. Though this is not a requirement. + +Whatever you do, bear in mind the overarching objective of the Modus +themes: to keep a contrast ratio that is greater or equal to 7:1 between +background and foreground colors. If a compromise is ever necessary +between aesthetics and accessibility, it shall always be made in the +interest of the latter. + +@node Patches require copyright assignment to the FSF +@section Patches require copyright assignment to the FSF + +Code contributions are most welcome. For any major edit (more than 15 +lines, or so, in aggregate per person), you need to make a copyright +assignment to the Free Software Foundation. This is necessary because +the themes are part of the upstream Emacs distribution: the FSF must at +all times be in a position to enforce the GNU General Public License. + +Copyright assignment is a simple process. Check the request form below +(please adapt it accordingly). You must write an email to the address +mentioned in the form and then wait for the FSF to send you a legal +agreement. Sign the document and file it back to them. This could all +happen via email and take about a week. You are encouraged to go +through this process. You only need to do it once. It will allow you +to make contributions to Emacs in general. + +@example +Please email the following information to assign@@gnu.org, and we +will send you the assignment form for your past and future changes. + +Please use your full legal name (in ASCII characters) as the subject +line of the message. +---------------------------------------------------------------------- +REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES + +[What is the name of the program or package you're contributing to?] + +GNU Emacs + +[Did you copy any files or text written by someone else in these changes? +Even if that material is free software, we need to know about it.] + +Copied a few snippets from the same files I edited. Their author, +Protesilaos Stavrou, has already assigned copyright to the Free Software +Foundation. + +[Do you have an employer who might have a basis to claim to own +your changes? Do you attend a school which might make such a claim?] + + +[For the copyright registration, what country are you a citizen of?] + + +[What year were you born?] + + +[Please write your email address here.] + + +[Please write your postal address here.] + + + + + +[Which files have you changed so far, and which new files have you written +so far?] + +@end example + +@node Acknowledgements +@chapter Acknowledgements + +@cindex Contributors + +The Modus themes are a collective effort. Every bit of work matters. + +@table @asis +@item Author/maintainer +Protesilaos Stavrou. + +@item Contributions to code or documentation +Anders Johansson, Basil +L@. Contovounesios, Carlo Zancanaro, Eli Zaretskii, Kostadin Ninev, +Madhavan Krishnan, Markus Beppler, Matthew Stevenson, Nicolas De +Jaeghere, Shreyas Ragavan, Stefan Kangas, Vincent Murphy, Xinglu Chen. + +@item Ideas and user feedback +Aaron Jensen, Adam Spiers, Adrian Manea, +Alex Griffin, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders +Johansson, André Alexandre Gomes, Arif Rezai, Basil L@. Contovounesios, +Burgess Chang, Christian Tietze, Christopher Dimech, Damien Cassou, +Daniel Mendler, Dario Gjorgjevski, David Edmondson, Davor Rotim, Divan +Santana, Gerry Agbobada, Gianluca Recchia, Gustavo Barros, Hörmetjan +Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, John Haman, Kevin +Fleming, Kostadin Ninev, Len Trigg, Manuel Uberti, Mark Burton, Markus +Beppler, Michael Goldenberg, Morgan Smith, Murilo Pereira, Nicolas De +Jaeghere, Paul Poloskov, Pete Kazmier, Peter Wu, Philip K., Pierre +Téchoueyres, Roman Rudakov, Ryan Phillips, Shreyas Ragavan, Simon +Pugnet, Tassilo Horn, Thibaut Verron, Trey Merkley, Togan Muftuoglu, +Toon Claes, Uri Sharf, Utkarsh Singh, Vincent Foley. As well as +users: Ben, CsBigDataHub1, Emacs Contrib, Eugene, Fourchaux, Fredrik, +Moesasji, Nick, TheBlob42, bepolymathe, doolio, fleimgruber, iSeeU, +jixiuf, okamsn, tycho garen. + +@item Packaging +André Alexandre Gomes, Dimakakos Dimos, Morgan Smith, +Nicolas Goaziou (Guix), Dhavan Vaidya (Debian), Stefan Kangas (core +Emacs), Stefan Monnier (GNU Elpa). + +@item Inspiration for certain features +Bozhidar Batsov (zenburn-theme), +Fabrice Niessen (leuven-theme). +@end table + +Special thanks, in no particular order, to Manuel Uberti and Omar +Antolín Camarena for their long time contributions and insightful +commentary. + +@node Meta +@chapter Meta + +@cindex Development notes + +If you are curious about the principles that govern the development of +this project read the essay @uref{https://protesilaos.com/codelog/2020-03-17-design-modus-themes-emacs/, On the design of the Modus themes} +(2020-03-17). + +Here are some more publications for those interested in the kind of work +that goes into this project (sometimes the commits also include details +of this sort): + +@itemize +@item +@uref{https://protesilaos.com/codelog/2020-05-10-modus-operandi-palette-review/, Modus Operandi theme subtle palette review} (2020-05-10) +@item +@uref{https://protesilaos.com/codelog/2020-06-13-modus-vivendi-palette-review/, Modus Vivendi theme subtle palette review} (2020-06-13) +@item +@uref{https://protesilaos.com/codelog/2020-07-04-modus-themes-faint-colours/, Modus themes: new ``faint syntax'' option} (2020-07-04) +@item +@uref{https://protesilaos.com/codelog/2020-07-08-modus-themes-nuanced-colours/, Modus themes: major review of ``nuanced'' colours} (2020-07-08) +@item +@uref{https://protesilaos.com/codelog/2020-09-14-modus-themes-review-blues/, Modus themes: review of blue colours} (2020-09-14) +@item +@uref{https://protesilaos.com/codelog/2020-12-27-modus-themes-review-rainbow-delimiters/, Modus themes: review rainbow-delimiters faces} (2020-12-27) +@item +@uref{https://protesilaos.com/codelog/2021-01-11-modus-themes-review-select-faint-colours/, Modus themes: review of select ``faint'' colours} (2021-01-11) +@end itemize + +And here are the canonical sources of this project's documentation: + +@table @asis +@item Manual +@uref{https://protesilaos.com/modus-themes} +@item Change Log +@uref{https://protesilaos.com/modus-themes-changelog} +@item Screenshots +@uref{https://protesilaos.com/modus-themes-pictures} +@end table + +@node GNU Free Documentation License +@appendix GNU Free Documentation License + +@example + GNU Free Documentation License + Version 1.3, 3 November 2008 + + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +The "publisher" means any person or entity that distributes copies of +the Document to the public. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no +other conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to +give them a chance to provide you with an updated version of the +Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other +documents released under this License, and replace the individual +copies of this License in the various documents with a single copy +that is included in the collection, provided that you follow the rules +of this License for verbatim copying of each of the documents in all +other respects. + +You may extract a single document from such a collection, and +distribute it individually under this License, provided you insert a +copy of this License into the extracted document, and follow this +License in all other respects regarding verbatim copying of that +document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions of the +GNU Free Documentation License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in +detail to address new problems or concerns. See +https://www.gnu.org/licenses/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. + +11. RELICENSING + +"Massive Multiauthor Collaboration Site" (or "MMC Site") means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +"Massive Multiauthor Collaboration" (or "MMC") contained in the site +means any set of copyrightable works thus published on the MMC site. + +"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. + +"Incorporate" means to publish or republish a Document, in whole or in +part, as part of another Document. + +An MMC is "eligible for relicensing" if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole or +in part into the MMC, (1) had no cover texts or invariant sections, and +(2) were thus incorporated prior to November 1, 2008. + +The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +@end example + +@node Indices +@chapter Indices + +@menu +* Function index:: +* Variable index:: +* Concept index:: +@end menu + +@node Function index +@section Function index + +@printindex fn + +@node Variable index +@section Variable index + +@printindex vr + +@node Concept index +@section Concept index + +@printindex cp + +@bye \ No newline at end of file