diff options
| author | Protesilaos Stavrou | 2021-03-04 16:20:15 +0200 |
|---|---|---|
| committer | Basil L. Contovounesios | 2021-03-06 09:16:00 +0000 |
| commit | de602dd7cf76b001244964aa5bbef4d9e08ea62b (patch) | |
| tree | 13728319d6f017ea3f426ae9d9dd628ddf9dc59a /doc | |
| parent | f2f233d867ac5a81504c62d5fdb45e8c1c04739b (diff) | |
| download | emacs-de602dd7cf76b001244964aa5bbef4d9e08ea62b.tar.gz emacs-de602dd7cf76b001244964aa5bbef4d9e08ea62b.zip | |
Update Modus themes to their version 1.2.0
* doc/misc/modus-themes.org: Add new version of the manual, with
changes to markup and references to the latest state of the project.
* etc/themes/modus-vivendi-theme.el:
* etc/themes/modus-operandi-theme.el: Provide updated version of each
theme, which expands the contents of 'modus-themes.el' (bug#45068).
* etc/themes/modus-themes.el: Add new supportive file. This is where
theme data, functions, and face definitions are defined.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/modus-themes.org | 3267 |
1 files changed, 2304 insertions, 963 deletions
diff --git a/doc/misc/modus-themes.org b/doc/misc/modus-themes.org index 4a6150cf9db..20d7767053f 100644 --- a/doc/misc/modus-themes.org +++ b/doc/misc/modus-themes.org | |||
| @@ -1,30 +1,52 @@ | |||
| 1 | #+TITLE: Modus themes for GNU Emacs | 1 | #+title: Modus themes for GNU Emacs |
| 2 | #+AUTHOR: Protesilaos Stavrou | 2 | #+author: Protesilaos Stavrou |
| 3 | #+EMAIL: info@protesilaos.com | 3 | #+email: info@protesilaos.com |
| 4 | #+TEXINFO_DIR_CATEGORY: Emacs misc features | 4 | #+language: en |
| 5 | #+TEXINFO_DIR_TITLE: Modus Themes: (modus-themes) | 5 | #+options: ':t toc:nil author:t email:t |
| 6 | #+TEXINFO_DIR_DESC: Highly accessible themes (WCAG AAA) | 6 | |
| 7 | #+OPTIONS: ':t toc:nil author:t email:t | 7 | #+macro: stable-version 1.2.0 |
| 8 | #+MACRO: version-tag 0.13.0 | 8 | #+macro: release-date 2021-03-04 |
| 9 | #+MACRO: release-date 2020-10-08 | 9 | #+macro: development-version 1.3.0-dev |
| 10 | #+macro: export-date (eval (format-time-string "%F %R %z" (current-time))) | ||
| 11 | #+macro: file @@texinfo:@file{@@$1@@texinfo:}@@ | ||
| 12 | #+macro: space @@texinfo:@: @@ | ||
| 13 | # The "kbd" macro turns KBD into @kbd{KBD}. Additionally, it | ||
| 14 | # encloses case-sensitive special keys (SPC, RET...) within @key{...}. | ||
| 15 | # I got this from the Org source code. | ||
| 16 | #+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)))) | ||
| 17 | |||
| 18 | #+texinfo_filename: modus-themes.info | ||
| 19 | #+texinfo_dir_category: Emacs misc features | ||
| 20 | #+texinfo_dir_title: Modus Themes: (modus-themes) | ||
| 21 | #+texinfo_dir_desc: Highly accessible themes (WCAG AAA) | ||
| 22 | #+texinfo_header: @set MAINTAINERSITE @uref{https://protesilaos.com,maintainer webpage} | ||
| 23 | #+texinfo_header: @set MAINTAINER Protesilaos Stavrou | ||
| 24 | #+texinfo_header: @set MAINTAINEREMAIL @email{info@protesilaos.com} | ||
| 25 | #+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:info@protesilaos.com,contact the maintainer} | ||
| 10 | 26 | ||
| 11 | #+texinfo: @insertcopying | 27 | #+texinfo: @insertcopying |
| 12 | 28 | ||
| 13 | This manual, written by Protesilaos Stavrou, describes the customization | 29 | This manual, written by Protesilaos Stavrou, describes the customization |
| 14 | options for the =modus-operandi= and =modus-vivendi= themes, and provides | 30 | options for the ~modus-operandi~ and ~modus-vivendi~ themes, and provides |
| 15 | every other piece of information pertinent to them. | 31 | every other piece of information pertinent to them. |
| 16 | 32 | ||
| 17 | The documentation furnished herein corresponds to version {{{version-tag}}}, | 33 | The documentation furnished herein corresponds to stable version |
| 18 | released on {{{release-date}}}. Any reference to a newer feature which does | 34 | {{{stable-version}}}, released on {{{release-date}}}. Any reference to a newer |
| 19 | not yet form part of the latest tagged commit, is explicitly marked as | 35 | feature which does not yet form part of the latest tagged commit, is |
| 20 | such. | 36 | explicitly marked as such. |
| 21 | 37 | ||
| 22 | * Copying | 38 | # Current development target is {{{development-version}}}. This manual was |
| 23 | :PROPERTIES: | 39 | # built on {{{export-date}}}. |
| 24 | :copying: t | ||
| 25 | :END: | ||
| 26 | 40 | ||
| 27 | Copyright (C) 2020--2021 Free Software Foundation, Inc. | 41 | #+toc: headlines 8 insert TOC here, with eight headline levels |
| 42 | |||
| 43 | * COPYING | ||
| 44 | :properties: | ||
| 45 | :copying: t | ||
| 46 | :custom_id: h:b14c3fcb-13dd-4144-9d92-2c58b3ed16d3 | ||
| 47 | :end: | ||
| 48 | |||
| 49 | Copyright (C) 2020-2021 Free Software Foundation, Inc. | ||
| 28 | 50 | ||
| 29 | #+begin_quote | 51 | #+begin_quote |
| 30 | Permission is granted to copy, distribute and/or modify this | 52 | Permission is granted to copy, distribute and/or modify this |
| @@ -34,12 +56,10 @@ Foundation; with no Invariant Sections, with no Front-Cover Texts, | |||
| 34 | and with no Back-Cover Texts. | 56 | and with no Back-Cover Texts. |
| 35 | #+end_quote | 57 | #+end_quote |
| 36 | 58 | ||
| 37 | #+TOC: headlines 8 insert TOC here, with eight headline levels | ||
| 38 | |||
| 39 | * Overview | 59 | * Overview |
| 40 | :PROPERTIES: | 60 | :properties: |
| 41 | :CUSTOM_ID: h:f0f3dbcb-602d-40cf-b918-8f929c441baf | 61 | :custom_id: h:f0f3dbcb-602d-40cf-b918-8f929c441baf |
| 42 | :END: | 62 | :end: |
| 43 | 63 | ||
| 44 | The Modus themes are designed for accessible readability. They conform | 64 | The Modus themes are designed for accessible readability. They conform |
| 45 | with the highest standard for color contrast between any given | 65 | with the highest standard for color contrast between any given |
| @@ -47,9 +67,9 @@ combination of background and foreground values. This corresponds to | |||
| 47 | the WCAG AAA standard, which specifies a minimum rate of distance in | 67 | the WCAG AAA standard, which specifies a minimum rate of distance in |
| 48 | relative luminance of 7:1. | 68 | relative luminance of 7:1. |
| 49 | 69 | ||
| 50 | Modus Operandi (=modus-operandi=) is a light theme, while Modus Vivendi | 70 | Modus Operandi (~modus-operandi~) is a light theme, while Modus Vivendi |
| 51 | (=modus-vivendi=) is dark. Each theme's color palette is designed to | 71 | (~modus-vivendi~) is dark. Each theme's color palette is designed to meet |
| 52 | meet the needs of the numerous interfaces that are possible in the Emacs | 72 | the needs of the numerous interfaces that are possible in the Emacs |
| 53 | computing environment. | 73 | computing environment. |
| 54 | 74 | ||
| 55 | The overarching objective of this project is to always offer accessible | 75 | The overarching objective of this project is to always offer accessible |
| @@ -59,15 +79,16 @@ and stylistic considerations, we will always opt for the former. | |||
| 59 | 79 | ||
| 60 | To ensure that users have a consistently accessible experience, the | 80 | To ensure that users have a consistently accessible experience, the |
| 61 | themes strive to achieve as close to full face coverage as possible | 81 | themes strive to achieve as close to full face coverage as possible |
| 62 | (see [[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]). | 82 | ([[#h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19][Face coverage]]). |
| 63 | 83 | ||
| 64 | Starting with version 0.12.0 and onwards, the themes are built into GNU | 84 | Starting with version 0.12.0 and onwards, the themes are built into GNU |
| 65 | Emacs (current version is {{{version-tag}}}). | 85 | Emacs. |
| 66 | 86 | ||
| 67 | ** How do the themes look like | 87 | ** How do the themes look like |
| 68 | :PROPERTIES: | 88 | :properties: |
| 69 | :CUSTOM_ID: h:69b92089-069c-4ba1-9d94-cc3415fc4f87 | 89 | :custom_id: h:69b92089-069c-4ba1-9d94-cc3415fc4f87 |
| 70 | :END: | 90 | :end: |
| 91 | #+cindex: Screenshots | ||
| 71 | 92 | ||
| 72 | Check the web page with [[https://protesilaos.com/modus-themes-pictures/][the screen shots]]. There are lots of scenarios | 93 | Check the web page with [[https://protesilaos.com/modus-themes-pictures/][the screen shots]]. There are lots of scenarios |
| 73 | on display that draw attention to details and important aspects in the | 94 | on display that draw attention to details and important aspects in the |
| @@ -77,596 +98,562 @@ options. | |||
| 77 | [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]. | 98 | [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization options]]. |
| 78 | 99 | ||
| 79 | ** Learn about the latest changes | 100 | ** Learn about the latest changes |
| 80 | :PROPERTIES: | 101 | :properties: |
| 81 | :CUSTOM_ID: h:2cc37c36-6c1a-48b2-a010-1050b270ee18 | 102 | :custom_id: h:2cc37c36-6c1a-48b2-a010-1050b270ee18 |
| 82 | :END: | 103 | :end: |
| 104 | #+cindex: Changelog | ||
| 83 | 105 | ||
| 84 | Please refer to the [[https://protesilaos.com/modus-themes-changelog][web page with the change log]]. It is comprehensive | 106 | Please refer to the [[https://protesilaos.com/modus-themes-changelog][web page with the change log]]. It is comprehensive |
| 85 | and covers everything that goes into every tagged release of the themes. | 107 | and covers everything that goes into every tagged release of the themes. |
| 86 | 108 | ||
| 87 | * Installation | 109 | * Installation |
| 88 | :PROPERTIES: | 110 | :properties: |
| 89 | :CUSTOM_ID: h:1af85373-7f81-4c35-af25-afcef490c111 | 111 | :custom_id: h:1af85373-7f81-4c35-af25-afcef490c111 |
| 90 | :END: | 112 | :end: |
| 91 | 113 | ||
| 92 | The Modus themes are distributed with Emacs starting with version 28.1. | 114 | The Modus themes are distributed with Emacs starting with version 28.1. |
| 93 | On older versions of Emacs, they can be installed using Emacs' package | 115 | On older versions of Emacs, they can be installed using Emacs' package |
| 94 | manager or manually from their code repository. | 116 | manager or manually from their code repository. There also exist |
| 117 | packages for distributions of GNU/Linux. | ||
| 118 | |||
| 119 | ** Install manually from source | ||
| 120 | :properties: | ||
| 121 | :custom_id: h:da3414b7-1426-46b8-8e76-47b845b76fd0 | ||
| 122 | :end: | ||
| 123 | |||
| 124 | In the following example, we are assuming that your Emacs files are | ||
| 125 | stored in =~/.emacs.d= and that you want to place the Modus themes in | ||
| 126 | =~/.emacs.d/modus-themes=. | ||
| 127 | |||
| 128 | 1. Get the source and store it in the desired path by running the | ||
| 129 | following in the command line shell: | ||
| 130 | |||
| 131 | : $ git clone https://gitlab.com/protesilaos/modus-themes.git ~/.emacs.d/modus-themes | ||
| 132 | |||
| 133 | 2. Add that path to your known Elisp libraries' list, by placing this | ||
| 134 | snippet of Emacs Lisp in your init file (e.g. {{{file(init.el)}}}): | ||
| 135 | |||
| 136 | #+begin_src emacs-lisp | ||
| 137 | (add-to-list 'load-path "~/.emacs.d/modus-themes") | ||
| 138 | #+end_src | ||
| 95 | 139 | ||
| 96 | Modus Operandi (light theme) and Modus Vivendi (dark) are normally | 140 | The themes are now ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]. |
| 97 | distributed as standalone packages in Emacs-specific archives. There | ||
| 98 | also exist packages for GNU/Linux distributions. | ||
| 99 | 141 | ||
| 100 | ** Install from the archives | 142 | ** Install from the archives |
| 101 | :PROPERTIES: | 143 | :properties: |
| 102 | :CUSTOM_ID: h:c4b10085-149f-43e2-bd4d-347f33aee054 | 144 | :custom_id: h:c4b10085-149f-43e2-bd4d-347f33aee054 |
| 103 | :END: | 145 | :end: |
| 104 | 146 | ||
| 105 | =modus-operandi-theme= and =modus-vivendi-theme= are available from GNU the | 147 | The =modus-themes= package is available from the GNU ELPA archive, which |
| 106 | ELPA archive, which is configured by default. | 148 | is configured by default. |
| 107 | 149 | ||
| 108 | Prior to querying any package archive, make sure to have updated the | 150 | Prior to querying any package archive, make sure to have updated the |
| 109 | index, with =M-x package-refresh-contents=. Then all you need to do is | 151 | index, with {{{kbd(M-x package-refresh-contents)}}}. Then all you need to do |
| 110 | type =M-x package-install= and specify the theme of your choice. | 152 | is type {{{kbd(M-x package-install)}}} and specify the ~modus-themes~. |
| 153 | |||
| 154 | Note that older versions of the themes used to be distributed as | ||
| 155 | standalone packages. This practice has been discontinued starting with | ||
| 156 | version 1.0.0 of this project. | ||
| 157 | |||
| 158 | Once installed, the themes are ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]. | ||
| 111 | 159 | ||
| 112 | ** Install on GNU/Linux | 160 | ** Install on GNU/Linux |
| 113 | :PROPERTIES: | 161 | :properties: |
| 114 | :CUSTOM_ID: h:da640eb1-95dd-4e86-bb4e-1027b27885f0 | 162 | :custom_id: h:da640eb1-95dd-4e86-bb4e-1027b27885f0 |
| 115 | :END: | 163 | :end: |
| 116 | 164 | ||
| 117 | The themes are also available from the archives of some GNU/Linux | 165 | The themes are also available from the archives of some distributions of |
| 118 | distributions. These should correspond to a tagged release rather than | 166 | GNU/Linux. These should correspond to a tagged release rather than |
| 119 | building directly from the latest Git commit. It all depends on the | 167 | building directly from the latest Git commit. It all depends on the |
| 120 | distro's packaging policies. | 168 | distro's packaging policies. |
| 121 | 169 | ||
| 122 | *** Debian 11 Bullseye | 170 | *** Debian 11 Bullseye |
| 123 | :PROPERTIES: | 171 | :properties: |
| 124 | :CUSTOM_ID: h:7e570360-9ee6-4bc5-8c04-9dc11418a3e4 | 172 | :custom_id: h:7e570360-9ee6-4bc5-8c04-9dc11418a3e4 |
| 125 | :END: | 173 | :end: |
| 126 | |||
| 127 | The two themes are distributed as a single package for Debian and its | ||
| 128 | derivatives. Currently in the unstable and testing suites and should be | ||
| 129 | available in time for Debian 11 Bullseye (next stable). | ||
| 130 | 174 | ||
| 131 | Get them with: | 175 | The themes are part of Debian 11 Bullseye. Get them with: |
| 132 | 176 | ||
| 133 | #+begin_src sh | 177 | #+begin_src sh |
| 134 | sudo apt install elpa-modus-themes | 178 | sudo apt install elpa-modus-themes |
| 135 | #+end_src | 179 | #+end_src |
| 136 | 180 | ||
| 181 | They are now ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]. | ||
| 182 | |||
| 137 | *** GNU Guix | 183 | *** GNU Guix |
| 138 | :PROPERTIES: | 184 | :properties: |
| 139 | :CUSTOM_ID: h:a4ca52cd-869f-46a5-9e16-4d9665f5b88e | 185 | :custom_id: h:a4ca52cd-869f-46a5-9e16-4d9665f5b88e |
| 140 | :END: | 186 | :end: |
| 141 | 187 | ||
| 142 | Users of either the Guix System (the distro) or just Guix (the package | 188 | Users of Guix can get the themes with this command: |
| 143 | manager) can get each theme as a standalone package. | ||
| 144 | 189 | ||
| 145 | #+begin_src sh | 190 | #+begin_src sh |
| 146 | guix package -i emacs-modus-operandi-theme | 191 | guix package -i emacs-modus-themes |
| 147 | #+end_src | 192 | #+end_src |
| 148 | 193 | ||
| 149 | And/or: | 194 | They are now ready to be used: [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]. |
| 150 | |||
| 151 | #+begin_src sh | ||
| 152 | guix package -i emacs-modus-vivendi-theme | ||
| 153 | #+end_src | ||
| 154 | 195 | ||
| 155 | * Enable and load | 196 | * Enable and load |
| 156 | :PROPERTIES: | 197 | :properties: |
| 157 | :CUSTOM_ID: h:3f3c3728-1b34-437d-9d0c-b110f5b161a9 | 198 | :custom_id: h:3f3c3728-1b34-437d-9d0c-b110f5b161a9 |
| 158 | :END: | 199 | :end: |
| 159 | 200 | #+findex: modus-themes-load-themes | |
| 160 | This section documents how to load the theme of your choice and how to | 201 | #+findex: modus-themes-toggle |
| 161 | further control its initialization. It also includes some sample code | 202 | #+findex: modus-themes-load-operandi |
| 162 | snippets that could help you in the task, especially if you intend to | 203 | #+findex: modus-themes-load-vivendi |
| 163 | use both Modus Operandi and Modus Vivendi. | 204 | #+cindex: Essential configuration |
| 205 | #+vindex: modus-themes-after-load-theme-hook | ||
| 206 | |||
| 207 | Users of the built-in themes can load and automatically enable the theme | ||
| 208 | of their preference by adding either form to their init file: | ||
| 164 | 209 | ||
| 165 | ** Load automatically | 210 | #+begin_src emacs-lisp |
| 166 | :PROPERTIES: | 211 | (load-theme 'modus-operandi) ; Light theme |
| 167 | :CUSTOM_ID: h:1777c247-1b56-46b7-a4ce-54e720b33d06 | 212 | (load-theme 'modus-vivendi) ; Dark theme |
| 168 | :END: | 213 | #+end_src |
| 169 | 214 | ||
| 170 | A simple way to load the theme from your Emacs initialization file is to | 215 | This is all one needs. |
| 171 | include either of the following expressions: | ||
| 172 | 216 | ||
| 173 | #+BEGIN_SRC emacs-lisp | 217 | Users of packaged variants of the themes must add a few more lines to |
| 174 | (load-theme 'modus-operandi t) ; Light theme | 218 | ensure that everything works as intended. First, one has to require the |
| 175 | (load-theme 'modus-vivendi t) ; Dark theme | 219 | main library before loading either theme: |
| 176 | #+END_SRC | ||
| 177 | 220 | ||
| 178 | Make sure to remove any other theme that is being loaded, otherwise you | 221 | #+begin_src emacs-lisp |
| 179 | might run into unexpected issues. | 222 | (require 'modus-themes) |
| 223 | #+end_src | ||
| 180 | 224 | ||
| 181 | Note that you can always =M-x disable-theme= and specify an item. The | 225 | Then it is recommended to load the individual theme files with the |
| 182 | command does exactly what its name suggests. To deactivate all enabled | 226 | helper function ~modus-themes-load-themes~: |
| 183 | themes at once, in case you have multiple of them enabled, you may | ||
| 184 | evaluate the expression: | ||
| 185 | 227 | ||
| 186 | #+begin_src emacs-lisp | 228 | #+begin_src emacs-lisp |
| 187 | (mapc #'disable-theme custom-enabled-themes) | 229 | ;; Load the theme files before enabling a theme (else you get an error). |
| 230 | (modus-themes-load-themes) | ||
| 188 | #+end_src | 231 | #+end_src |
| 189 | 232 | ||
| 190 | ** Load at a given time or at sunset/sunrise | 233 | Once the libraries that define the themes are enabled, one can activate |
| 191 | :PROPERTIES: | 234 | a theme with either of the following expressions: |
| 192 | :CUSTOM_ID: h:4e936e31-e9eb-4b50-8fdd-45d827a03cca | ||
| 193 | :END: | ||
| 194 | |||
| 195 | It is possible to schedule a time during the day at or after which a | ||
| 196 | given theme will be loaded.[fn:: Contributed on Reddit by user =b3n=, | ||
| 197 | https://www.reddit.com/r/emacs/comments/gdtqov/weekly_tipstricketc_thread/fq9186h/.] | ||
| 198 | 235 | ||
| 199 | #+begin_src emacs-lisp | 236 | #+begin_src emacs-lisp |
| 200 | ;; Light for the day | 237 | (modus-themes-load-operandi) ; Light theme |
| 201 | (load-theme 'modus-operandi t t) | 238 | ;; OR |
| 202 | (run-at-time "05:00" (* 60 60 24) | 239 | (modus-themes-load-vivendi) ; Dark theme |
| 203 | (lambda () | ||
| 204 | (enable-theme 'modus-operandi))) | ||
| 205 | |||
| 206 | ;; Dark for the night | ||
| 207 | (load-theme 'modus-vivendi t t) | ||
| 208 | (run-at-time "21:00" (* 60 60 24) | ||
| 209 | (lambda () | ||
| 210 | (enable-theme 'modus-vivendi))) | ||
| 211 | #+end_src | 240 | #+end_src |
| 212 | 241 | ||
| 213 | A modified version of the above technique is to use the sunrise and | 242 | Changes to the available customization options must always be evaluated |
| 214 | sunset as references, instead of specifying a fixed hour value.[fn:: | 243 | before loading a theme ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). This is how a basic |
| 215 | Contributed directly by André Alexandre Gomes https://gitlab.com/aadcg.] | 244 | setup could look like: |
| 216 | If you set =calendar-latitude= and =calendar-longitude= (defined in the | ||
| 217 | built-in =solar.el= library---read it with =M-x find-library=), you can | ||
| 218 | automatically switch between both themes at the appropriate time-of-day. | ||
| 219 | Note that /those calendar variables need to be set before loading the | ||
| 220 | themes/. | ||
| 221 | 245 | ||
| 222 | #+begin_src emacs-lisp | 246 | #+begin_src emacs-lisp |
| 223 | ;; Define coordinates | 247 | (require 'modus-themes) |
| 224 | (setq calendar-latitude 35.17 | ||
| 225 | calendar-longitude 33.36) | ||
| 226 | 248 | ||
| 227 | ;; Light at sunrise | 249 | ;; Your customisations here. For example: |
| 228 | (load-theme 'modus-operandi t t) | 250 | (setq modus-themes-bold-constructs t |
| 229 | (run-at-time (nth 1 (split-string (sunrise-sunset))) | 251 | modus-themes-mode-line '3d) |
| 230 | (* 60 60 24) | ||
| 231 | (lambda () | ||
| 232 | (enable-theme 'modus-operandi))) | ||
| 233 | 252 | ||
| 234 | ;; Dark at sunset | 253 | ;; Load the theme files before enabling a theme (else you get an error). |
| 235 | (load-theme 'modus-vivendi t t) | 254 | (modus-themes-load-themes) |
| 236 | (run-at-time (nth 4 (split-string (sunrise-sunset))) | ||
| 237 | (* 60 60 24) | ||
| 238 | (lambda () | ||
| 239 | (enable-theme 'modus-vivendi))) | ||
| 240 | #+end_src | ||
| 241 | 255 | ||
| 242 | For the sake of completeness, the =load-theme= call in these snippets is | 256 | ;; Enable the theme of your preference: |
| 243 | slightly different than the one shown in [[#h:1777c247-1b56-46b7-a4ce-54e720b33d06][Load automatically]], because it | 257 | (modus-themes-load-operandi) |
| 244 | does not enable the theme directly: the subsequent =enable-theme= does | ||
| 245 | that when needed. | ||
| 246 | 258 | ||
| 247 | ** Toggle between the themes on demand | 259 | ;; Optionally add a key binding for the toggle between the themes: |
| 248 | :PROPERTIES: | 260 | (define-key global-map (kbd "<f5>") #'modus-themes-toggle) |
| 249 | :CUSTOM_ID: h:2a0895a6-3281-4e55-8aa1-8a737555821e | 261 | #+end_src |
| 250 | :END: | ||
| 251 | 262 | ||
| 252 | With both themes available, it is possible to design a simple command to | 263 | [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration for use-package]]. |
| 253 | switch between them on demand. | ||
| 254 | 264 | ||
| 255 | #+begin_src emacs-lisp | 265 | With those granted, bear in mind a couple of technical points on |
| 256 | (defun modus-themes-toggle () | 266 | ~modus-themes-load-operandi~ and ~modus-themes-load-vivendi~, as well as |
| 257 | "Toggle between `modus-operandi' and `modus-vivendi' themes." | 267 | ~modus-themes-toggle~ which relies on them: |
| 258 | (interactive) | ||
| 259 | (if (eq (car custom-enabled-themes) 'modus-operandi) | ||
| 260 | (progn | ||
| 261 | (disable-theme 'modus-operandi) | ||
| 262 | (load-theme 'modus-vivendi t)) | ||
| 263 | (disable-theme 'modus-vivendi) | ||
| 264 | (load-theme 'modus-operandi t))) | ||
| 265 | #+end_src | ||
| 266 | 268 | ||
| 267 | You could use =(mapc #'disable-theme custom-enabled-themes)= instead of | 269 | 1. Those functions call ~load-theme~. Some users prefer to opt for |
| 268 | disabling a single target, but you get the idea. | 270 | ~enable-theme~ instead ([[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]). |
| 269 | 271 | ||
| 270 | ** Configure options prior to loading | 272 | 2. The functions will run the ~modus-themes-after-load-theme-hook~ as |
| 271 | :PROPERTIES: | 273 | their final step. This can be employed for bespoke configurations |
| 272 | :CUSTOM_ID: h:a897b302-8e10-4a26-beab-3caaee1e1193 | 274 | ([[#h:f4651d55-8c07-46aa-b52b-bed1e53463bb][Advanced customization (do-it-yourself)]]). Experienced users may not |
| 273 | :END: | 275 | wish to rely on such a hook and the functions that run it: they may |
| 276 | prefer a custom solution ([[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]). | ||
| 274 | 277 | ||
| 275 | If you plan to use both themes and wish to apply styles consistently | 278 | ** Sample configuration for use-package |
| 276 | (see [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]), you could define wrapper functions around | 279 | :properties: |
| 277 | the standard =load-theme= command. These extend the simple function we | 280 | :custom_id: h:e979734c-a9e1-4373-9365-0f2cd36107b8 |
| 278 | presented in [[#h:2a0895a6-3281-4e55-8aa1-8a737555821e][Toggle between the themes on demand]]. | 281 | :end: |
| 282 | #+cindex: use-package configuration | ||
| 279 | 283 | ||
| 280 | Here is a comprehensive setup (the values assigned to the variables are | 284 | It is common for Emacs users to rely on ~use-package~ for declaring |
| 281 | just for the sake of this demonstration):[fn:: The =defmacro= and =dolist= | 285 | package configurations in their setup. We use this as an example: |
| 282 | method were contributed on Reddit by user =b3n= | ||
| 283 | https://www.reddit.com/r/emacs/comments/gqsz8u/weekly_tipstricketc_thread/fsfakhg/.] | ||
| 284 | 286 | ||
| 285 | #+begin_src emacs-lisp | 287 | #+begin_src emacs-lisp |
| 286 | (defmacro modus-themes-format-sexp (sexp &rest objects) | 288 | (use-package modus-themes |
| 287 | `(eval (read (format ,(format "%S" sexp) ,@objects)))) | 289 | :ensure ; omit this to use the built-in themes |
| 288 | 290 | :init | |
| 289 | (dolist (theme '("operandi" "vivendi")) | 291 | ;; Add all your customizations prior to loading the themes |
| 290 | (modus-themes-format-sexp | 292 | (setq modus-themes-slanted-constructs t |
| 291 | (defun modus-%1$s-theme-load () | 293 | modus-themes-bold-constructs nil) |
| 292 | (setq modus-%1$s-theme-slanted-constructs t | 294 | |
| 293 | modus-%1$s-theme-bold-constructs t | 295 | ;; Load the theme files before enabling a theme (else you get an error). |
| 294 | modus-%1$s-theme-fringes 'subtle ; {nil,'subtle,'intense} | 296 | (modus-themes-load-themes) |
| 295 | modus-%1$s-theme-mode-line '3d ; {nil,'3d,'moody} | 297 | :config |
| 296 | modus-%1$s-theme-syntax 'alt-syntax ; {nil,faint,'yellow-comments,'green-strings,'yellow-comments-green-strings,'alt-syntax,'alt-syntax-yellow-comments} | 298 | ;; Load the theme of your choice: |
| 297 | modus-%1$s-theme-intense-hl-line nil | 299 | (modus-themes-load-operandi) ;; OR (modus-themes-load-vivendi) |
| 298 | modus-%1$s-theme-intense-paren-match nil | 300 | :bind ("<f5>" . modus-themes-toggle)) |
| 299 | modus-%1$s-theme-links 'faint ; {nil,'faint,'neutral-underline,'faint-neutral-underline,'no-underline} | ||
| 300 | modus-%1$s-theme-no-mixed-fonts nil | ||
| 301 | modus-%1$s-theme-prompts nil ; {nil,'subtle,'intense} | ||
| 302 | modus-%1$s-theme-completions 'moderate ; {nil,'moderate,'opinionated} | ||
| 303 | modus-%1$s-theme-diffs nil ; {nil,'desaturated,'fg-only} | ||
| 304 | modus-%1$s-theme-org-blocks 'grayscale ; {nil,'grayscale,'rainbow} | ||
| 305 | modus-%1$s-theme-headings ; Read further below in the manual for this one | ||
| 306 | '((1 . section) | ||
| 307 | (2 . line) | ||
| 308 | (t . rainbow-line-no-bold)) | ||
| 309 | modus-%1$s-theme-variable-pitch-headings nil | ||
| 310 | modus-%1$s-theme-scale-headings t | ||
| 311 | modus-%1$s-theme-scale-1 1.1 | ||
| 312 | modus-%1$s-theme-scale-2 1.15 | ||
| 313 | modus-%1$s-theme-scale-3 1.21 | ||
| 314 | modus-%1$s-theme-scale-4 1.27 | ||
| 315 | modus-%1$s-theme-scale-5 1.33) | ||
| 316 | (load-theme 'modus-%1$s t)) | ||
| 317 | theme)) | ||
| 318 | |||
| 319 | (defun modus-themes-toggle () | ||
| 320 | "Toggle between `modus-operandi' and `modus-vivendi' themes." | ||
| 321 | (interactive) | ||
| 322 | (if (eq (car custom-enabled-themes) 'modus-operandi) | ||
| 323 | (progn | ||
| 324 | (disable-theme 'modus-operandi) | ||
| 325 | (modus-vivendi-theme-load)) | ||
| 326 | (disable-theme 'modus-vivendi) | ||
| 327 | (modus-operandi-theme-load))) | ||
| 328 | #+end_src | 301 | #+end_src |
| 329 | 302 | ||
| 330 | * Customization Options | 303 | [[#h:e68560b3-7fb0-42bc-a151-e015948f8a35][Differences between loading and enabling]]. |
| 331 | :PROPERTIES: | 304 | |
| 332 | :CUSTOM_ID: h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f | 305 | Note: make sure not to customize the variable ~custom-theme-load-path~ |
| 333 | :END: | 306 | or ~custom-theme-directory~ after the themes' package declaration. That |
| 334 | 307 | will lead to failures in loading the files. If either or both of those | |
| 335 | The Modus themes are highly configurable, though they should work well | 308 | variables need to be changed, their values should be defined before the |
| 336 | without any further tweaks. | 309 | package declaration of the themes. |
| 337 | 310 | ||
| 338 | By default, all customization options are set to =nil=. | 311 | ** Differences between loading and enabling |
| 339 | 312 | :properties: | |
| 340 | All customization options need to be evaluated before loading their | 313 | :custom_id: h:e68560b3-7fb0-42bc-a151-e015948f8a35 |
| 341 | theme (see [[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). | 314 | :end: |
| 315 | #+cindex: load-theme VS enable-theme | ||
| 316 | |||
| 317 | The reason we recommend ~load-theme~ instead of the other option of | ||
| 318 | ~enable-theme~ is that the former does a kind of "reset" on the face | ||
| 319 | specs. It quite literally loads (or re-loads) the theme. Whereas the | ||
| 320 | latter simply puts an already loaded theme at the top of the list of | ||
| 321 | enabled items, re-using whatever state was last loaded. | ||
| 322 | |||
| 323 | As such, ~load-theme~ reads all customizations that may happen during | ||
| 324 | any given Emacs session: even after the initial setup of a theme. | ||
| 325 | Examples are calls to ~custom-set-faces~, as well as new values assigned | ||
| 326 | to the options the Modus themes provide ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). | ||
| 327 | |||
| 328 | Our tests show that ~enable-theme~ does not read such variables anew, so | ||
| 329 | it might appear to the unsuspecting user that the themes are somehow | ||
| 330 | broken whenever they try to assign a new value to a customization option | ||
| 331 | or some face. | ||
| 332 | |||
| 333 | This "reset" that ~load-theme~ conducts does, however, come at the cost | ||
| 334 | of being somewhat slower than ~enable-theme~. Users who have a stable | ||
| 335 | setup and who seldom update their variables during a given Emacs | ||
| 336 | session, are better off using something like this: | ||
| 342 | 337 | ||
| 343 | ** Option for more bold constructs | 338 | #+begin_src emacs-lisp |
| 344 | :PROPERTIES: | 339 | (require 'modus-themes) |
| 345 | :ALT_TITLE: Bold constructs | 340 | (load-theme 'modus-operandi t t) |
| 346 | :DESCRIPTION: Toggle bold constructs in code | 341 | (load-theme 'modus-vivendi t t) |
| 347 | :CUSTOM_ID: h:b25714f6-0fbe-41f6-89b5-6912d304091e | ||
| 348 | :END: | ||
| 349 | |||
| 350 | Symbol names: | ||
| 351 | |||
| 352 | + =modus-operandi-theme-bold-constructs= | ||
| 353 | + =modus-vivendi-theme-bold-constructs= | ||
| 354 | 342 | ||
| 355 | Possible values: | 343 | (enable-theme 'modus-operandi) ;; OR (enable-theme 'modus-vivendi) |
| 344 | #+end_src | ||
| 356 | 345 | ||
| 357 | 1. =nil= (default) | 346 | [[#h:e979734c-a9e1-4373-9365-0f2cd36107b8][Sample configuration for use-package]]. |
| 358 | 2. =t= | ||
| 359 | 347 | ||
| 360 | Display several constructs in bold weight. This concerns keywords and | 348 | With the above granted, other sections of the manual discuss how to |
| 361 | other important aspects of code syntax. It also affects certain mode | 349 | configure custom faces, where ~load-theme~ is expected, though |
| 362 | line indicators and command-line prompts. | 350 | ~enable-theme~ could still apply in stable setups: |
| 363 | 351 | ||
| 364 | The default is to only use a bold weight when it is required. | 352 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]. |
| 365 | 353 | ||
| 366 | Additionally, and while not necessary, to define the precise weight for | 354 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. |
| 367 | bold constructs, you can change the typographic intensity of the =bold= | ||
| 368 | face. The standard is a bold weight. It requires no further | ||
| 369 | intervention. Assuming though that your typeface of choice supports a | ||
| 370 | "semibold" weight, adding the following snippet to your init file should | ||
| 371 | suffice. | ||
| 372 | 355 | ||
| 373 | #+begin_src emacs-lisp | 356 | * Customization Options |
| 374 | (set-face-attribute 'bold nil :weight 'semibold) | 357 | :properties: |
| 375 | #+end_src | 358 | :custom_id: h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f |
| 359 | :end: | ||
| 376 | 360 | ||
| 377 | Note that if you are switching themes, you need to re-evaluate this | 361 | The Modus themes are highly configurable, though they should work well |
| 378 | expression after the new theme is loaded. | 362 | without any further tweaks. By default, all customization options are |
| 363 | set to nil. | ||
| 379 | 364 | ||
| 380 | ** Option for more slanted constructs | 365 | Remember that all customization options must be evaluated before loading |
| 381 | :PROPERTIES: | 366 | a theme ([[#h:3f3c3728-1b34-437d-9d0c-b110f5b161a9][Enable and load]]). |
| 382 | :ALT_TITLE: Slanted constructs | ||
| 383 | :DESCRIPTION: Toggle slanted constructs (italics) in code | ||
| 384 | :CUSTOM_ID: h:977c900d-0d6d-4dbb-82d9-c2aae69543d6 | ||
| 385 | :END: | ||
| 386 | 367 | ||
| 387 | Symbol names: | 368 | ** Option for more bold constructs |
| 369 | :properties: | ||
| 370 | :alt_title: Bold constructs | ||
| 371 | :description: Toggle bold constructs in code | ||
| 372 | :custom_id: h:b25714f6-0fbe-41f6-89b5-6912d304091e | ||
| 373 | :end: | ||
| 374 | #+vindex: modus-themes-bold-constructs | ||
| 388 | 375 | ||
| 389 | + =modus-operandi-theme-slanted-constructs= | 376 | Symbol: ~modus-themes-bold-constructs~ |
| 390 | + =modus-vivendi-theme-slanted-constructs= | ||
| 391 | 377 | ||
| 392 | Possible values: | 378 | Possible values: |
| 393 | 379 | ||
| 394 | 1. =nil= (default) | 380 | 1. =nil= (default) |
| 395 | 2. =t= | 381 | 2. =t= |
| 396 | 382 | ||
| 397 | Choose to render more faces in slanted text (italics). This typically | 383 | The default is to use a bold typographic weight only when it is |
| 398 | affects documentation strings and code comments. | 384 | required. |
| 399 | |||
| 400 | The default is to not use italics unless it is absolutely necessary. | ||
| 401 | 385 | ||
| 402 | ** Option for faint code syntax highlighting (deprecated for ~0.14.0~) | 386 | With a non-nil value (=t=) display several syntactic constructs in bold |
| 403 | :PROPERTIES: | 387 | weight. This concerns keywords and other important aspects of code |
| 404 | :ALT_TITLE: Faint syntax | 388 | syntax. It also affects certain mode line indicators and command-line |
| 405 | :DESCRIPTION: Toggle subtle coloration in code (deprecated for 0.14.0) | 389 | prompts. |
| 406 | :CUSTOM_ID: h:741379fe-7203-4dad-a7f8-ab71f61b43e6 | ||
| 407 | :END: | ||
| 408 | 390 | ||
| 409 | Symbol names: | 391 | ** Option for more slanted constructs |
| 392 | :properties: | ||
| 393 | :alt_title: Slanted constructs | ||
| 394 | :description: Toggle slanted constructs (italics) in code | ||
| 395 | :custom_id: h:977c900d-0d6d-4dbb-82d9-c2aae69543d6 | ||
| 396 | :end: | ||
| 397 | #+vindex: modus-themes-slanted-constructs | ||
| 410 | 398 | ||
| 411 | + =modus-operandi-theme-faint-syntax= | 399 | Symbol: ~modus-themes-slanted-constructs~ |
| 412 | + =modus-vivendi-theme-faint-syntax= | ||
| 413 | 400 | ||
| 414 | Possible values: | 401 | Possible values: |
| 415 | 402 | ||
| 416 | 1. =nil= (default) | 403 | 1. =nil= (default) |
| 417 | 2. =t= | 404 | 2. =t= |
| 418 | 405 | ||
| 419 | Use less saturated colors in programming modes for highlighting code | 406 | The default is to not use slanted text (italics) unless it is absolutely |
| 420 | syntax. The default is to use saturated colors. | 407 | necessary. |
| 421 | 408 | ||
| 422 | This option essentially affects the font-lock faces, so it may also have | 409 | With a non-nil value (=t=) choose to render more faces in slanted text. |
| 423 | implications in other places that are hard-wired to rely directly on | 410 | This typically affects documentation strings and code comments. |
| 424 | them instead of specifying their own faces (which could inherit from | ||
| 425 | font-lock if that is the intent). The author is aware of =vc-dir= as a | ||
| 426 | case in point. | ||
| 427 | 411 | ||
| 428 | ** Option for syntax highlighting | 412 | ** Option for syntax highlighting |
| 429 | :PROPERTIES: | 413 | :properties: |
| 430 | :ALT_TITLE: Syntax styles | 414 | :alt_title: Syntax styles |
| 431 | :DESCRIPTION: Choose the overall aesthetic of code syntax | 415 | :description: Choose the overall aesthetic of code syntax |
| 432 | :CUSTOM_ID: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 | 416 | :custom_id: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 |
| 433 | :END: | 417 | :end: |
| 434 | 418 | #+vindex: modus-themes-syntax | |
| 435 | This option supersedes the "faint syntax" one ahead of version =0.14.0= | ||
| 436 | ([[#h:741379fe-7203-4dad-a7f8-ab71f61b43e6][Option for faint code syntax highlighting]]). | ||
| 437 | 419 | ||
| 438 | Symbol names: | 420 | Symbol: ~modus-themes-syntax~ |
| 439 | |||
| 440 | + =modus-operandi-theme-syntax= | ||
| 441 | + =modus-vivendi-theme-syntax= | ||
| 442 | 421 | ||
| 443 | Possible values: | 422 | Possible values: |
| 444 | 423 | ||
| 445 | 1. =nil= (default) | 424 | 1. =nil= (default) |
| 446 | 2. =faint= | 425 | 2. ~faint~ |
| 447 | 3. =yellow-comments= | 426 | 3. ~yellow-comments~ |
| 448 | 4. =green-strings= | 427 | 4. ~green-strings~ |
| 449 | 5. =yellow-comments-green-strings= | 428 | 5. ~yellow-comments-green-strings~ |
| 450 | 6. =alt-syntax= | 429 | 6. ~alt-syntax~ |
| 451 | 7. =alt-syntax-yellow-comments= | 430 | 7. ~alt-syntax-yellow-comments~ |
| 431 | 8. ~faint-yellow-comments~ | ||
| 452 | 432 | ||
| 453 | The default style (nil) for code syntax highlighting is a balanced | 433 | The default style (nil) for code syntax highlighting is a balanced |
| 454 | combination of colors on the cyan-blue-magenta side of the spectrum. | 434 | combination of colors on the cyan-blue-magenta side of the spectrum. |
| 455 | There is little to no use of greens, yellows, or reds, except when it is | 435 | There is little to no use of greens, yellows, or reds, except when it is |
| 456 | necessary. | 436 | necessary. |
| 457 | 437 | ||
| 458 | Option =faint= is like the default in terms of the choice of palette but | 438 | Option ~faint~ is like the default in terms of the choice of palette but |
| 459 | applies desaturated color values. | 439 | applies desaturated color values. |
| 460 | 440 | ||
| 461 | Option =yellow-comments= applies a yellow tint to comments. The rest of | 441 | Option ~yellow-comments~ adds a yellow tint to comments. The rest of the |
| 462 | the syntax is the same as the default. | 442 | syntax is the same as the default. |
| 463 | 443 | ||
| 464 | Option =green-strings= replaces the blue/cyan/cold color variants in | 444 | Option ~green-strings~ replaces the blue/cyan/cold color variants in |
| 465 | strings with greener alternatives. The rest of the syntax remains the | 445 | strings with greener alternatives. The rest of the syntax remains the |
| 466 | same. | 446 | same. |
| 467 | 447 | ||
| 468 | Option =yellow-comments-green-strings= combines yellow comments with green | 448 | Option ~yellow-comments-green-strings~ combines yellow comments with green |
| 469 | strings and the rest of the default syntax highlighting style. | 449 | strings and the rest of the default syntax highlighting style. |
| 470 | 450 | ||
| 471 | Option =alt-syntax= expands the color palette and applies new color | 451 | Option ~alt-syntax~ expands the active spectrum by applying color |
| 472 | combinations. Strings are green. Doc strings are magenta tinted. | 452 | combinations with more contrasting hues between them. Expect to find |
| 473 | Comments are gray. | 453 | red and green variants in addition to cyan, blue, magenta. |
| 474 | 454 | ||
| 475 | Option =alt-syntax-yellow-comments= combines =alt-syntax= with | 455 | Option ~alt-syntax-yellow-comments~ combines ~alt-syntax~ with |
| 476 | =yellow-comments=. | 456 | ~yellow-comments~. |
| 477 | 457 | ||
| 478 | ** Option for no font mixing | 458 | Option ~faint-yellow-comments~ combines the ~faint~ style with |
| 479 | :PROPERTIES: | 459 | ~yellow-comments~. |
| 480 | :ALT_TITLE: No mixed fonts | ||
| 481 | :DESCRIPTION: Toggle mixing of font families | ||
| 482 | :CUSTOM_ID: h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b | ||
| 483 | :END: | ||
| 484 | 460 | ||
| 485 | Symbol names: | 461 | ** Option for no font mixing |
| 462 | :properties: | ||
| 463 | :alt_title: No mixed fonts | ||
| 464 | :description: Toggle mixing of font families | ||
| 465 | :custom_id: h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b | ||
| 466 | :end: | ||
| 467 | #+vindex: modus-themes-no-mixed-fonts | ||
| 486 | 468 | ||
| 487 | + =modus-operandi-theme-no-mixed-fonts= | 469 | Symbol: ~modus-themes-no-mixed-fonts~ |
| 488 | + =modus-vivendi-theme-no-mixed-fonts= | ||
| 489 | 470 | ||
| 490 | Possible values: | 471 | Possible values: |
| 491 | 472 | ||
| 492 | 1. =nil= (default) | 473 | 1. =nil= (default) |
| 493 | 2. =t= | 474 | 2. =t= |
| 494 | 475 | ||
| 495 | By default, the themes configure some spacing-sensitive faces, such as | 476 | By default, the themes configure some spacing-sensitive faces like Org |
| 496 | Org tables and code blocks, to always inherit from the =fixed-pitch= face. | 477 | tables and code blocks to always inherit from the ~fixed-pitch~ face. |
| 497 | This is to ensure that those constructs remain monospaced when users opt | 478 | This is to ensure that those constructs remain monospaced even when |
| 498 | for something like the built-in =M-x variable-pitch-mode=. Otherwise the | 479 | users opt for a mode that remaps typeface families, such as the built-in |
| 499 | layout would appear broken. To disable this behaviour, set the option | 480 | {{{kbd(M-x variable-pitch-mode)}}}. Otherwise the layout would appear |
| 500 | to =t=. | 481 | broken, due to how spacing is done. To disable this behaviour, set the |
| 482 | option to =t=. | ||
| 501 | 483 | ||
| 502 | Users may prefer to use another package for handling mixed typeface | 484 | Users may prefer to use another package for handling mixed typeface |
| 503 | configurations, rather than letting the theme do it, perhaps because a | 485 | configurations, rather than letting the theme do it, perhaps because a |
| 504 | purpose-specific package has extra functionality. Two possible options | 486 | purpose-specific package has extra functionality. Two possible options |
| 505 | are =org-variable-pitch= and =mixed-pitch=. | 487 | are ~org-variable-pitch~ and ~mixed-pitch~. |
| 506 | |||
| 507 | ** Option for no link underline (deprecated for ~0.14.0~) | ||
| 508 | :PROPERTIES: | ||
| 509 | :ALT_TITLE: Link underline | ||
| 510 | :DESCRIPTION: Toggle underlined text in links (deprecated for 0.14.0) | ||
| 511 | :CUSTOM_ID: h:a1a639e9-d247-414c-a0ad-08adadcbc6c1 | ||
| 512 | :END: | ||
| 513 | |||
| 514 | Note: deprecated ahead of version =0.14.0= ([[#h:c119d7b2-fcd4-4e44-890e-5e25733d5e52][Option for links]]). | ||
| 515 | |||
| 516 | Symbol names: | ||
| 517 | |||
| 518 | + =modus-operandi-theme-no-link-underline= | ||
| 519 | + =modus-vivendi-theme-no-link-underline= | ||
| 520 | |||
| 521 | Possible values: | ||
| 522 | |||
| 523 | 1. =nil= (default) | ||
| 524 | 2. =t= | ||
| 525 | 488 | ||
| 526 | Remove the underline effect from links, symbolic links, and buttons. | 489 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org (and others)]]. |
| 527 | The default is to apply an underline. | ||
| 528 | 490 | ||
| 529 | ** Option for links | 491 | ** Option for links |
| 530 | :PROPERTIES: | 492 | :properties: |
| 531 | :ALT_TITLE: Link styles | 493 | :alt_title: Link styles |
| 532 | :DESCRIPTION: Choose color intensity or no underline for links | 494 | :description: Choose among several styles, with or without underline |
| 533 | :CUSTOM_ID: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 | 495 | :custom_id: h:c119d7b2-fcd4-4e44-890e-5e25733d5e52 |
| 534 | :END: | 496 | :end: |
| 535 | 497 | #+vindex: modus-themes-links | |
| 536 | This option supersedes the "no link underline" one ahead of version | ||
| 537 | =0.14.0= ([[#h:a1a639e9-d247-414c-a0ad-08adadcbc6c1][Option for no link underline]]). | ||
| 538 | |||
| 539 | Symbol names: | ||
| 540 | 498 | ||
| 541 | + =modus-operandi-theme-links= | 499 | Symbol: ~modus-themes-links~ |
| 542 | + =modus-vivendi-theme-links= | ||
| 543 | 500 | ||
| 544 | Possible values: | 501 | Possible values: |
| 545 | 502 | ||
| 546 | 1. =nil= (default) | 503 | 1. =nil= (default) |
| 547 | 2. =faint= | 504 | 2. ~faint~ |
| 548 | 3. =neutral-underline= | 505 | 3. ~neutral-underline~ |
| 549 | 4. =faint-neutral-underline= | 506 | 4. ~faint-neutral-underline~ |
| 550 | 5. =no-underline= | 507 | 5. ~no-underline~ |
| 508 | 6. ~underline-only~ | ||
| 509 | 7. ~neutral-underline-only~ | ||
| 551 | 510 | ||
| 552 | The default style (nil) for links is to apply an underline and a | 511 | The default style (nil) for links is to apply an underline and a |
| 553 | saturated color to the affected text. The color of the two is the | 512 | saturated color to the affected text. The color of the two is the same, |
| 554 | same, which makes the link fairly prominent. | 513 | which makes the link fairly prominent. |
| 555 | 514 | ||
| 556 | Option =faint= follows the same approach as the default, but uses less | 515 | Option ~faint~ follows the same approach as the default, but uses less |
| 557 | intense colors. | 516 | intense colors. |
| 558 | 517 | ||
| 559 | Option =neutral-underline= changes the underline's color to a subtle | 518 | Option ~neutral-underline~ changes the underline's color to a subtle gray, |
| 560 | gray, while retaining the default text color. | 519 | while retaining the default text color. |
| 561 | 520 | ||
| 562 | Option =faint-neutral-underline= combines a desaturated text color with a | 521 | Option ~faint-neutral-underline~ combines a desaturated text color with a |
| 563 | subtle gray underline. | 522 | subtle gray underline. |
| 564 | 523 | ||
| 565 | Option =no-underline= removes link underlines altogether, while keeping | 524 | Option ~no-underline~ removes link underlines altogether, while retaining |
| 566 | their text color the same as the default. | 525 | their original fairly vivid color. |
| 567 | 526 | ||
| 568 | ** Option for command prompt styles | 527 | Option ~underline-only~ applies a prominent underline while making the |
| 569 | :PROPERTIES: | 528 | affected text colorless (it uses the same foreground as the theme's |
| 570 | :ALT_TITLE: Command prompts | 529 | default). |
| 571 | :DESCRIPTION: Choose among plain, subtle, or intense prompts | 530 | |
| 572 | :CUSTOM_ID: h:db5a9a7c-2928-4a28-b0f0-6f2b9bd52ba1 | 531 | Option ~neutral-underline-only~ makes the text colorless while using a |
| 573 | :END: | 532 | subtle gray underline below it. |
| 574 | 533 | ||
| 575 | Symbol names: | 534 | NOTE: The placement of the underline, i.e. its proximity to the affected |
| 535 | text, is controlled by the built-in ~x-underline-at-descent-line~, | ||
| 536 | ~x-use-underline-position-properties~, ~underline-minimum-offset~. Please | ||
| 537 | refer to their documentation strings. | ||
| 576 | 538 | ||
| 577 | + =modus-operandi-theme-prompts= | 539 | ** Option for command prompt styles |
| 578 | + =modus-vivendi-theme-prompts= | 540 | :properties: |
| 541 | :alt_title: Command prompts | ||
| 542 | :description: Choose among plain, subtle, or intense prompts | ||
| 543 | :custom_id: h:db5a9a7c-2928-4a28-b0f0-6f2b9bd52ba1 | ||
| 544 | :end: | ||
| 545 | #+vindex: modus-themes-prompts | ||
| 546 | |||
| 547 | Symbol: ~modus-themes-prompts~ | ||
| 579 | 548 | ||
| 580 | Possible values: | 549 | Possible values: |
| 581 | 550 | ||
| 582 | 1. =nil= (default) | 551 | 1. =nil= (default) |
| 583 | 2. =subtle= | 552 | 2. ~subtle-accented~ (~subtle~ exists for backward compatibility) |
| 584 | 3. =intense= | 553 | 3. ~intense-accented~ (~intense~ exists for backward compatibility) |
| 554 | 4. ~subtle-gray~ | ||
| 555 | 5. ~intense-gray~ | ||
| 585 | 556 | ||
| 586 | The symbols "subtle" and "intense" will apply a combination of accented | 557 | The default does not use any background for minibuffer and command line |
| 587 | background and foreground to the minibuffer and other REPL prompts (like | 558 | prompts. It relies exclusively on an accented foreground color. |
| 588 | =M-x shell= and =M-x eshell=). The difference between the two is that the | ||
| 589 | latter has a more pronounced/noticeable effect than the former. | ||
| 590 | 559 | ||
| 591 | The default does not use any background for such prompts, while relying | 560 | Options ~subtle-accented~ and ~intense-accented~ will change both the |
| 592 | exclusively on an accented foreground color. | 561 | background and the foreground values to use accented color combinations |
| 562 | that follow the hue of the default styles' foreground (e.g. the default | ||
| 563 | minibuffer prompt is cyan text, so these combinations will involved a | ||
| 564 | cyan background and an appropriate cyan foreground). The difference | ||
| 565 | between the two is that the latter has a more pronounced/noticeable | ||
| 566 | effect than the former. | ||
| 593 | 567 | ||
| 594 | ** Option for mode line presentation | 568 | Options ~subtle-gray~, ~intense-gray~ are like their accented counterparts, |
| 595 | :PROPERTIES: | 569 | except they use grayscale values. |
| 596 | :ALT_TITLE: Mode line | ||
| 597 | :DESCRIPTION: Choose among plain, three-dimension, or moody-compliant styles | ||
| 598 | :CUSTOM_ID: h:27943af6-d950-42d0-bc23-106e43f50a24 | ||
| 599 | :END: | ||
| 600 | 570 | ||
| 601 | Symbol names: | 571 | ** Option for mode line presentation |
| 572 | :properties: | ||
| 573 | :alt_title: Mode line | ||
| 574 | :description: Choose among several styles, with or without borders | ||
| 575 | :custom_id: h:27943af6-d950-42d0-bc23-106e43f50a24 | ||
| 576 | :end: | ||
| 577 | #+vindex: modus-themes-mode-line | ||
| 602 | 578 | ||
| 603 | + =modus-operandi-theme-mode-line= | 579 | Symbol: ~modus-themes-mode-line~ |
| 604 | + =modus-vivendi-theme-mode-line= | ||
| 605 | 580 | ||
| 606 | Possible values: | 581 | Possible values: |
| 607 | 582 | ||
| 608 | 1. =nil= (default) | 583 | 1. =nil= (default) |
| 609 | 2. =3d= | 584 | 2. ~3d~ |
| 610 | 3. =moody= | 585 | 3. ~moody~ |
| 611 | 586 | 4. ~borderless~ | |
| 612 | The default value (=nil=) produces a two-dimensional effect both for the | 587 | 5. ~borderless-3d~ |
| 613 | active and inactive modelines. The differences between the two are | 588 | 6. ~borderless-moody~ |
| 614 | limited to distinct shades of grayscale values, with the active being | 589 | |
| 615 | more intense than the inactive. | 590 | The default produces a two-dimensional effect both for the active and |
| 616 | 591 | inactive modelines. The differences between the two are limited to | |
| 617 | A =3d= symbol will make the active modeline look like a three-dimensional | 592 | distinct shades of grayscale values, with the active being more intense |
| 593 | than the inactive. | ||
| 594 | |||
| 595 | Option ~3d~ will make the active modeline look like a three-dimensional | ||
| 618 | rectangle. Inactive modelines remain 2D, though they are slightly toned | 596 | rectangle. Inactive modelines remain 2D, though they are slightly toned |
| 619 | down relative to the default. This aesthetic is the same as what you | 597 | down relative to the default. This aesthetic is virtually the same as |
| 620 | get when you run Emacs without any customizations (=emacs -Q= on the | 598 | what you get when you run Emacs without any customizations (=emacs -Q= on |
| 621 | command line). | 599 | the command line). |
| 622 | 600 | ||
| 623 | While =moody= removes all box effects from the modelines and applies | 601 | While ~moody~ removes all box effects from the modelines and applies |
| 624 | underline and overline properties instead. It also tones down a bit the | 602 | underline and overline properties instead. It also tones down a bit the |
| 625 | inactive modelines. This is meant to optimize things for use with the | 603 | inactive modelines. This is meant to optimize things for use with the |
| 626 | [[https://github.com/tarsius/moody][moody package]] (hereinafter referred to as "Moody"), though it can work | 604 | [[https://github.com/tarsius/moody][moody package]] (hereinafter referred to as "Moody"), though it can work |
| 627 | fine even without it. | 605 | fine even without it. |
| 628 | 606 | ||
| 607 | The ~borderless~ option uses the same colors as the default (nil value), | ||
| 608 | but removes the border effect. This is done by making the box property | ||
| 609 | use the same color as the background, effectively blending the two and | ||
| 610 | creating some padding. | ||
| 611 | |||
| 612 | The ~borderless-3d~ and ~borderless-moody~ approximate the ~3d~ and ~moody~ | ||
| 613 | options respectively, while removing the borders. However, to ensure | ||
| 614 | that the inactive modelines remain visible, they apply a slightly more | ||
| 615 | prominent background to them than what their counterparts do (same | ||
| 616 | inactive background as with the default). | ||
| 617 | |||
| 629 | Note that Moody does not expose any faces that the themes could style | 618 | Note that Moody does not expose any faces that the themes could style |
| 630 | directly. Instead it re-purposes existing ones to render its tabs and | 619 | directly. Instead it re-purposes existing ones to render its tabs and |
| 631 | ribbons. As such, there may be cases where the contrast ratio falls | 620 | ribbons. As such, there may be cases where the contrast ratio falls |
| 632 | below the 7:1 target that the themes conform with (WCAG AAA). To hedge | 621 | below the 7:1 target that the themes conform with (WCAG AAA). To hedge |
| 633 | against this, we configure a fallback foreground for the =moody= option, | 622 | against this, we configure a fallback foreground for the ~moody~ option, |
| 634 | which will come into effect when the background of the modeline changes | 623 | which will come into effect when the background of the modeline changes |
| 635 | to something less accessible, such as Moody ribbons (read the doc string | 624 | to something less accessible, such as Moody ribbons (read the doc string |
| 636 | of =set-face-attribute=, specifically =:distant-foreground=). This fallback | 625 | of ~set-face-attribute~, specifically ~:distant-foreground~). This fallback |
| 637 | comes into effect when Emacs determines that the background and | 626 | is activated when Emacs determines that the background and foreground of |
| 638 | foreground of the given construct are too close to each other in terms | 627 | the given construct are too close to each other in terms of color |
| 639 | of color distance. In effect, users would need to experiment with the | 628 | distance. In effect, users would need to experiment with the variable |
| 640 | variable =face-near-same-color-threshold= to trigger the fallback color. | 629 | ~face-near-same-color-threshold~ to trigger the effect. We find that a |
| 641 | We find that a value of =45000= would suffice, contrary to the default | 630 | value of =45000= will suffice, contrary to the default =30000=. Do not set |
| 642 | =30000=. Do not set the value too high, because that would have the | 631 | the value too high, because that would have the adverse effect of always |
| 643 | adverse effect of always overriding the default color (which has been | 632 | overriding the default color (which has been carefully designed to be |
| 644 | carefully designed to be highly accessible). | 633 | highly accessible). |
| 645 | 634 | ||
| 646 | Furthermore, because Moody expects an underline and overline instead of | 635 | Furthermore, because Moody expects an underline and overline instead of |
| 647 | a box style, it is recommended you also include this in your setup: | 636 | a box style, it is advised you include this in your setup: |
| 648 | 637 | ||
| 649 | #+begin_src emacs-lisp | 638 | #+begin_src emacs-lisp |
| 650 | (setq x-underline-at-descent-line t) | 639 | (setq x-underline-at-descent-line t) |
| 651 | #+end_src | 640 | #+end_src |
| 652 | 641 | ||
| 653 | ** Option for completion framework aesthetics | 642 | ** Option for completion framework aesthetics |
| 654 | :PROPERTIES: | 643 | :properties: |
| 655 | :ALT_TITLE: Completion UIs | 644 | :alt_title: Completion UIs |
| 656 | :DESCRIPTION: Choose among standard, moderate, or opinionated looks | 645 | :description: Choose among standard, moderate, or opinionated looks |
| 657 | :CUSTOM_ID: h:f1c20c02-7b34-4c35-9c65-99170efb2882 | 646 | :custom_id: h:f1c20c02-7b34-4c35-9c65-99170efb2882 |
| 658 | :END: | 647 | :end: |
| 659 | 648 | #+vindex: modus-themes-completions | |
| 660 | Symbol names: | ||
| 661 | 649 | ||
| 662 | + =modus-operandi-theme-completions= | 650 | Symbol: ~modus-themes-completions~ |
| 663 | + =modus-vivendi-theme-completions= | ||
| 664 | 651 | ||
| 665 | Possible values: | 652 | Possible values: |
| 666 | 653 | ||
| 667 | 1. =nil= (default) | 654 | 1. =nil= (default) |
| 668 | 2. =moderate= | 655 | 2. ~moderate~ |
| 669 | 3. =opinionated= | 656 | 3. ~opinionated~ |
| 670 | 657 | ||
| 671 | This is a special option that has different effects depending on the | 658 | This is a special option that has different effects depending on the |
| 672 | completion UI. The interfaces can be grouped in two categories, based | 659 | completion UI. The interfaces can be grouped in two categories, based |
| @@ -679,512 +666,1008 @@ Ivy, and similar. | |||
| 679 | 666 | ||
| 680 | A value of =nil= will respect the metaphors of each completion framework. | 667 | A value of =nil= will respect the metaphors of each completion framework. |
| 681 | 668 | ||
| 682 | The symbol =moderate= will apply a combination of background and | 669 | Option ~moderate~ applies a combination of background and foreground that |
| 683 | foreground that is fairly subtle. For Icomplete and friends this | 670 | is fairly subtle. For Icomplete and friends this constitutes a |
| 684 | constitutes a departure from their default aesthetics, however the | 671 | departure from their default aesthetics, however the difference is |
| 685 | difference is small. While Helm et al will appear slightly different | 672 | small. While Helm, Ivy et al appear slightly different than their |
| 686 | than their original looks, as they are toned down a bit. | 673 | original looks, as they are toned down a bit. |
| 687 | 674 | ||
| 688 | The symbol =opinionated= will apply color combinations that refashion the | 675 | Option ~opinionated~ uses color combinations that refashion the completion |
| 689 | completion UI. For the Icomplete camp this means that intense | 676 | UI. For the Icomplete camp this means that intense background and |
| 690 | background and foreground combinations are used: in effect their looks | 677 | foreground combinations are used: in effect their looks emulate those of |
| 691 | emulate those of Ivy and co. in their original style. Whereas the other | 678 | Helm, Ivy and co. in their original style. Whereas the other group of |
| 692 | group of packages will revert to an even more nuanced aesthetic with | 679 | packages will revert to an even more nuanced aesthetic with some |
| 693 | some additional changes to the choice of hues. | 680 | additional changes to the choice of hues. |
| 694 | 681 | ||
| 695 | To appreciate the scope of this customization option, you should spend | 682 | To appreciate the scope of this customization option, you should spend |
| 696 | some time with every one of the =nil= (default), =moderate=, and =opinionated= | 683 | some time with every one of the =nil= (default), ~moderate~, and ~opinionated~ |
| 697 | possibilities. | 684 | possibilities. |
| 698 | 685 | ||
| 699 | ** Option for fringe visibility | 686 | ** Option for fringe visibility |
| 700 | :PROPERTIES: | 687 | :properties: |
| 701 | :ALT_TITLE: Fringes | 688 | :alt_title: Fringes |
| 702 | :DESCRIPTION: Choose among plain, subtle, or intense fringe visibility | 689 | :description: Choose among invisible, subtle, or intense fringe styles |
| 703 | :CUSTOM_ID: h:1983c3fc-74f6-44f3-b917-967c403bebae | 690 | :custom_id: h:1983c3fc-74f6-44f3-b917-967c403bebae |
| 704 | :END: | 691 | :end: |
| 692 | #+vindex: modus-themes-fringes | ||
| 705 | 693 | ||
| 706 | Symbol names: | 694 | Symbol: ~modus-themes-fringes~ |
| 707 | |||
| 708 | + =modus-operandi-theme-fringes= | ||
| 709 | + =modus-vivendi-theme-fringes= | ||
| 710 | 695 | ||
| 711 | Possible values: | 696 | Possible values: |
| 712 | 697 | ||
| 713 | 1. =nil= (default) | 698 | 1. =nil= (default) |
| 714 | 2. =subtle= | 699 | 2. ~subtle~ |
| 715 | 3. =intense= | 700 | 3. ~intense~ |
| 716 | |||
| 717 | The "subtle" symbol will apply a grayscale background that is visible, | ||
| 718 | yet close enough to the main background color. While the "intense" | ||
| 719 | symbol will use a more noticeable grayscale background. | ||
| 720 | 701 | ||
| 721 | The default is to use the same color as that of the main background, | 702 | The default is to use the same color as that of the main background, |
| 722 | meaning that the fringes are not obvious though they still occupy the | 703 | meaning that the fringes are not obvious though they still occupy the |
| 723 | space given to them by =fringe-mode=. | 704 | space given to them by ~fringe-mode~. |
| 724 | 705 | ||
| 725 | ** Option for line highlighting (hl-line-mode) | 706 | Options ~subtle~ and ~intense~ apply a gray background, making the fringes |
| 726 | :PROPERTIES: | 707 | visible. The difference between the two is one of degree, as their |
| 727 | :ALT_TITLE: Line highlighting | 708 | names imply. |
| 728 | :DESCRIPTION: Toggle intense style for current line highlighting | ||
| 729 | :CUSTOM_ID: h:1dba1cfe-d079-4c13-a810-f768e8789177 | ||
| 730 | :END: | ||
| 731 | 709 | ||
| 732 | Symbol names: | 710 | ** Option for language checkers |
| 711 | :properties: | ||
| 712 | :alt_title: Language checkers | ||
| 713 | :description: Control the style of language checkers/linters | ||
| 714 | :custom_id: h:4b13743a-8ebf-4d2c-a043-cceba10b1eb4 | ||
| 715 | :end: | ||
| 716 | #+vindex: modus-themes-lang-checkers | ||
| 733 | 717 | ||
| 734 | + =modus-operandi-theme-intense-hl-line= | 718 | Symbol: ~modus-themes-lang-checkers~ |
| 735 | + =modus-vivendi-theme-intense-hl-line= | 719 | |
| 720 | Possible values: | ||
| 721 | |||
| 722 | 1. =nil= (default) | ||
| 723 | 2. ~subtle-foreground~ | ||
| 724 | 3. ~intense-foreground~ | ||
| 725 | 4. ~straight-underline~ | ||
| 726 | 5. ~subtle-foreground-straight-underline~ | ||
| 727 | 6. ~intense-foreground-straight-underline~ | ||
| 728 | 7. ~colored-background~ | ||
| 729 | |||
| 730 | Nil (the default) applies a color-coded underline to the affected text, | ||
| 731 | while it leaves the original foreground in tact. If the display spec | ||
| 732 | where Emacs runs in has support for it (e.g. Emacs GUI), the underline's | ||
| 733 | style is that of a wave, otherwise it is a straight line. | ||
| 734 | |||
| 735 | Options ~subtle-foreground~ and ~intense-foreground~ follow the same | ||
| 736 | color-coding pattern and wavy underline of the default, while extending | ||
| 737 | it with a corresponding foreground value for the affected text. The | ||
| 738 | difference between the two options is one of degree, as their names | ||
| 739 | suggest. | ||
| 740 | |||
| 741 | Option ~straight-underline~ is like the default but always applies a | ||
| 742 | straight line under the affected text. Same principle for | ||
| 743 | ~subtle-foreground-straight-underline~ and its counterpart | ||
| 744 | ~intense-foreground-straight-underline~. | ||
| 745 | |||
| 746 | Option ~colored-background~ uses a straight underline, a tinted | ||
| 747 | background, and a suitable foreground. All are color-coded. This is | ||
| 748 | the most intense combination of face properties. | ||
| 749 | |||
| 750 | The present variable affects packages and/or face groups such as those | ||
| 751 | of =flyspell=, =flymake=, =flycheck=, ~artbollocks-mode~, and ~writegood-mode~. | ||
| 752 | |||
| 753 | NOTE: The placement of the straight underline, though not the wave | ||
| 754 | style, is controlled by the built-in ~x-underline-at-descent-line~, | ||
| 755 | ~x-use-underline-position-properties~, ~underline-minimum-offset~. Please | ||
| 756 | refer to their documentation strings. | ||
| 757 | |||
| 758 | ** Option for line highlighting (hl-line-mode) | ||
| 759 | :properties: | ||
| 760 | :alt_title: Line highlighting | ||
| 761 | :description: Toggle intense style for current line highlighting | ||
| 762 | :custom_id: h:1dba1cfe-d079-4c13-a810-f768e8789177 | ||
| 763 | :end: | ||
| 764 | #+vindex: modus-themes-intense-hl-line | ||
| 765 | |||
| 766 | Symbol: ~modus-themes-intense-hl-line~ | ||
| 736 | 767 | ||
| 737 | Possible values: | 768 | Possible values: |
| 738 | 769 | ||
| 739 | 1. =nil= (default) | 770 | 1. =nil= (default) |
| 740 | 2. =t= | 771 | 2. =t= |
| 741 | 772 | ||
| 742 | Draw the current line of =hl-line-mode= or its global equivalent in a more | 773 | The default is to use a subtle gray background for ~hl-line-mode~ and its |
| 743 | prominent background color. This would also affect several packages | 774 | global equivalent. |
| 744 | that enable =hl-line-mode=, such as =elfeed= and =mu4e=. | ||
| 745 | 775 | ||
| 746 | The default is to use a more subtle gray. | 776 | With a non-nil value (=t=) use a more prominent background color instead. |
| 777 | |||
| 778 | This affects several packages that enable ~hl-line-mode~, such as =elfeed= | ||
| 779 | and =mu4e=. | ||
| 780 | |||
| 781 | ** Option for line numbers (display-line-numbers-mode) | ||
| 782 | :properties: | ||
| 783 | :alt_title: Line numbers | ||
| 784 | :description: Toggle subtle style for line numbers | ||
| 785 | :custom_id: h:8c4a6230-2e43-4aa2-a631-3b7179392e09 | ||
| 786 | :end: | ||
| 787 | #+vindex: modus-themes-subtle-line-numbers | ||
| 788 | |||
| 789 | Symbol: ~modus-themes-subtle-line-numbers~ | ||
| 790 | |||
| 791 | Possible value: | ||
| 792 | |||
| 793 | 1. =nil= (default) | ||
| 794 | 2. =t= | ||
| 795 | |||
| 796 | The default style for ~display-line-numbers-mode~ and its global variant | ||
| 797 | is to apply a subtle gray background to the line numbers. The current | ||
| 798 | line has a more pronounced background and foreground combination to | ||
| 799 | bring more attention to itself. | ||
| 800 | |||
| 801 | Similarly, the faces for ~display-line-numbers-major-tick~ and its | ||
| 802 | counterpart ~display-line-numbers-minor-tick~ use appropriate styles that | ||
| 803 | involve a bespoke background and foreground combination. | ||
| 804 | |||
| 805 | With a non-nil value (=t=), line numbers have no background of their own. | ||
| 806 | Instead they retain the primary background of the theme, blending with | ||
| 807 | the rest of the buffer. Foreground values for all relevant faces are | ||
| 808 | updated to accommodate this aesthetic. | ||
| 747 | 809 | ||
| 748 | ** Option for parenthesis matching (show-paren-mode) | 810 | ** Option for parenthesis matching (show-paren-mode) |
| 749 | :PROPERTIES: | 811 | :properties: |
| 750 | :ALT_TITLE: Matching parentheses | 812 | :alt_title: Matching parentheses |
| 751 | :DESCRIPTION: Toggle intense style for matching delimiters/parentheses | 813 | :description: Choose between various styles for matching delimiters/parentheses |
| 752 | :CUSTOM_ID: h:e66a7e4d-a512-4bc7-9f86-fbbb5923bf37 | 814 | :custom_id: h:e66a7e4d-a512-4bc7-9f86-fbbb5923bf37 |
| 753 | :END: | 815 | :end: |
| 816 | #+vindex: modus-themes-paren-match | ||
| 817 | |||
| 818 | Symbol: ~modus-themes-paren-match~ | ||
| 819 | |||
| 820 | Possible values: | ||
| 821 | |||
| 822 | 1. =nil= (default) | ||
| 823 | 2. ~subtle-bold~ | ||
| 824 | 3. ~intense~ | ||
| 825 | 4. ~intense-bold~ | ||
| 754 | 826 | ||
| 755 | Symbol names: | 827 | Nil means to use a subtle tinted background color for the matching |
| 828 | delimiters. | ||
| 756 | 829 | ||
| 757 | + =modus-operandi-theme-intense-paren-match= | 830 | Option ~intense~ applies a saturated background color. |
| 758 | + =modus-vivendi-theme-intense-paren-match= | 831 | |
| 832 | Option ~subtle-bold~ is the same as the default, but also makes use of | ||
| 833 | bold typographic weight (inherits the ~bold~ face). | ||
| 834 | |||
| 835 | Option ~intense-bold~ is the same as ~intense~, while it also uses a bold | ||
| 836 | weight. | ||
| 837 | |||
| 838 | This customization variable affects tools such as the built-in | ||
| 839 | ~show-paren-mode~ and the =smartparens= package. | ||
| 840 | |||
| 841 | ** Option for active region | ||
| 842 | :properties: | ||
| 843 | :alt_title: Active region | ||
| 844 | :description: Choose between various styles for the active region | ||
| 845 | :custom_id: h:60798063-b4ad-45ea-b9a7-ff7b5c0ab74c | ||
| 846 | :end: | ||
| 847 | #+vindex: modus-themes-region | ||
| 848 | |||
| 849 | Symbol: ~modus-themes-region~ | ||
| 759 | 850 | ||
| 760 | Possible values: | 851 | Possible values: |
| 761 | 852 | ||
| 762 | 1. =nil= (default) | 853 | 1. =nil= (default) |
| 763 | 2. =t= | 854 | 2. ~no-extend~ |
| 855 | 3. ~bg-only~ | ||
| 856 | 4. ~bg-only-no-extend~ | ||
| 764 | 857 | ||
| 765 | Apply a more intense background to the matching parentheses (or | 858 | Nil means to only use a prominent gray background with a neutral |
| 766 | delimiters). This affects tools such as the built-in =show-paren-mode=. | 859 | foreground. The foreground overrides all syntax highlighting. The |
| 767 | The default is to use a subtle warm color for the background of those | 860 | region extends to the edge of the window. |
| 768 | overlays. | ||
| 769 | 861 | ||
| 770 | ** Option for diff buffer looks | 862 | Option ~no-extend~ preserves the default aesthetic but prevents the region |
| 771 | :PROPERTIES: | 863 | from extending to the edge of the window. |
| 772 | :ALT_TITLE: Diffs | 864 | |
| 773 | :DESCRIPTION: Choose among intense, desaturated, or text-only diffs | 865 | Option ~bg-only~ applies a faint tinted background that is distinct from |
| 774 | :CUSTOM_ID: h:ea7ac54f-5827-49bd-b09f-62424b3b6427 | 866 | all others used in the theme, while it does not override any existing |
| 775 | :END: | 867 | colors. It extends to the edge of the window. |
| 868 | |||
| 869 | Option ~bg-only-no-extend~ is a combination of the ~bg-only~ and ~no-extend~ | ||
| 870 | options. | ||
| 776 | 871 | ||
| 777 | Symbol names: | 872 | ** Option for diff buffer looks |
| 873 | :properties: | ||
| 874 | :alt_title: Diffs | ||
| 875 | :description: Choose among intense, desaturated, or text-only diffs | ||
| 876 | :custom_id: h:ea7ac54f-5827-49bd-b09f-62424b3b6427 | ||
| 877 | :end: | ||
| 878 | #+vindex: modus-themes-diffs | ||
| 778 | 879 | ||
| 779 | + =modus-operandi-theme-diffs= | 880 | Symbol: ~modus-themes-diffs~ |
| 780 | + =modus-vivendi-theme-diffs= | ||
| 781 | 881 | ||
| 782 | Possible values: | 882 | Possible values: |
| 783 | 883 | ||
| 784 | 1. =nil= (default) | 884 | 1. =nil= (default) |
| 785 | 2. =desaturated= | 885 | 2. ~desaturated~ |
| 786 | 2. =fg-only= | 886 | 3. ~fg-only~ |
| 787 | 887 | 4. ~bg-only~ | |
| 788 | By default the themes will apply richly colored backgrounds to the | 888 | 5. ~deuteranopia~ |
| 789 | output of diffs, such as those of =diff-mode=, =ediff=, =smerge-mode=, and | 889 | |
| 790 | =magit=. These are color combinations of an accented background and | 890 | By default the themes apply rich coloration to the output of diffs, such |
| 791 | foreground so that, for example, added lines have a pronounced green | 891 | as those of ~diff-mode~, ~ediff~, ~smerge-mode~, and Magit. These are |
| 792 | background with an appropriate shade of green for the affected text. | 892 | color combinations of an accented background and foreground so that, for |
| 793 | Word-wise or "refined" changes follow this pattern but use different | 893 | example, added lines have a pronounced green background with an |
| 794 | shades of those colors to remain distinct. | 894 | appropriate shade of green for the affected text. Word-wise or |
| 795 | 895 | "refined" changes follow this pattern but use different shades of those | |
| 796 | A =desaturated= value tones down all relevant color values. It still | 896 | colors to remain distinct. |
| 897 | |||
| 898 | Option ~desaturated~ tones down all relevant color values. It still | ||
| 797 | combines an accented background with an appropriate foreground, yet its | 899 | combines an accented background with an appropriate foreground, yet its |
| 798 | overall impression is very subtle. Refined changes are a bit more | 900 | overall impression is fairly subtle. Refined changes are a bit more |
| 799 | intense to fulfil their intended function, though still less saturated | 901 | intense to fulfil their intended function, though still less saturated |
| 800 | than default. | 902 | than default. |
| 801 | 903 | ||
| 802 | While =fg-only= will remove all accented backgrounds and instead rely on | 904 | Option ~fg-only~ will remove most accented backgrounds and instead rely |
| 803 | color-coded text to denote changes. For instance, added lines use an | 905 | on color-coded text to denote changes. For instance, added lines use a |
| 804 | intense green foreground, while their background is the same as the rest | 906 | green foreground, while their background is the same as the rest of the |
| 805 | of the buffer. Word-wise highlights still use a background value which | 907 | buffer. Word-wise highlights still use a background value which is, |
| 806 | is, nonetheless, more subtle than its default equivalent. | 908 | nonetheless, more subtle than its default equivalent. |
| 807 | 909 | ||
| 808 | Concerning =magit=, an extra set of tweaks are introduced for the effect | 910 | Option ~bg-only~ applies color-coded backgrounds but does not override |
| 809 | of highlighting the current diff hunk, so as to remain consistent with | 911 | any syntax highlighting that may be present. This makes it suitable for |
| 810 | the overall experience of that mode. Expect changes that are consistent | 912 | use with a non-nil value for ~diff-font-lock-syntax~ (which is the |
| 811 | with the overall intent of the aforementioned. | 913 | default for ~diff-mode~ buffers in Emacs 27 or higher). |
| 914 | |||
| 915 | Option ~deuteranopia~ optimizes for red-green color deficiency. It | ||
| 916 | replaces all instances of green with blue variants. This is to ensure | ||
| 917 | that indicators for "removed" and "added" states are not mistaken for | ||
| 918 | each other. | ||
| 919 | |||
| 920 | Concerning Magit, an extra set of tweaks are introduced for the effect | ||
| 921 | of highlighting the current diff hunk, so as to remain aligned with the | ||
| 922 | overall experience of that mode. Expect changes that are consistent | ||
| 923 | with the overall intent of the aforementioned. Note, however, that the | ||
| 924 | ~bg-only~ option will not deliver the intended results in Magit diffs | ||
| 925 | because no syntax highlighting is used there (last checked with Magit | ||
| 926 | version 20201116.1057, though upstream has a plan to eventually support | ||
| 927 | such a feature---this entry shall be updated accordingly). | ||
| 812 | 928 | ||
| 813 | ** Option for org-mode block styles | 929 | ** Option for org-mode block styles |
| 814 | :PROPERTIES: | 930 | :properties: |
| 815 | :ALT_TITLE: Org mode blocks | 931 | :alt_title: Org mode blocks |
| 816 | :DESCRIPTION: Choose among plain, grayscale, or rainbow styles | 932 | :description: Choose among plain, grayscale, or rainbow styles |
| 817 | :CUSTOM_ID: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2 | 933 | :custom_id: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2 |
| 818 | :END: | 934 | :end: |
| 819 | 935 | #+vindex: modus-themes-org-blocks | |
| 820 | Symbol names: | ||
| 821 | 936 | ||
| 822 | + =modus-operandi-theme-org-blocks= | 937 | Symbol: ~modus-themes-org-blocks~ |
| 823 | + =modus-vivendi-theme-org-blocks= | ||
| 824 | 938 | ||
| 825 | Possible values: | 939 | Possible values: |
| 826 | 940 | ||
| 827 | 1. =nil= (default) | 941 | 1. =nil= (default) |
| 828 | 2. =grayscale= | 942 | 2. ~grayscale~ |
| 829 | 3. =rainbow= | 943 | 3. ~rainbow~ |
| 830 | 944 | ||
| 831 | The default is to use the same background as the rest of the buffer for | 945 | The default is to use the same background as the rest of the buffer for |
| 832 | the contents of the block. | 946 | the contents of the block. |
| 833 | 947 | ||
| 834 | A value of =grayscale= will apply a subtle neutral gray background to the | 948 | Option ~grayscale~ applies a subtle neutral gray background to the block's |
| 835 | block's contents. It will also extend to the edge of the window the | 949 | contents. It will also extend to the edge of the window the background |
| 836 | background of the "begin" and "end" block delimiter lines (only relevant | 950 | of the "begin" and "end" block delimiter lines (only relevant for Emacs |
| 837 | for Emacs versions >= 27 where the 'extend' keyword is recognised by | 951 | versions >= 27 where the 'extend' keyword is part of the face |
| 838 | =set-face-attribute=). | 952 | specifications). |
| 839 | 953 | ||
| 840 | While =rainbow= will instead use an accented background for the contents | 954 | Option ~rainbow~ uses an accented background for the contents of the |
| 841 | of the block. The exact color will depend on the programming language | 955 | block. The exact color will depend on the programming language and is |
| 842 | and is controlled by the =org-src-block-faces= variable (refer to the | 956 | controlled by the ~org-src-block-faces~ variable. This is most suitable |
| 843 | theme's source code for the current association list). This is most | 957 | for users who work on literate programming documents that mix and match |
| 844 | suitable for users who work on literate programming documents that mix | 958 | several languages. |
| 845 | and match several languages. | ||
| 846 | 959 | ||
| 847 | Note that the "rainbow" blocks may require you to also reload the | 960 | Note that the "rainbow" blocks may require you to also reload the |
| 848 | major-mode so that the colors are applied properly: use =M-x org-mode= or | 961 | major-mode so that the colors are applied consistently throughout: use |
| 849 | =M-x org-mode-restart= to refresh the buffer. Or start typing in each | 962 | {{{kbd(M-x org-mode)}}} or {{{kbd(M-x org-mode-restart)}}} to refresh the buffer. |
| 850 | code block (inefficient at scale, but it still works). | 963 | Or start typing in each code block (inefficient at scale, but it still |
| 964 | works). | ||
| 851 | 965 | ||
| 852 | ** Option for headings' overall style | 966 | ** Option for org-habit graph styles |
| 853 | :PROPERTIES: | 967 | :properties: |
| 854 | :ALT_TITLE: Heading styles | 968 | :alt_title: Org agenda habits |
| 855 | :DESCRIPTION: Choose among several styles, also per heading level | 969 | :description: Choose among standard, simplified, or traffic light styles |
| 856 | :CUSTOM_ID: h:271eff19-97aa-4090-9415-a6463c2f9ae1 | 970 | :custom_id: h:b7e328c0-3034-4db7-9cdf-d5ba12081ca2 |
| 857 | :END: | 971 | :end: |
| 972 | #+vindex: modus-themes-org-habit | ||
| 973 | |||
| 974 | Symbol: ~modus-themes-org-habit~ | ||
| 975 | |||
| 976 | Possible values: | ||
| 977 | |||
| 978 | 1. =nil= (default) | ||
| 979 | 2. ~simplified~ | ||
| 980 | 3. ~traffic-light~ | ||
| 981 | |||
| 982 | The default is meant to conform with the original aesthetic of | ||
| 983 | =org-habit=. It employs all four color codes that correspond to the | ||
| 984 | org-habit states---clear, ready, alert, and overdue---while | ||
| 985 | distinguishing between their present and future variants. This results | ||
| 986 | in a total of eight colors in use: red, yellow, green, blue, in tinted | ||
| 987 | and shaded versions. They cover the full set of information provided by | ||
| 988 | the =org-habit= consistency graph. | ||
| 989 | |||
| 990 | Option ~simplified~ is like the default except that it removes the | ||
| 991 | dichotomy between current and future variants by applying uniform | ||
| 992 | color-coded values. It applies a total of four colors: red, yellow, | ||
| 993 | green, blue. They produce a simplified consistency graph that is more | ||
| 994 | legible (or less "busy") than the default. The intent is to shift focus | ||
| 995 | towards the distinction between the four states of a habit task, rather | ||
| 996 | than each state's present/future outlook. | ||
| 997 | |||
| 998 | Option ~traffic-light~ further reduces the available colors to red, | ||
| 999 | yellow, and green. As in ~simplified~, present and future variants appear | ||
| 1000 | uniformly, but differently from it, the 'clear' state is rendered in a | ||
| 1001 | green hue, instead of the original blue. This is meant to capture the | ||
| 1002 | use-case where a habit task being "too early" is less important than it | ||
| 1003 | being "too late". The difference between ready and clear states is | ||
| 1004 | attenuated by painting both of them using shades of green. This option | ||
| 1005 | thus highlights the alert and overdue states. | ||
| 1006 | |||
| 1007 | ** Option for the headings' overall style | ||
| 1008 | :properties: | ||
| 1009 | :alt_title: Heading styles | ||
| 1010 | :description: Choose among several styles, also per heading level | ||
| 1011 | :custom_id: h:271eff19-97aa-4090-9415-a6463c2f9ae1 | ||
| 1012 | :end: | ||
| 1013 | #+vindex: modus-themes-headings | ||
| 858 | 1014 | ||
| 859 | This is defined as an alist and, therefore, uses a different approach | 1015 | This is defined as an alist and, therefore, uses a different approach |
| 860 | than other customization options documented in this manual. | 1016 | than other customization options documented in this manual. |
| 861 | 1017 | ||
| 862 | Symbol names: | 1018 | Symbol: ~modus-themes-headings~ |
| 863 | |||
| 864 | + =modus-operandi-theme-headings= | ||
| 865 | + =modus-vivendi-theme-headings= | ||
| 866 | 1019 | ||
| 867 | Possible values, which can be specified for each heading level (examples | 1020 | Possible values, which can be specified for each heading level (examples |
| 868 | further below): | 1021 | further below): |
| 869 | 1022 | ||
| 870 | + nil (default fallback option---covers all heading levels) | 1023 | + nil (default fallback option---covers all heading levels) |
| 871 | + =t= (default style for a single heading, when the fallback differs) | 1024 | + =t= (default style for a single heading, when the fallback differs) |
| 872 | + =no-bold= | 1025 | + ~no-bold~ |
| 873 | + =line= | 1026 | + ~line~ |
| 874 | + =line-no-bold= | 1027 | + ~line-no-bold~ |
| 875 | + =rainbow= | 1028 | + ~rainbow~ |
| 876 | + =rainbow-line= | 1029 | + ~rainbow-line~ |
| 877 | + =rainbow-line-no-bold= | 1030 | + ~rainbow-line-no-bold~ |
| 878 | + =highlight= | 1031 | + ~highlight~ |
| 879 | + =highlight-no-bold= | 1032 | + ~highlight-no-bold~ |
| 880 | + =rainbow-highlight= | 1033 | + ~rainbow-highlight~ |
| 881 | + =rainbow-highlight-no-bold= | 1034 | + ~rainbow-highlight-no-bold~ |
| 882 | + =section= | 1035 | + ~section~ |
| 883 | + =section-no-bold= | 1036 | + ~section-no-bold~ |
| 884 | + =rainbow-section= | 1037 | + ~rainbow-section~ |
| 885 | + =rainbow-section-no-bold= | 1038 | + ~rainbow-section-no-bold~ |
| 886 | 1039 | + ~no-color~ | |
| 887 | To control faces per level from 1-8, use something like this (same for | 1040 | + ~no-color-no-bold~ |
| 888 | =modus-vivendi-theme-headings=): | 1041 | |
| 1042 | To control faces per level from 1-8, use something like this: | ||
| 889 | 1043 | ||
| 890 | #+begin_src emacs-lisp | 1044 | #+begin_src emacs-lisp |
| 891 | (setq modus-operandi-theme-headings | 1045 | (setq modus-themes-headings |
| 892 | '((1 . section) | 1046 | '((1 . section) |
| 893 | (2 . line) | 1047 | (2 . section-no-bold) |
| 894 | (3 . highlight) | 1048 | (3 . rainbow-line) |
| 895 | (t . rainbow-no-bold))) | 1049 | (t . rainbow-line-no-bold))) |
| 896 | #+end_src | 1050 | #+end_src |
| 897 | 1051 | ||
| 898 | The above uses the =section= value for heading levels 1, the =line= for | 1052 | The above uses the ~section~ value for heading levels 1, ~section-no-bold~ |
| 899 | headings 2, =highlight= for 3. All other levels fall back to | 1053 | for headings 2, ~rainbow-line~ for 3. All other levels fall back to |
| 900 | =rainbow-line-no-bold=. | 1054 | ~rainbow-line-no-bold~. |
| 901 | 1055 | ||
| 902 | To set a uniform value for all heading levels, use this pattern: | 1056 | To set a uniform value for all heading levels, use this pattern: |
| 903 | 1057 | ||
| 904 | #+begin_src emacs-lisp | 1058 | #+begin_src emacs-lisp |
| 905 | ;; A given style for every heading | 1059 | ;; A given style for every heading |
| 906 | (setq modus-operandi-theme-headings | 1060 | (setq modus-themes-headings |
| 907 | '((t . rainbow-line-no-bold))) | 1061 | '((t . section))) |
| 908 | 1062 | ||
| 909 | ;; Default aesthetic for every heading | 1063 | ;; Default aesthetic for every heading |
| 910 | (setq modus-operandi-theme-headings | 1064 | (setq modus-themes-headings |
| 911 | '((t . nil))) | 1065 | '()) |
| 912 | #+end_src | 1066 | #+end_src |
| 913 | 1067 | ||
| 914 | The default style for headings uses a fairly desaturated foreground | 1068 | The default style for headings uses a fairly desaturated foreground |
| 915 | value in combination with a bold typographic weight. To specify this | 1069 | value in combination with bold typographic weight. To specify this |
| 916 | style for a given level N (assuming you wish to have another fallback | 1070 | style for a given level N, assuming you wish to have another fallback |
| 917 | option), just specify the value =t= like this: | 1071 | option, just specify the value =t= like this: |
| 918 | 1072 | ||
| 919 | #+begin_src emacs-lisp | 1073 | #+begin_src emacs-lisp |
| 920 | (setq modus-operandi-theme-headings | 1074 | (setq modus-themes-headings |
| 921 | '((1 . t) | 1075 | '((1 . t) |
| 922 | (2 . line) | 1076 | (2 . line) |
| 923 | (t . rainbow-line-no-bold))) | 1077 | (t . rainbow-line-no-bold))) |
| 924 | #+end_src | 1078 | #+end_src |
| 925 | 1079 | ||
| 926 | A description of all other possible styles: | 1080 | A description of all other possible styles beyond the default: |
| 927 | 1081 | ||
| 928 | + =no-bold= retains the default text color while removing the typographic | 1082 | + ~no-bold~ retains the default text color while removing the bold |
| 929 | weight. | 1083 | typographic weight. |
| 930 | 1084 | ||
| 931 | + =line= is the same as the default plus an overline over the heading. | 1085 | + ~line~ is the same as the default plus an overline across the |
| 1086 | heading's length. | ||
| 932 | 1087 | ||
| 933 | + =line-no-bold= is the same as =line= without bold weight. | 1088 | + ~line-no-bold~ is the same as ~line~ without bold weight. |
| 934 | 1089 | ||
| 935 | + =rainbow= uses a more colorful foreground in combination with bold | 1090 | + ~rainbow~ uses a more colorful foreground in combination with bold |
| 936 | weight. | 1091 | typographic weight. |
| 937 | 1092 | ||
| 938 | + =rainbow-line= is the same as =rainbow= plus an overline. | 1093 | + ~rainbow-line~ is the same as ~rainbow~ plus an overline. |
| 939 | 1094 | ||
| 940 | + =rainbow-line-no-bold= is the same as =rainbow-line= without the bold | 1095 | + ~rainbow-line-no-bold~ is the same as ~rainbow-line~ without the bold |
| 941 | weight. | 1096 | weight. |
| 942 | 1097 | ||
| 943 | + =highlight= retains the default style of a fairly desaturated foreground | 1098 | + ~highlight~ retains the default style of a fairly desaturated |
| 944 | combined with a bold weight and adds to it a subtle accented | 1099 | foreground combined with a bold weight and adds to it a subtle |
| 945 | background. | 1100 | accented background. |
| 946 | 1101 | ||
| 947 | + =highlight-no-bold= is the same as =highlight= without a bold weight. | 1102 | + ~highlight-no-bold~ is the same as ~highlight~ without a bold weight. |
| 948 | 1103 | ||
| 949 | + =rainbow-highlight= is the same as =highlight= but with a more colorful | 1104 | + ~rainbow-highlight~ is the same as ~highlight~ but with a more |
| 950 | foreground. | 1105 | colorful foreground. |
| 951 | 1106 | ||
| 952 | + =rainbow-highlight-no-bold= is the same as =rainbow-highlight= without a | 1107 | + ~rainbow-highlight-no-bold~ is the same as ~rainbow-highlight~ without |
| 953 | bold weight. | 1108 | a bold weight. |
| 954 | 1109 | ||
| 955 | + =section= retains the default looks and adds to them both an overline | 1110 | + ~section~ retains the default looks and adds to them both an overline |
| 956 | and a slightly accented background. It is, in effect, a combination | 1111 | and a slightly accented background. It is, in effect, a combination |
| 957 | of the =line= and =highlight= values. | 1112 | of the ~line~ and ~highlight~ values. |
| 958 | 1113 | ||
| 959 | + =section-no-bold= is the same as =section= without a bold weight. | 1114 | + ~section-no-bold~ is the same as ~section~ without a bold weight. |
| 960 | 1115 | ||
| 961 | + =rainbow-section= is the same as =section= but with a more colorful | 1116 | + ~rainbow-section~ is the same as ~section~ but with a more colorful |
| 962 | foreground. | 1117 | foreground. |
| 963 | 1118 | ||
| 964 | + =rainbow-section-no-bold= is the same as =rainbow-section= without a bold | 1119 | + ~rainbow-section-no-bold~ is the same as ~rainbow-section~ without a |
| 965 | weight." | 1120 | bold weight. |
| 1121 | |||
| 1122 | + ~no-color~ does not apply any color to the heading, meaning that it | ||
| 1123 | uses the foreground of the ~default~ face. It still renders the text | ||
| 1124 | with a bold typographic weight. | ||
| 966 | 1125 | ||
| 967 | ** Option for scaled headings | 1126 | + ~no-color-no-bold~ is like ~no-color~ but without the bold weight. |
| 968 | :PROPERTIES: | ||
| 969 | :ALT_TITLE: Scaled headings | ||
| 970 | :DESCRIPTION: Toggle scaling of headings | ||
| 971 | :CUSTOM_ID: h:075eb022-37a6-41a4-a040-cc189f6bfa1f | ||
| 972 | :END: | ||
| 973 | 1127 | ||
| 974 | Symbol names: | 1128 | ** Option for scaled headings |
| 1129 | :properties: | ||
| 1130 | :alt_title: Scaled headings | ||
| 1131 | :description: Toggle scaling of headings | ||
| 1132 | :custom_id: h:075eb022-37a6-41a4-a040-cc189f6bfa1f | ||
| 1133 | :end: | ||
| 1134 | #+vindex: modus-themes-scale-headings | ||
| 975 | 1135 | ||
| 976 | + =modus-operandi-theme-scale-headings= | 1136 | Symbol: ~modus-themes-scale-headings~ |
| 977 | + =modus-vivendi-theme-scale-headings= | ||
| 978 | 1137 | ||
| 979 | Possible values: | 1138 | Possible values: |
| 980 | 1139 | ||
| 981 | 1. =nil= (default) | 1140 | 1. =nil= (default) |
| 982 | 2. =t= | 1141 | 2. =t= |
| 983 | 1142 | ||
| 984 | Make headings larger in height relative to the main text. This is | 1143 | The default is to use the same size for headings and paragraph text. |
| 985 | noticeable in modes like Org. The default is to use the same size for | 1144 | |
| 986 | headings and body copy. | 1145 | With a non-nil value (=t=) make headings larger in height relative to the |
| 1146 | main text. This is noticeable in modes like Org, Markdown, and Info. | ||
| 987 | 1147 | ||
| 988 | *** Control the scale of headings | 1148 | *** Control the scale of headings |
| 989 | :PROPERTIES: | 1149 | :properties: |
| 990 | :ALT_TITLE: Scaled heading sizes | 1150 | :alt_title: Scaled heading sizes |
| 991 | :DESCRIPTION: Specify rate of increase for scaled headings | 1151 | :description: Specify rate of increase for scaled headings |
| 992 | :CUSTOM_ID: h:6868baa1-beba-45ed-baa5-5fd68322ccb3 | 1152 | :custom_id: h:6868baa1-beba-45ed-baa5-5fd68322ccb3 |
| 993 | :END: | 1153 | :end: |
| 994 | 1154 | ||
| 995 | In addition to toggles for enabling scaled headings, users can also | 1155 | In addition to the toggle for enabling scaled headings, users can also |
| 996 | specify a number of their own. | 1156 | specify a number of their own. |
| 997 | 1157 | ||
| 998 | + If it is a floating point, say, =1.5=, it is interpreted as a multiple | 1158 | + If it is a floating point, say, =1.5=, it is interpreted as a multiple |
| 999 | of the base font size. This is the recommended method. | 1159 | of the base font size. This is the recommended method, because it |
| 1000 | 1160 | will always adapt to changes in the base font size, such as while | |
| 1001 | + If it is an integer, it is read as an absolute font height. The | 1161 | using the ~text-scale-adjust~ command. |
| 1002 | number is basically the point size multiplied by ten. So if you want | 1162 | |
| 1003 | it to be =18pt= you must pass =180=. Please understand that setting an | 1163 | + If it is an integer, it is read as an absolute font height that is |
| 1004 | absolute value is discouraged, as it will break the layout when you | 1164 | 1/10 of the typographic point size. Thus a value of =18pt= must be |
| 1005 | try to change font sizes with the built-in =text-scale-adjust= command | 1165 | expressed as =180=. Setting an absolute value is discouraged, as it |
| 1006 | (see [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations]]). | 1166 | will break the layout in cases where the base font size must change, |
| 1167 | such as with the ~text-scale-adjust~ command ([[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations]]). | ||
| 1168 | While we discourage using absolute values, we still provide for this | ||
| 1169 | option for users who do not need to perform text-scaling operations or | ||
| 1170 | who are content with whatever discrepancies in height. | ||
| 1007 | 1171 | ||
| 1008 | Below are the variables in their default values, using the floating | 1172 | Below are the variables in their default values, using the floating |
| 1009 | point paradigm. The numbers are very conservative, but you are free to | 1173 | point paradigm. The numbers are very conservative, but one is free to |
| 1010 | change them to your liking, such as =1.2=, =1.4=, =1.6=, =1.8=, =2.0=---or use a | 1174 | change them to their liking, such as =1.2=, =1.4=, =1.6=, =1.8=, =2.0=---or use a |
| 1011 | resource for finding a consistent scale: | 1175 | resource for finding a consistent scale: |
| 1012 | 1176 | ||
| 1013 | #+begin_src emacs-lisp | 1177 | #+begin_src emacs-lisp |
| 1014 | (setq modus-operandi-theme-scale-1 1.05 | 1178 | (setq modus-themes-scale-1 1.05 |
| 1015 | modus-operandi-theme-scale-2 1.1 | 1179 | modus-themes-scale-2 1.1 |
| 1016 | modus-operandi-theme-scale-3 1.15 | 1180 | modus-themes-scale-3 1.15 |
| 1017 | modus-operandi-theme-scale-4 1.2 | 1181 | modus-themes-scale-4 1.2 |
| 1018 | modus-operandi-theme-scale-5 1.3) | 1182 | modus-themes-scale-5 1.3) |
| 1019 | |||
| 1020 | (setq modus-vivendi-theme-scale-1 1.05 | ||
| 1021 | modus-vivendi-theme-scale-2 1.1 | ||
| 1022 | modus-vivendi-theme-scale-3 1.15 | ||
| 1023 | modus-vivendi-theme-scale-4 1.2 | ||
| 1024 | modus-vivendi-theme-scale-5 1.3) | ||
| 1025 | #+end_src | 1183 | #+end_src |
| 1026 | 1184 | ||
| 1185 | As for the application of that scale, the variables that range from | ||
| 1186 | ~modus-themes-scale-1~ up to ~modus-themes-scale-4~ apply to regular | ||
| 1187 | headings within the context of the given major mode. The former is the | ||
| 1188 | smallest, while the latter is the largest. "Regular headings" are those | ||
| 1189 | that have a standard syntax for their scale, such as Org mode's eight | ||
| 1190 | levels of asterisks or Markdown's six columns. | ||
| 1191 | |||
| 1192 | Whereas ~modus-themes-scale-5~ is applied to special headings that do not | ||
| 1193 | conform with the aforementioned syntax, yet which are expected to be | ||
| 1194 | larger than the largest value on that implied scale. Put concretely, | ||
| 1195 | Org's =#+title= meta datum is not part of the eight levels of headings in | ||
| 1196 | an Org file, yet is supposed to signify the primary header. Similarly, | ||
| 1197 | the Org Agenda's structure headings are not part of a recognisable scale | ||
| 1198 | and so they also get ~modus-themes-scale-5~. | ||
| 1199 | |||
| 1200 | Users who wish to maintain scaled headings for the normal syntax while | ||
| 1201 | preventing special headings from standing out, can assign a value of =1.0= | ||
| 1202 | to ~modus-themes-scale-5~ to make it the same as body text (or whatever | ||
| 1203 | value would render it indistinguishable from the desired point of | ||
| 1204 | reference). | ||
| 1205 | |||
| 1027 | Note that in earlier versions of Org, scaling would only increase the | 1206 | Note that in earlier versions of Org, scaling would only increase the |
| 1028 | size of the heading, but not of keywords that were added to it, like | 1207 | size of the heading, but not of keywords that were added to it, like |
| 1029 | "TODO". The issue has been fixed upstream: | 1208 | "TODO". The issue has been fixed upstream: |
| 1030 | <https://protesilaos.com/codelog/2020-09-24-org-headings-adapt/>. | 1209 | <https://protesilaos.com/codelog/2020-09-24-org-headings-adapt/>. |
| 1031 | 1210 | ||
| 1032 | ** Option for variable-pitch font in headings | 1211 | ** Option for variable-pitch font in UI elements |
| 1033 | :PROPERTIES: | 1212 | :properties: |
| 1034 | :ALT_TITLE: Headings' font | 1213 | :alt_title: UI typeface |
| 1035 | :DESCRIPTION: Toggle proportionately spaced fonts in headings | 1214 | :description: Toggle the use of variable-pitch across the User Interface |
| 1036 | :CUSTOM_ID: h:97caca76-fa13-456c-aef1-a2aa165ea274 | 1215 | :custom_id: h:16cf666c-5e65-424c-a855-7ea8a4a1fcac |
| 1037 | :END: | 1216 | :end: |
| 1217 | #+vindex: modus-themes-variable-pitch-ui | ||
| 1218 | |||
| 1219 | Symbol: ~modus-themes-variable-pitch-ui~ | ||
| 1220 | |||
| 1221 | Possible values: | ||
| 1222 | |||
| 1223 | 1. =nil= (default) | ||
| 1224 | 2. =t= | ||
| 1225 | |||
| 1226 | This option concerns User Interface elements that are under the direct | ||
| 1227 | control of Emacs. In particular: the mode line, header line, tab bar, | ||
| 1228 | and tab line. | ||
| 1229 | |||
| 1230 | The default is to use the same font as the rest of Emacs, which usually | ||
| 1231 | is a monospaced family. | ||
| 1038 | 1232 | ||
| 1039 | Symbol names: | 1233 | With a non-nil value (=t=) apply a proportionately spaced typeface. This |
| 1234 | is done by assigning the ~variable-pitch~ face to the relevant items. | ||
| 1040 | 1235 | ||
| 1041 | + =modus-operandi-theme-variable-pitch-headings= | 1236 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. |
| 1042 | + =modus-vivendi-theme-variable-pitch-headings= | 1237 | |
| 1238 | ** Option for variable-pitch font in headings | ||
| 1239 | :properties: | ||
| 1240 | :alt_title: Headings' typeface | ||
| 1241 | :description: Toggle the use of variable-pitch in headings | ||
| 1242 | :custom_id: h:97caca76-fa13-456c-aef1-a2aa165ea274 | ||
| 1243 | :end: | ||
| 1244 | #+vindex: modus-themes-variable-pitch-headings | ||
| 1245 | |||
| 1246 | Symbol: ~modus-themes-variable-pitch-headings~ | ||
| 1043 | 1247 | ||
| 1044 | Possible values: | 1248 | Possible values: |
| 1045 | 1249 | ||
| 1046 | 1. =nil= (default) | 1250 | 1. =nil= (default) |
| 1047 | 2. =t= | 1251 | 2. =t= |
| 1048 | 1252 | ||
| 1049 | Choose to apply a proportionately spaced, else "variable-pitch", | 1253 | The default is to use the main font family, which typically is |
| 1050 | typeface to headings (such as in Org mode). The default is to use the | 1254 | monospaced. |
| 1051 | main font family. | ||
| 1052 | 1255 | ||
| 1053 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org (and others)]]. | 1256 | With a non-nil value (=t=) apply a proportionately spaced typeface, else |
| 1257 | "variable-pitch", to headings (such as in Org mode). | ||
| 1258 | |||
| 1259 | [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font configurations for Org and others]]. | ||
| 1054 | 1260 | ||
| 1055 | * Advanced customization (do-it-yourself) | 1261 | * Advanced customization (do-it-yourself) |
| 1056 | :PROPERTIES: | 1262 | :properties: |
| 1057 | :INDEX: cp | 1263 | :custom_id: h:f4651d55-8c07-46aa-b52b-bed1e53463bb |
| 1058 | :CUSTOM_ID: h:f4651d55-8c07-46aa-b52b-bed1e53463bb | 1264 | :end: |
| 1059 | :END: | ||
| 1060 | 1265 | ||
| 1061 | Unlike the predefined customization options which follow a | 1266 | Unlike the predefined customization options which follow a clear pattern |
| 1062 | straightforward pattern of allowing the user to quickly specify their | 1267 | of allowing the user to quickly specify their preference, the themes |
| 1063 | preference, the themes also provide a more flexible, albeit difficult, | 1268 | also provide a more flexible, albeit difficult, mechanism to control |
| 1064 | mechanism to control things with precision (see [[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). | 1269 | things with precision ([[#h:bf1c82f2-46c7-4eb2-ad00-dd11fdd8b53f][Customization Options]]). |
| 1065 | 1270 | ||
| 1066 | This section is of interest only to users who are prepared to maintain | 1271 | This section is of interest only to users who are prepared to maintain |
| 1067 | their own local tweaks and who are willing to deal with any possible | 1272 | their own local tweaks and who are willing to deal with any possible |
| 1068 | incompatibilities between versioned releases of the themes. As such, | 1273 | incompatibilities between versioned releases of the themes. As such, |
| 1069 | they are labelled as "do-it-yourself" or "DIY". | 1274 | they are labelled as "do-it-yourself" or "DIY". |
| 1070 | 1275 | ||
| 1071 | ** Full access to the themes' palette | 1276 | ** Per-theme customization settings (DIY) |
| 1072 | :PROPERTIES: | 1277 | :properties: |
| 1073 | :ALT_TITLE: Tweak colors (DIY) | 1278 | :custom_id: h:a897b302-8e10-4a26-beab-3caaee1e1193 |
| 1074 | :DESCRIPTION: Declare your own palette overrides | 1279 | :end: |
| 1075 | :CUSTOM_ID: h:1487c631-f4fe-490d-8d58-d72ffa3bd474 | 1280 | |
| 1076 | :END: | 1281 | If you prefer to maintain different customization options between the |
| 1282 | two themes, it is best you write your own functions that first set those | ||
| 1283 | options and then load the relevant theme. The following code does | ||
| 1284 | exactly that by simply differentiating the two themes on the choice of | ||
| 1285 | bold constructs in code syntax (enabled for one, disabled for the | ||
| 1286 | other). | ||
| 1287 | |||
| 1288 | #+begin_src emacs-lisp | ||
| 1289 | (defun my-demo-modus-operandi () | ||
| 1290 | (interactive) | ||
| 1291 | (setq modus-themes-bold-constructs t) ; ENABLE bold | ||
| 1292 | (modus-themes-load-operandi)) | ||
| 1293 | |||
| 1294 | (defun my-demo-modus-vivendi () | ||
| 1295 | (interactive) | ||
| 1296 | (setq modus-themes-bold-constructs nil) ; DISABLE bold | ||
| 1297 | (modus-themes-load-vivendi)) | ||
| 1298 | |||
| 1299 | (defun my-demo-modus-themes-toggle () | ||
| 1300 | (if (eq (car custom-enabled-themes) 'modus-operandi) | ||
| 1301 | (my-demo-modus-vivendi) | ||
| 1302 | (my-demo-modus-operandi))) | ||
| 1303 | #+end_src | ||
| 1304 | |||
| 1305 | Then assign ~my-demo-modus-themes-toggle~ to a key instead of the | ||
| 1306 | equivalent the themes provide. | ||
| 1307 | |||
| 1308 | For a more elaborate design, it is better to inspect the source code of | ||
| 1309 | ~modus-themes-toggle~ and relevant functions. | ||
| 1310 | |||
| 1311 | ** Case-by-case face specs using the themes' palette (DIY) | ||
| 1312 | :properties: | ||
| 1313 | :custom_id: h:1487c631-f4fe-490d-8d58-d72ffa3bd474 | ||
| 1314 | :end: | ||
| 1315 | #+findex: modus-themes-color | ||
| 1316 | #+findex: modus-themes-color-alts | ||
| 1317 | #+cindex: Extracting individual colors | ||
| 1318 | |||
| 1319 | This section is about tweaking individual faces. If you plan to do | ||
| 1320 | things at scale, consult the next section: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Set multiple faces]]. | ||
| 1321 | |||
| 1322 | We already covered in previous sections how to toggle between the themes | ||
| 1323 | and how to configure options prior to loading. We also explained that | ||
| 1324 | some of the functions made available to users will fire up a hook that | ||
| 1325 | can be used to pass tweaks in the post-theme-load phase. | ||
| 1326 | |||
| 1327 | Now assume you wish to change a single face, say, the ~cursor~. And you | ||
| 1328 | would like to get the standard "blue" color value of the active Modus | ||
| 1329 | theme, whether it is Modus Operandi or Modus Vivendi. To do that, you | ||
| 1330 | can use the ~modus-themes-color~ function. It accepts a symbol that is | ||
| 1331 | associated with a color in ~modus-themes-operandi-colors~ and | ||
| 1332 | ~modus-themes-vivendi-colors~. Like this: | ||
| 1333 | |||
| 1334 | #+begin_src emacs-lisp | ||
| 1335 | (modus-themes-color 'blue) | ||
| 1336 | #+end_src | ||
| 1337 | |||
| 1338 | The function always extracts the color value of the active Modus theme. | ||
| 1339 | |||
| 1340 | #+begin_src emacs-lisp | ||
| 1341 | (progn | ||
| 1342 | (load-theme 'modus-operandi t) | ||
| 1343 | (modus-themes-color 'blue)) ; "#0031a9" for `modus-operandi' | ||
| 1344 | |||
| 1345 | (progn | ||
| 1346 | (load-theme 'modus-vivendi t) | ||
| 1347 | (modus-themes-color 'blue)) ; "#2fafff" for `modus-vivendi' | ||
| 1348 | #+end_src | ||
| 1349 | |||
| 1350 | Do {{{kbd(C-h v)}}} on the aforementioned variables to check all the available | ||
| 1351 | symbols that can be passed to this function. | ||
| 1352 | |||
| 1353 | With that granted, let us expand the example to actually change the | ||
| 1354 | ~cursor~ face's background property. We employ the built-in function of | ||
| 1355 | ~set-face-attribute~: | ||
| 1356 | |||
| 1357 | #+begin_src emacs-lisp | ||
| 1358 | (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) | ||
| 1359 | #+end_src | ||
| 1360 | |||
| 1361 | If you evaluate this form, your cursor will become blue. But if you | ||
| 1362 | change themes, such as with ~modus-themes-toggle~, your edits will be | ||
| 1363 | lost, because the newly loaded theme will override the =:background= | ||
| 1364 | attribute you had assigned to that face. | ||
| 1077 | 1365 | ||
| 1078 | The variables are: | 1366 | For such changes to persist, we need to make them after loading the |
| 1367 | theme. So we rely on ~modus-themes-after-load-theme-hook~, which gets | ||
| 1368 | called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, as | ||
| 1369 | well as the command ~modus-themes-toggle~. Here is a sample function that | ||
| 1370 | tweaks two faces and then gets added to the hook: | ||
| 1079 | 1371 | ||
| 1080 | + =modus-operandi-theme-override-colors-alist= | 1372 | #+begin_src emacs-lisp |
| 1081 | + =modus-vivendi-theme-override-colors-alist= | 1373 | (defun my-modus-themes-custom-faces () |
| 1374 | (set-face-attribute 'cursor nil :background (modus-themes-color 'blue)) | ||
| 1375 | (set-face-attribute 'font-lock-type-face nil :foreground (modus-themes-color 'magenta-alt))) | ||
| 1376 | |||
| 1377 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 1378 | #+end_src | ||
| 1082 | 1379 | ||
| 1083 | Users can specify an association list that maps the names of color | 1380 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. |
| 1084 | variables to hexadecimal RGB values (in the form of =#RRGGBB=). This | ||
| 1085 | means that it is possible to override the entire palette or subsets | ||
| 1086 | thereof (see the source code for the actual names and values). | ||
| 1087 | 1381 | ||
| 1088 | Example: | 1382 | Using this principle, it is possible to override the styles of faces |
| 1383 | without having to find color values for each case. | ||
| 1384 | |||
| 1385 | Another application is to control the precise weight for bold | ||
| 1386 | constructs. This is particularly useful if your typeface has several | ||
| 1387 | variants such as "heavy", "extrabold", "semibold". All you have to do | ||
| 1388 | is edit the ~bold~ face. For example: | ||
| 1089 | 1389 | ||
| 1090 | #+begin_src emacs-lisp | 1390 | #+begin_src emacs-lisp |
| 1091 | ;; Redefine the values of those three variables for the given theme | 1391 | (set-face-attribute 'bold nil :weight 'semibold) |
| 1092 | (setq modus-vivendi-theme-override-colors-alist | ||
| 1093 | '(("magenta" . "#ffaabb") | ||
| 1094 | ("magenta-alt" . "#ee88ff") | ||
| 1095 | ("magenta-alt-other" . "#bbaaff"))) | ||
| 1096 | #+end_src | 1392 | #+end_src |
| 1097 | 1393 | ||
| 1098 | If you want to be creative, you can define a minor mode that refashions | 1394 | Remember to use the custom function and hook combo we demonstrated |
| 1099 | the themes on demand. The following is a minor mode that gets activated | 1395 | above. Because the themes do not hard-wire a specific weight, this |
| 1100 | on demand. We combine it with the function to switch between Modus | 1396 | simple form is enough to change the weight of all bold constructs |
| 1101 | Operandi and Modus Vivendi (see [[#h:2a0895a6-3281-4e55-8aa1-8a737555821e][Toggle between the themes on demand]] for | 1397 | throughout the interface. |
| 1102 | a basic command, and/or [[*Configure options prior to loading][Configure options prior to loading]] for a more | 1398 | |
| 1103 | comprehensive setup). | 1399 | Finally, there are cases where you want to tweak colors though wish to |
| 1400 | apply different ones to each theme, say, a blue hue for Modus Operandi | ||
| 1401 | and a shade of red for Modus Vivendi. To this end, we provide | ||
| 1402 | ~modus-themes-color-alts~ as a convenience function to save you from the | ||
| 1403 | trouble of writing separate wrappers for each theme. It still returns a | ||
| 1404 | single value by querying either of ~modus-themes-operandi-colors~ and | ||
| 1405 | ~modus-themes-vivendi-colors~, only here you pass the two keys you want, | ||
| 1406 | first for ~modus-operandi~ then ~modus-vivendi~. | ||
| 1407 | |||
| 1408 | Take the previous example with the ~cursor~ face: | ||
| 1104 | 1409 | ||
| 1105 | #+begin_src emacs-lisp | 1410 | #+begin_src emacs-lisp |
| 1106 | (define-minor-mode modus-themes-alt-mode | 1411 | ;; Blue for `modus-operandi' and red for `modus-vivendi' |
| 1107 | "Override Modus themes' palette variables with custom values. | 1412 | (set-face-attribute 'cursor nil :background (modus-themes-color-alts 'blue 'red)) |
| 1413 | #+end_src | ||
| 1108 | 1414 | ||
| 1109 | This is intended as a proof-of-concept. It is, nonetheless, a | 1415 | ** Face specs at scale using the themes' palette (DIY) |
| 1110 | perfectly accessible alternative, conforming with the design | 1416 | :properties: |
| 1111 | principles of the Modus themes. It still is not as good as the | 1417 | :custom_id: h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae |
| 1112 | default colors." | 1418 | :end: |
| 1419 | #+findex: modus-themes-with-colors | ||
| 1420 | #+cindex: Extracting colors en masse | ||
| 1421 | |||
| 1422 | The examples here are for large scale operations. For simple, one-off | ||
| 1423 | tweaks, you may prefer the approach documented in the previous section | ||
| 1424 | ([[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Case-by-case face specs using the themes' palette]]). | ||
| 1425 | |||
| 1426 | The ~modus-themes-with-colors~ macro lets you retrieve multiple color | ||
| 1427 | values by employing the backquote/backtick and comma notation. The | ||
| 1428 | values are stored in the alists ~modus-themes-operandi-colors~ and | ||
| 1429 | ~modus-themes-vivendi-colors~, while the macro always queries that of the | ||
| 1430 | active Modus theme. | ||
| 1431 | |||
| 1432 | Here is an abstract example that just returns a list of color values | ||
| 1433 | while ~modus-operandi~ is enabled: | ||
| 1434 | |||
| 1435 | #+begin_src emacs-lisp | ||
| 1436 | (modus-themes-with-colors | ||
| 1437 | (list fg-main | ||
| 1438 | blue-faint | ||
| 1439 | magenta | ||
| 1440 | magenta-alt-other | ||
| 1441 | cyan-alt-other | ||
| 1442 | fg-special-cold | ||
| 1443 | blue-alt | ||
| 1444 | magenta-faint | ||
| 1445 | cyan | ||
| 1446 | fg-main | ||
| 1447 | green-faint | ||
| 1448 | red-alt-faint | ||
| 1449 | blue-alt-faint | ||
| 1450 | fg-special-warm | ||
| 1451 | cyan-alt | ||
| 1452 | blue)) | ||
| 1453 | ;; => | ||
| 1454 | ;; ("#000000" "#002f88" "#721045" "#5317ac" | ||
| 1455 | ;; "#005a5f" "#093060" "#2544bb" "#752f50" | ||
| 1456 | ;; "#00538b" "#000000" "#104410" "#702f00" | ||
| 1457 | ;; "#003f78" "#5d3026" "#30517f" "#0031a9") | ||
| 1458 | #+end_src | ||
| 1459 | |||
| 1460 | Getting a list of colors may have its applications, though what you are | ||
| 1461 | most likely interested in is how to use those variables to configure | ||
| 1462 | several faces at once. To do so we can rely on the built-in | ||
| 1463 | ~custom-set-faces~ function, which sets face specifications for the | ||
| 1464 | special =user= theme. That "theme" gets applied on top of regular themes | ||
| 1465 | like ~modus-operandi~ and ~modus-vivendi~. | ||
| 1466 | |||
| 1467 | This is how it works: | ||
| 1468 | |||
| 1469 | #+begin_src emacs-lisp | ||
| 1470 | (modus-themes-with-colors | ||
| 1471 | (custom-set-faces | ||
| 1472 | `(cursor ((,class :background ,blue))) | ||
| 1473 | `(mode-line ((,class :background ,yellow-nuanced-bg | ||
| 1474 | :foreground ,yellow-nuanced-fg))) | ||
| 1475 | `(mode-line-inactive ((,class :background ,blue-nuanced-bg | ||
| 1476 | :foreground ,blue-nuanced-fg))))) | ||
| 1477 | #+end_src | ||
| 1478 | |||
| 1479 | The above snippet will immediately refashion the faces it names once it | ||
| 1480 | is evaluated. However, if you switch between the Modus themes, say, | ||
| 1481 | from ~modus-operandi~ to ~modus-vivendi~, the colors will not get updated to | ||
| 1482 | match those of the new theme. To make things work across the themes, we | ||
| 1483 | need to employ the same technique we discussed in the previous section, | ||
| 1484 | namely, to pass our changes at the post-theme-load phase via a hook. | ||
| 1485 | |||
| 1486 | The themes provide the ~modus-themes-after-load-theme-hook~, which gets | ||
| 1487 | called from ~modus-themes-load-operandi~, ~modus-themes-load-vivendi~, as | ||
| 1488 | well as the command ~modus-themes-toggle~. With this knowledge, you can | ||
| 1489 | wrap the macro in a function and then assign that function to the hook. | ||
| 1490 | Thus: | ||
| 1491 | |||
| 1492 | #+begin_src emacs-lisp | ||
| 1493 | (defun my-modus-themes-custom-faces () | ||
| 1494 | (modus-themes-with-colors | ||
| 1495 | (custom-set-faces | ||
| 1496 | `(cursor ((,class :background ,blue))) | ||
| 1497 | `(mode-line ((,class :background ,yellow-nuanced-bg | ||
| 1498 | :foreground ,yellow-nuanced-fg))) | ||
| 1499 | `(mode-line-inactive ((,class :background ,blue-nuanced-bg | ||
| 1500 | :foreground ,blue-nuanced-fg)))))) | ||
| 1501 | |||
| 1502 | (add-hook 'modus-themes-after-load-theme-hook #'my-modus-themes-custom-faces) | ||
| 1503 | #+end_src | ||
| 1504 | |||
| 1505 | [[#h:86f6906b-f090-46cc-9816-1fe8aeb38776][A theme-agnostic hook for theme loading]]. | ||
| 1506 | |||
| 1507 | To discover the faces defined by all loaded libraries, you may do | ||
| 1508 | {{{kbd(M-x list-faces-display)}}}. Be warned that when you =:inherit= a face | ||
| 1509 | you are introducing an implicit dependency, so try to avoid doing so for | ||
| 1510 | libraries other than the built-in {{{file(faces.el)}}} (or at least understand | ||
| 1511 | that things may break if you inherit from a yet-to-be-loaded face). | ||
| 1512 | |||
| 1513 | Also bear in mind that these examples are meant to work with the Modus | ||
| 1514 | themes. If you are cycling between multiple themes you may encounter | ||
| 1515 | unforeseen issues, such as the colors of the Modus themes being applied | ||
| 1516 | to a non-Modus item. | ||
| 1517 | |||
| 1518 | Finally, note that you can still use other functions where those make | ||
| 1519 | sense. For example, the ~modus-themes-color-alts~ that was discussed in | ||
| 1520 | the previous section. Adapt the above example like this: | ||
| 1521 | |||
| 1522 | #+begin_src emacs-lisp | ||
| 1523 | ... | ||
| 1524 | (modus-themes-with-colors | ||
| 1525 | (custom-set-faces | ||
| 1526 | `(cursor ((,class :background ,(modus-themes-color-alts 'blue 'green)))) | ||
| 1527 | ...)) | ||
| 1528 | #+end_src | ||
| 1529 | |||
| 1530 | ** Override colors (DIY) | ||
| 1531 | :properties: | ||
| 1532 | :custom_id: h:307d95dd-8dbd-4ece-a543-10ae86f155a6 | ||
| 1533 | :end: | ||
| 1534 | #+vindex: modus-themes-operandi-color-overrides | ||
| 1535 | #+vindex: modus-themes-vivendi-color-overrides | ||
| 1536 | #+cindex: Change a theme's colors | ||
| 1537 | |||
| 1538 | The themes provide a mechanism for overriding their color values. This | ||
| 1539 | is controlled by the variables ~modus-themes-operandi-color-overrides~ and | ||
| 1540 | ~modus-themes-vivendi-color-overrides~, which are alists that should | ||
| 1541 | mirror a subset of the associations in ~modus-themes-operandi-colors~ and | ||
| 1542 | ~modus-themes-vivendi-colors~ respectively. As with all customisations, | ||
| 1543 | overriding must be done before loading the affected theme. | ||
| 1544 | |||
| 1545 | Let us approach the present topic one step at a time. Here is a | ||
| 1546 | simplified excerpt of the default palette for Modus Operandi with some | ||
| 1547 | basic background values that apply to buffers and the mode line | ||
| 1548 | (remember to inspect the actual value to find out all the associations | ||
| 1549 | that can be overridden): | ||
| 1550 | |||
| 1551 | #+begin_src emacs-lisp | ||
| 1552 | (defconst modus-themes-colors-operandi | ||
| 1553 | '((bg-main . "#ffffff") | ||
| 1554 | (bg-dim . "#f8f8f8") | ||
| 1555 | (bg-alt . "#f0f0f0") | ||
| 1556 | (bg-active . "#d7d7d7") | ||
| 1557 | (bg-inactive . "#efefef"))) | ||
| 1558 | #+end_src | ||
| 1559 | |||
| 1560 | As one can tell, we bind a key to a hexadecimal RGB color value. Now | ||
| 1561 | say we wish to override those specific values and have our changes | ||
| 1562 | propagate to all faces that use those keys. We could write something | ||
| 1563 | like this, which adds a subtle ochre tint: | ||
| 1564 | |||
| 1565 | #+begin_src emacs-lisp | ||
| 1566 | (setq modus-themes-operandi-color-overrides | ||
| 1567 | '((bg-main . "#fefcf4") | ||
| 1568 | (bg-dim . "#faf6ef") | ||
| 1569 | (bg-alt . "#f7efe5") | ||
| 1570 | (bg-active . "#e8dfd1") | ||
| 1571 | (bg-inactive . "#f6ece5"))) | ||
| 1572 | #+end_src | ||
| 1573 | |||
| 1574 | Once this is evaluated, any subsequent loading of ~modus-operandi~ will | ||
| 1575 | use those values instead of the defaults. No further intervention is | ||
| 1576 | required. | ||
| 1577 | |||
| 1578 | To reset the changes, we apply this and reload the theme: | ||
| 1579 | |||
| 1580 | #+begin_src emacs-lisp | ||
| 1581 | (setq modus-themes-operandi-color-overrides nil) | ||
| 1582 | #+end_src | ||
| 1583 | |||
| 1584 | Users who wish to leverage such a mechanism can opt to implement it | ||
| 1585 | on-demand by means of a global minor mode. The following snippet covers | ||
| 1586 | both themes and expands to some more assosiations in the palette: | ||
| 1587 | |||
| 1588 | #+begin_src emacs-lisp | ||
| 1589 | (define-minor-mode my-modus-themes-tinted | ||
| 1590 | "Tweak some Modus themes colors." | ||
| 1113 | :init-value nil | 1591 | :init-value nil |
| 1114 | :global t | 1592 | :global t |
| 1115 | (if modus-themes-alt-mode | 1593 | (if my-modus-themes-tinted |
| 1116 | (setq modus-operandi-theme-override-colors-alist | 1594 | (setq modus-themes-operandi-color-overrides |
| 1117 | '(("bg-main" . "#fefcf4") | 1595 | '((bg-main . "#fefcf4") |
| 1118 | ("bg-dim" . "#faf6ef") | 1596 | (bg-dim . "#faf6ef") |
| 1119 | ("bg-alt" . "#f7efe5") | 1597 | (bg-alt . "#f7efe5") |
| 1120 | ("bg-hl-line" . "#f4f0e3") | 1598 | (bg-hl-line . "#f4f0e3") |
| 1121 | ("bg-active" . "#e8dfd1") | 1599 | (bg-active . "#e8dfd1") |
| 1122 | ("bg-inactive" . "#f6ece5") | 1600 | (bg-inactive . "#f6ece5") |
| 1123 | ("bg-region" . "#c6bab1") | 1601 | (bg-region . "#c6bab1") |
| 1124 | ("bg-header" . "#ede3e0") | 1602 | (bg-header . "#ede3e0") |
| 1125 | ("bg-tab-bar" . "#dcd3d3") | 1603 | (bg-tab-bar . "#dcd3d3") |
| 1126 | ("bg-tab-active" . "#fdf6eb") | 1604 | (bg-tab-active . "#fdf6eb") |
| 1127 | ("bg-tab-inactive" . "#c8bab8") | 1605 | (bg-tab-inactive . "#c8bab8") |
| 1128 | ("fg-unfocused" . "#55556f")) | 1606 | (fg-unfocused . "#55556f")) |
| 1129 | modus-vivendi-theme-override-colors-alist | 1607 | modus-themes-vivendi-color-overrides |
| 1130 | '(("bg-main" . "#100b17") | 1608 | '((bg-main . "#100b17") |
| 1131 | ("bg-dim" . "#161129") | 1609 | (bg-dim . "#161129") |
| 1132 | ("bg-alt" . "#181732") | 1610 | (bg-alt . "#181732") |
| 1133 | ("bg-hl-line" . "#191628") | 1611 | (bg-hl-line . "#191628") |
| 1134 | ("bg-active" . "#282e46") | 1612 | (bg-active . "#282e46") |
| 1135 | ("bg-inactive" . "#1a1e39") | 1613 | (bg-inactive . "#1a1e39") |
| 1136 | ("bg-region" . "#393a53") | 1614 | (bg-region . "#393a53") |
| 1137 | ("bg-header" . "#202037") | 1615 | (bg-header . "#202037") |
| 1138 | ("bg-tab-bar" . "#262b41") | 1616 | (bg-tab-bar . "#262b41") |
| 1139 | ("bg-tab-active" . "#120f18") | 1617 | (bg-tab-active . "#120f18") |
| 1140 | ("bg-tab-inactive" . "#3a3a5a") | 1618 | (bg-tab-inactive . "#3a3a5a") |
| 1141 | ("fg-unfocused" . "#9a9aab"))) | 1619 | (fg-unfocused . "#9a9aab"))) |
| 1142 | (setq modus-operandi-theme-override-colors-alist nil | 1620 | (setq modus-themes-operandi-color-overrides nil |
| 1143 | modus-vivendi-theme-override-colors-alist nil))) | 1621 | modus-themes-vivendi-color-overrides nil))) |
| 1144 | |||
| 1145 | (defun modus-themes-toggle (&optional arg) | ||
| 1146 | "Toggle between `modus-operandi' and `modus-vivendi' themes. | ||
| 1147 | |||
| 1148 | With optional \\[universal-argument] prefix, enable | ||
| 1149 | `modus-themes-alt-mode' for the loaded theme." | ||
| 1150 | (interactive "P") | ||
| 1151 | (if arg | ||
| 1152 | (modus-themes-alt-mode 1) | ||
| 1153 | (modus-themes-alt-mode -1)) | ||
| 1154 | (if (eq (car custom-enabled-themes) 'modus-operandi) | ||
| 1155 | (progn | ||
| 1156 | (disable-theme 'modus-operandi) | ||
| 1157 | (load-theme 'modus-vivendi t)) | ||
| 1158 | (disable-theme 'modus-vivendi) | ||
| 1159 | (load-theme 'modus-operandi t))) | ||
| 1160 | #+end_src | 1622 | #+end_src |
| 1161 | 1623 | ||
| 1162 | ** Font configurations for Org (and others) | 1624 | With this in place, one can invoke {{{kbd(M-x my-modus-themes-tinted)}}} and |
| 1163 | :PROPERTIES: | 1625 | then load the Modus theme of their choice. The new palette subset will |
| 1164 | :ALT_TITLE: Font configs (DIY) | 1626 | come into effect: subtle ochre tints for Modus Operandi and night sky |
| 1165 | :DESCRIPTION: Optimise for mixed typeface buffers | 1627 | shades for Modus Vivendi. Switching between the two themes, such as |
| 1166 | :CUSTOM_ID: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 | 1628 | with {{{kbd(M-x modus-themes-toggle)}}} will also use the overrides. |
| 1167 | :END: | 1629 | |
| 1630 | Given that this is a user-level customisation, one is free to implement | ||
| 1631 | whatever color values they desire, even if the possible combinations | ||
| 1632 | fall below the minimum 7:1 contrast ratio that governs the design of the | ||
| 1633 | themes (the WCAG AAA legibility standard). Preferences aside, it is | ||
| 1634 | advised to inspect the source code of ~modus-themes-operandi-colors~ and | ||
| 1635 | ~modus-themes-vivendi-colors~ to read the inline commentary: it explains | ||
| 1636 | what the intended use of each palette subset is. | ||
| 1168 | 1637 | ||
| 1169 | The themes are designed to cope well with mixed font settings ([[#h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b][Option | 1638 | Furthermore, users may benefit from the ~modus-themes-contrast~ function |
| 1170 | for no font mixing]]). Currently this applies to =org-mode= and | 1639 | that we provide: [[#h:02e25930-e71a-493d-828a-8907fc80f874][test color combinations]]. It measures the contrast |
| 1171 | =markdown-mode=. | 1640 | ratio between two color values, so it can help in overriding the palette |
| 1641 | (or a subset thereof) without making the end result inaccessible. | ||
| 1642 | |||
| 1643 | ** Font configurations for Org and others (DIY) | ||
| 1644 | :properties: | ||
| 1645 | :custom_id: h:defcf4fc-8fa8-4c29-b12e-7119582cc929 | ||
| 1646 | :end: | ||
| 1647 | #+cindex: Font configurations | ||
| 1648 | |||
| 1649 | The themes are designed to cope well with mixed font configurations. | ||
| 1650 | |||
| 1651 | [[#h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b][Option for no font mixing]]. | ||
| 1652 | |||
| 1653 | This mostly concerns ~org-mode~ and ~markdown-mode~, though expect to find | ||
| 1654 | it elsewhere like in ~Info-mode~. | ||
| 1172 | 1655 | ||
| 1173 | In practice it means that the user can safely opt for a more | 1656 | In practice it means that the user can safely opt for a more |
| 1174 | prose-friendly proportionately spaced typeface as their default, while | 1657 | prose-friendly proportionately spaced typeface as their default, while |
| 1175 | letting spacing-sensitive elements like tables and inline code always | 1658 | letting spacing-sensitive elements like tables and inline code always |
| 1176 | use a monospaced font, by inheriting from the =fixed-pitch= face. | 1659 | use a monospaced font, by inheriting from the ~fixed-pitch~ face. |
| 1177 | 1660 | ||
| 1178 | Users can try the built-in =M-x variable-pitch-mode= to see the effect in | 1661 | Users can try the built-in {{{kbd(M-x variable-pitch-mode)}}} to see the |
| 1179 | action. | 1662 | effect in action. |
| 1180 | 1663 | ||
| 1181 | To make everything use your desired font families, you need to configure | 1664 | To make everything use your desired font families, you need to configure |
| 1182 | the =variable-pitch= (proportional spacing) and =fixed-pitch= (monospaced) | 1665 | the ~variable-pitch~ (proportional spacing) and ~fixed-pitch~ (monospaced) |
| 1183 | faces respectively. It may also be convenient to set your main typeface | 1666 | faces respectively. It may also be convenient to set your main typeface |
| 1184 | by configuring the =default= face the same way. | 1667 | by configuring the ~default~ face the same way. |
| 1185 | 1668 | ||
| 1186 | Put something like this in your initialization file (make sure to read | 1669 | Put something like this in your initialization file (also consider |
| 1187 | the documentation of =set-face-attribute=, with =M-x describe-function=): | 1670 | reading the doc string of ~set-face-attribute~): |
| 1188 | 1671 | ||
| 1189 | #+begin_src emacs-lisp | 1672 | #+begin_src emacs-lisp |
| 1190 | ;; Main typeface | 1673 | ;; Main typeface |
| @@ -1199,50 +1682,35 @@ the documentation of =set-face-attribute=, with =M-x describe-function=): | |||
| 1199 | 1682 | ||
| 1200 | Note the differences in the =:height= property. The =default= face must | 1683 | Note the differences in the =:height= property. The =default= face must |
| 1201 | specify an absolute value, which is the point size × 10. So if you want | 1684 | specify an absolute value, which is the point size × 10. So if you want |
| 1202 | to use a font at point size =11=, you set the height at =110=.[fn:: =:height= | 1685 | to use a font at point size =11=, you set the height to =110=.[fn:: =:height= |
| 1203 | values do not need to be rounded to multiples of ten: the likes of =115= | 1686 | values do not need to be rounded to multiples of ten: the likes of =115= |
| 1204 | are perfectly valid—some typefaces will change to account for those | 1687 | are perfectly valid—some typefaces will change to account for those |
| 1205 | finer increments.] Whereas every other face must have a value that is | 1688 | finer increments.] Whereas every other face must have a value that is |
| 1206 | relative to the default, represented as a floating point (if you use an | 1689 | relative to the default, represented as a floating point (if you use an |
| 1207 | integer, say, =15= then that means an absolute height). This is of | 1690 | integer, then that means an absolute height). This is of paramount |
| 1208 | paramount importance: it ensures that all fonts can scale gracefully | 1691 | importance: it ensures that all fonts can scale gracefully when using |
| 1209 | when using something like the =text-scale-adjust= command which only | 1692 | something like the ~text-scale-adjust~ command which only operates on the |
| 1210 | operates on the base font size (i.e. the =default= face's absolute | 1693 | base font size (i.e. the ~default~ face's absolute height). |
| 1211 | height). | 1694 | |
| 1212 | 1695 | ** Custom Org user faces (DIY) | |
| 1213 | An alternative syntax for the =default= face, is to pass all typeface | 1696 | :properties: |
| 1214 | parameters directly to a =font= property.[fn:: Has the benefit of | 1697 | :custom_id: h:89f0678d-c5c3-4a57-a526-668b2bb2d7ad |
| 1215 | accepting =fontconfig= parameters (GNU/Linux), such as ="DejaVu Sans | 1698 | :end: |
| 1216 | Mono-11:hintstyle=hintslight:autohint=false"=. | 1699 | #+cindex: Org extra faces |
| 1217 | https://www.freedesktop.org/software/fontconfig/fontconfig-user.html] | 1700 | |
| 1218 | Note that here we use a standard point size: | 1701 | Users of ~org-mode~ have the option to configure various keywords and |
| 1219 | |||
| 1220 | #+begin_src emacs-lisp | ||
| 1221 | (set-face-attribute 'default nil :font "DejaVu Sans Mono-11") | ||
| 1222 | #+end_src | ||
| 1223 | |||
| 1224 | Again, remember to only ever specify an absolute height for the =default=. | ||
| 1225 | |||
| 1226 | ** Org user faces (DIY) | ||
| 1227 | :PROPERTIES: | ||
| 1228 | :DESCRIPTION: Extend styles for org-mode keywords and priorities | ||
| 1229 | :CUSTOM_ID: h:89f0678d-c5c3-4a57-a526-668b2bb2d7ad | ||
| 1230 | :END: | ||
| 1231 | |||
| 1232 | Users of =org-mode= have the option to configure various keywords and | ||
| 1233 | priority cookies to better match their workflow. User options are | 1702 | priority cookies to better match their workflow. User options are |
| 1234 | =org-todo-keyword-faces= and =org-priority-faces=. | 1703 | ~org-todo-keyword-faces~ and ~org-priority-faces~. |
| 1235 | 1704 | ||
| 1236 | As those are meant to be custom faces, it would be futile to have the | 1705 | As those are meant to be custom faces, it is futile to have the themes |
| 1237 | themes try to guess what each user would want to use, which keywords to | 1706 | guess what each user wants to use, which keywords to target, and so on. |
| 1238 | target, and so on. Instead, we can provide guidelines on how to | 1707 | Instead, we can provide guidelines on how to customize things to one's |
| 1239 | customize things to one's liking with the intent of retaining the | 1708 | liking with the intent of retaining the overall aesthetic of the themes. |
| 1240 | overall aesthetics of the theme. | ||
| 1241 | 1709 | ||
| 1242 | Please bear in mind that the end result of those is not controlled by | 1710 | Please bear in mind that the end result of those is not controlled by |
| 1243 | the active theme but by how Org maps faces to its constructs. Editing | 1711 | the active Modus theme but by how Org maps faces to its constructs. |
| 1244 | those while =org-mode= is active requires =M-x org-mode-restart= for changes | 1712 | Editing those while ~org-mode~ is active requires re-initialization of the |
| 1245 | to take effect. | 1713 | mode with {{{kbd(M-x org-mode-restart)}}} for changes to take effect. |
| 1246 | 1714 | ||
| 1247 | Let us assume you wish to visually differentiate your keywords. You | 1715 | Let us assume you wish to visually differentiate your keywords. You |
| 1248 | have something like this: | 1716 | have something like this: |
| @@ -1257,7 +1725,7 @@ have something like this: | |||
| 1257 | 1725 | ||
| 1258 | You could then use a variant of the following to inherit from a face | 1726 | You could then use a variant of the following to inherit from a face |
| 1259 | that uses the styles you want and also to preserve the properties | 1727 | that uses the styles you want and also to preserve the properties |
| 1260 | applied by the =org-todo= face: | 1728 | applied by the ~org-todo~ face: |
| 1261 | 1729 | ||
| 1262 | #+begin_src emacs-lisp | 1730 | #+begin_src emacs-lisp |
| 1263 | (setq org-todo-keyword-faces | 1731 | (setq org-todo-keyword-faces |
| @@ -1267,10 +1735,10 @@ applied by the =org-todo= face: | |||
| 1267 | #+end_src | 1735 | #+end_src |
| 1268 | 1736 | ||
| 1269 | This will refashion the keywords you specify, while letting the other | 1737 | This will refashion the keywords you specify, while letting the other |
| 1270 | items in =org-todo-keywords= use their original styles (which are defined | 1738 | items in ~org-todo-keywords~ use their original styles (which are defined |
| 1271 | in the =org-todo= and =org-done= faces). | 1739 | in the ~org-todo~ and ~org-done~ faces). |
| 1272 | 1740 | ||
| 1273 | If you want back the defaults, try specifying just the =org-todo= face: | 1741 | If you want back the defaults, try specifying just the ~org-todo~ face: |
| 1274 | 1742 | ||
| 1275 | #+begin_src emacs-lisp | 1743 | #+begin_src emacs-lisp |
| 1276 | (setq org-todo-keyword-faces | 1744 | (setq org-todo-keyword-faces |
| @@ -1282,7 +1750,7 @@ If you want back the defaults, try specifying just the =org-todo= face: | |||
| 1282 | When you inherit from multiple faces, you need to quote the list as | 1750 | When you inherit from multiple faces, you need to quote the list as |
| 1283 | shown further above. The order is important: the last item is applied | 1751 | shown further above. The order is important: the last item is applied |
| 1284 | over the previous ones. If you do not want to blend multiple faces, you | 1752 | over the previous ones. If you do not want to blend multiple faces, you |
| 1285 | do not need a quoted list. A pattern of =keyword . face= would suffice. | 1753 | do not need a quoted list. A pattern of =keyword . face= will suffice. |
| 1286 | 1754 | ||
| 1287 | Both approaches can be used simultaneously, as illustrated in this | 1755 | Both approaches can be used simultaneously, as illustrated in this |
| 1288 | configuration of the priority cookies: | 1756 | configuration of the priority cookies: |
| @@ -1295,29 +1763,182 @@ configuration of the priority cookies: | |||
| 1295 | #+end_src | 1763 | #+end_src |
| 1296 | 1764 | ||
| 1297 | To find all the faces that are loaded in your current Emacs session, use | 1765 | To find all the faces that are loaded in your current Emacs session, use |
| 1298 | =M-x list-faces-display=. Also try =M-x describe-variable= and then specify | 1766 | {{{kbd(M-x list-faces-display)}}}. Try {{{kbd(M-x describe-variable)}}} as well and |
| 1299 | the name of each of those Org variables demonstrated above. Their | 1767 | then specify the name of each of those Org variables demonstrated above. |
| 1300 | documentation strings will offer you further guidance. | 1768 | Their documentation strings will offer you further guidance. |
| 1769 | |||
| 1770 | Recall that the themes let you retrieve a color from their palette. Do | ||
| 1771 | it if you plan to control face attributes. | ||
| 1772 | |||
| 1773 | [[#h:1487c631-f4fe-490d-8d58-d72ffa3bd474][Custom face specs using the themes' palette]]. | ||
| 1774 | |||
| 1775 | [[#h:02e25930-e71a-493d-828a-8907fc80f874][Check color combinations]]. | ||
| 1776 | |||
| 1777 | ** Measure color contrast (DIY) | ||
| 1778 | :properties: | ||
| 1779 | :custom_id: h:02e25930-e71a-493d-828a-8907fc80f874 | ||
| 1780 | :end: | ||
| 1781 | #+findex: modus-themes-contrast | ||
| 1782 | #+findex: modus-themes-wcag-formula | ||
| 1783 | #+cindex: Color contrast | ||
| 1784 | |||
| 1785 | The themes provide the functions ~modus-themes-wcag-formula~ and | ||
| 1786 | ~modus-themes-contrast~. The former is a direct implementation of the | ||
| 1787 | WCAG formula: <https://www.w3.org/TR/WCAG20-TECHS/G18.html>. It | ||
| 1788 | calculates the relative luminance of a color value that is expressed in | ||
| 1789 | hexadecimal RGB notation. While the latter function is just a | ||
| 1790 | convenient wrapper for comparing the relative luminance between two | ||
| 1791 | colors. | ||
| 1792 | |||
| 1793 | In practice, one needs to work only with ~modus-themes-contrast~. It | ||
| 1794 | accepts two color values and returns their contrast ratio. Values range | ||
| 1795 | from 1 to 21 (lowest to highest). The themes are designed to always be | ||
| 1796 | equal or higher than 7 for each combination of background and foreground | ||
| 1797 | that they use (this is the WCAG AAA standard---the most demanding of its | ||
| 1798 | kind). | ||
| 1799 | |||
| 1800 | A couple of examples (rounded numbers): | ||
| 1301 | 1801 | ||
| 1302 | Furthermore, consider reading the "Notes for aspiring Emacs theme | 1802 | #+begin_src emacs-lisp |
| 1303 | developers", published on 2020-08-28 by me (Protesilaos Stavrou): | 1803 | ;; Pure white with pure green |
| 1304 | https://protesilaos.com/codelog/2020-08-28-notes-emacs-theme-devs/. | 1804 | (modus-themes-contrast "#ffffff" "#00ff00") |
| 1805 | ;; => 1.37 | ||
| 1806 | ;; That is an outright inaccessible combo | ||
| 1807 | |||
| 1808 | ;; Pure black with pure green | ||
| 1809 | (modus-themes-contrast "#000000" "#00ff00") | ||
| 1810 | ;; => 15.3 | ||
| 1811 | ;; That is is a highly accessible combo | ||
| 1812 | #+end_src | ||
| 1813 | |||
| 1814 | It does not matter which color value comes first. The ratio is always | ||
| 1815 | the same. | ||
| 1816 | |||
| 1817 | If one does not wish to read all the decimal points, it is possible to | ||
| 1818 | try something like this: | ||
| 1819 | |||
| 1820 | #+begin_src emacs-lisp | ||
| 1821 | (format "%0.2f" (modus-themes-contrast "#000000" "#00ff00")) | ||
| 1822 | #+end_src | ||
| 1823 | |||
| 1824 | While it is fine to perform such calculations on a case-by-case basis, | ||
| 1825 | it is preferable to implement formulas and tables for more demanding | ||
| 1826 | tasks. Such instruments are provided by ~org-mode~ or ~orgtbl-mode~, both | ||
| 1827 | of which are built into Emacs. Below is such a table that derives the | ||
| 1828 | contrast ratio of all colors in the first column (pure red, green, blue) | ||
| 1829 | relative to the color specified in the first row of the second column | ||
| 1830 | (pure white) and rounds the results: | ||
| 1831 | |||
| 1832 | #+begin_example | ||
| 1833 | | | #ffffff | | ||
| 1834 | |---------+---------| | ||
| 1835 | | #ff0000 | 4.00 | | ||
| 1836 | | #00ff00 | 1.37 | | ||
| 1837 | | #0000ff | 8.59 | | ||
| 1838 | #+tblfm: $2='(modus-themes-contrast $1 @1$2);%0.2f | ||
| 1839 | #+end_example | ||
| 1840 | |||
| 1841 | To measure color contrast one needs to start from a known value. This | ||
| 1842 | typically is the background. The Modus themes define an expanded | ||
| 1843 | palette in large part because certain colors are only meant to be used | ||
| 1844 | in combination with some others. Consult the source code for the | ||
| 1845 | minutia and relevant commentary. | ||
| 1846 | |||
| 1847 | Such knowledge may prove valuable while attempting to override some of | ||
| 1848 | the themes' colors: [[#h:307d95dd-8dbd-4ece-a543-10ae86f155a6][Override colors]]. | ||
| 1849 | |||
| 1850 | ** Load theme depending on time of day | ||
| 1851 | :properties: | ||
| 1852 | :custom_id: h:1d1ef4b4-8600-4a09-993c-6de3af0ddd26 | ||
| 1853 | :end: | ||
| 1854 | |||
| 1855 | While we do provide ~modus-themes-toggle~ to manually switch between the | ||
| 1856 | themes, users may also set up their system to perform such a task | ||
| 1857 | automatically at sunrise and sunset. | ||
| 1858 | |||
| 1859 | This can be accomplished by specifying the coordinates of one's location | ||
| 1860 | using the built-in {{{file(solar.el)}}} and then configuring the =circadian= | ||
| 1861 | package: | ||
| 1862 | |||
| 1863 | #+begin_src emacs-lisp | ||
| 1864 | (use-package solar ; built-in | ||
| 1865 | :config | ||
| 1866 | (setq calendar-latitude 35.17 | ||
| 1867 | calendar-longitude 33.36)) | ||
| 1868 | |||
| 1869 | (use-package circadian ; you need to install this | ||
| 1870 | :ensure | ||
| 1871 | :after solar | ||
| 1872 | (setq circadian-themes '((:sunrise . modus-operandi) | ||
| 1873 | (:sunset . modus-vivendi))) | ||
| 1874 | (circadian-setup)) | ||
| 1875 | #+end_src | ||
| 1876 | |||
| 1877 | ** A theme-agnostic hook for theme loading (DIY) | ||
| 1878 | :properties: | ||
| 1879 | :custom_id: h:86f6906b-f090-46cc-9816-1fe8aeb38776 | ||
| 1880 | :end: | ||
| 1881 | |||
| 1882 | The themes are designed with the intent to be useful to Emacs users of | ||
| 1883 | varying skill levels, from beginners to experts. This means that we try | ||
| 1884 | to make things easier by not expecting anyone reading this document to | ||
| 1885 | be proficient in Emacs Lisp or programming in general. | ||
| 1886 | |||
| 1887 | Such a case is with the use of the ~modus-themes-after-load-theme-hook~, | ||
| 1888 | which runs after ~modus-themes-toggle~, ~modus-themes-load-operandi~, or | ||
| 1889 | ~modus-themes-load-vivendi~ is evaluated. We recommend using that hook | ||
| 1890 | for advanced customizations, because (1) we know for sure that it is | ||
| 1891 | available once the themes are loaded, and (2) anyone consulting this | ||
| 1892 | manual, especially the sections on enabling and loading the themes, will | ||
| 1893 | be in a good position to benefit from that hook. | ||
| 1894 | |||
| 1895 | Advanced users who have a need to switch between the Modus themes and | ||
| 1896 | other items will find that such a hook does not meet their requirements: | ||
| 1897 | it only works with the Modus themes and only with the aforementioned | ||
| 1898 | functions. | ||
| 1899 | |||
| 1900 | A theme-agnostic setup can be configured thus: | ||
| 1901 | |||
| 1902 | #+begin_src emacs-lisp | ||
| 1903 | (defvar after-enable-theme-hook nil | ||
| 1904 | "Normal hook run after enabling a theme.") | ||
| 1905 | |||
| 1906 | (defun run-after-enable-theme-hook (&rest _args) | ||
| 1907 | "Run `after-enable-theme-hook'." | ||
| 1908 | (run-hooks 'after-enable-theme-hook)) | ||
| 1909 | |||
| 1910 | (advice-add 'enable-theme :after #'run-after-enable-theme-hook) | ||
| 1911 | #+end_src | ||
| 1912 | |||
| 1913 | This creates the ~after-enable-theme-hook~ and makes it run after each | ||
| 1914 | call to ~enable-theme~, which means that it will work for all themes and | ||
| 1915 | also has the benefit that it does not depend on functions such as | ||
| 1916 | ~modus-themes-toggle~ and the others mentioned above. ~enable-theme~ is | ||
| 1917 | called internally by ~load-theme~, so the hook works everywhere. | ||
| 1918 | |||
| 1919 | Now this specific piece of Elisp may be simple for experienced users, | ||
| 1920 | but it is not easy to read for newcomers, including the author of the | ||
| 1921 | Modus themes for the first several months of their time as an Emacs | ||
| 1922 | user. Hence our hesitation to recommend it as part of the standard | ||
| 1923 | setup of the Modus themes (it is generally a good idea to understand | ||
| 1924 | what the implications are of advising a function). | ||
| 1305 | 1925 | ||
| 1306 | * Face coverage | 1926 | * Face coverage |
| 1307 | :PROPERTIES: | 1927 | :properties: |
| 1308 | :CUSTOM_ID: h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19 | 1928 | :custom_id: h:a9c8f29d-7f72-4b54-b74b-ddefe15d6a19 |
| 1309 | :END: | 1929 | :end: |
| 1310 | 1930 | ||
| 1311 | Modus Operandi and Modus Vivendi try to provide as close to full face | 1931 | The Modus themes try to provide as close to full face coverage as |
| 1312 | coverage as possible. This is necessary to ensure a consistently | 1932 | possible. This is necessary to ensure a consistently accessible reading |
| 1313 | accessible reading experience across all possible interfaces. | 1933 | experience across all available interfaces. |
| 1314 | 1934 | ||
| 1315 | ** Full support for packages or face groups | 1935 | ** Full support for packages or face groups |
| 1316 | :PROPERTIES: | 1936 | :properties: |
| 1317 | :ALT_TITLE: Supported packages | 1937 | :alt_title: Supported packages |
| 1318 | :DESCRIPTION: Full list of covered face groups | 1938 | :description: Full list of covered face groups |
| 1319 | :CUSTOM_ID: h:60ed4275-60d6-49f8-9287-9a64e54bea0e | 1939 | :custom_id: h:60ed4275-60d6-49f8-9287-9a64e54bea0e |
| 1320 | :END: | 1940 | :end: |
| 1941 | #+cindex: Explicitly supported packages | ||
| 1321 | 1942 | ||
| 1322 | This list will always be updated to reflect the current state of the | 1943 | This list will always be updated to reflect the current state of the |
| 1323 | project. The idea is to offer an overview of the known status of all | 1944 | project. The idea is to offer an overview of the known status of all |
| @@ -1337,16 +1958,18 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1337 | + auto-dim-other-buffers | 1958 | + auto-dim-other-buffers |
| 1338 | + avy | 1959 | + avy |
| 1339 | + awesome-tray | 1960 | + awesome-tray |
| 1961 | + bbdb | ||
| 1340 | + binder | 1962 | + binder |
| 1341 | + bm | 1963 | + bm |
| 1342 | + bongo | 1964 | + bongo |
| 1343 | + boon | 1965 | + boon |
| 1344 | + breakpoint (provided by the built-in =gdb-mi.el= library) | 1966 | + breakpoint (provided by the built-in {{{file(gdb-mi.el)}}} library) |
| 1345 | + buffer-expose | 1967 | + buffer-expose |
| 1346 | + calendar and diary | 1968 | + calendar and diary |
| 1347 | + calfw | 1969 | + calfw |
| 1348 | + centaur-tabs | 1970 | + centaur-tabs |
| 1349 | + change-log and log-view (such as =vc-print-log= and =vc-print-root-log=) | 1971 | + cfrs |
| 1972 | + change-log and log-view (such as ~vc-print-log~, ~vc-print-root-log~) | ||
| 1350 | + cider | 1973 | + cider |
| 1351 | + circe | 1974 | + circe |
| 1352 | + color-rg | 1975 | + color-rg |
| @@ -1355,6 +1978,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1355 | + company-posframe | 1978 | + company-posframe |
| 1356 | + compilation-mode | 1979 | + compilation-mode |
| 1357 | + completions | 1980 | + completions |
| 1981 | + consult | ||
| 1358 | + counsel* | 1982 | + counsel* |
| 1359 | + counsel-css | 1983 | + counsel-css |
| 1360 | + counsel-notmuch | 1984 | + counsel-notmuch |
| @@ -1363,7 +1987,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1363 | + cperl-mode | 1987 | + cperl-mode |
| 1364 | + csv-mode | 1988 | + csv-mode |
| 1365 | + ctrlf | 1989 | + ctrlf |
| 1366 | + custom (=M-x customize=) | 1990 | + custom (what you get with {{{kbd(M-x customize)}}}) |
| 1367 | + dap-mode | 1991 | + dap-mode |
| 1368 | + dashboard (emacs-dashboard) | 1992 | + dashboard (emacs-dashboard) |
| 1369 | + deadgrep | 1993 | + deadgrep |
| @@ -1381,8 +2005,11 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1381 | + dired-git-info | 2005 | + dired-git-info |
| 1382 | + dired-narrow | 2006 | + dired-narrow |
| 1383 | + dired-subtree | 2007 | + dired-subtree |
| 2008 | + diredc | ||
| 1384 | + diredfl | 2009 | + diredfl |
| 2010 | + diredp (dired+) | ||
| 1385 | + disk-usage | 2011 | + disk-usage |
| 2012 | + display-fill-column-indicator-mode | ||
| 1386 | + doom-modeline | 2013 | + doom-modeline |
| 1387 | + dynamic-ruler | 2014 | + dynamic-ruler |
| 1388 | + easy-jekyll | 2015 | + easy-jekyll |
| @@ -1408,8 +2035,10 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1408 | + eshell-syntax-highlighting | 2035 | + eshell-syntax-highlighting |
| 1409 | + evil* (evil-mode) | 2036 | + evil* (evil-mode) |
| 1410 | + evil-goggles | 2037 | + evil-goggles |
| 2038 | + evil-snipe | ||
| 1411 | + evil-visual-mark-mode | 2039 | + evil-visual-mark-mode |
| 1412 | + eww | 2040 | + eww |
| 2041 | + exwm | ||
| 1413 | + eyebrowse | 2042 | + eyebrowse |
| 1414 | + fancy-dabbrev | 2043 | + fancy-dabbrev |
| 1415 | + flycheck | 2044 | + flycheck |
| @@ -1443,7 +2072,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1443 | + helpful | 2072 | + helpful |
| 1444 | + highlight-blocks | 2073 | + highlight-blocks |
| 1445 | + highlight-defined | 2074 | + highlight-defined |
| 1446 | + highlight-escape-sequences (=hes-mode=) | 2075 | + highlight-escape-sequences (~hes-mode~) |
| 1447 | + highlight-indentation | 2076 | + highlight-indentation |
| 1448 | + highlight-numbers | 2077 | + highlight-numbers |
| 1449 | + highlight-symbol | 2078 | + highlight-symbol |
| @@ -1468,6 +2097,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1468 | + interaction-log | 2097 | + interaction-log |
| 1469 | + ioccur | 2098 | + ioccur |
| 1470 | + isearch, occur, etc. | 2099 | + isearch, occur, etc. |
| 2100 | + isl (isearch-light) | ||
| 1471 | + ivy* | 2101 | + ivy* |
| 1472 | + ivy-posframe | 2102 | + ivy-posframe |
| 1473 | + jira (org-jira) | 2103 | + jira (org-jira) |
| @@ -1477,19 +2107,22 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1477 | + jupyter | 2107 | + jupyter |
| 1478 | + kaocha-runner | 2108 | + kaocha-runner |
| 1479 | + keycast | 2109 | + keycast |
| 1480 | + line numbers (=display-line-numbers-mode= and global variant) | 2110 | + line numbers (~display-line-numbers-mode~ and global variant) |
| 1481 | + lsp-mode | 2111 | + lsp-mode |
| 1482 | + lsp-ui | 2112 | + lsp-ui |
| 2113 | + macrostep | ||
| 1483 | + magit | 2114 | + magit |
| 1484 | + magit-imerge | 2115 | + magit-imerge |
| 1485 | + make-mode | 2116 | + make-mode |
| 1486 | + man | 2117 | + man |
| 2118 | + marginalia | ||
| 1487 | + markdown-mode | 2119 | + markdown-mode |
| 1488 | + markup-faces (=adoc-mode=) | 2120 | + markup-faces (~adoc-mode~) |
| 1489 | + mentor | 2121 | + mentor |
| 1490 | + messages | 2122 | + messages |
| 1491 | + minibuffer-line | 2123 | + minibuffer-line |
| 1492 | + minimap | 2124 | + minimap |
| 2125 | + mmm-mode | ||
| 1493 | + modeline | 2126 | + modeline |
| 1494 | + mood-line | 2127 | + mood-line |
| 1495 | + moody | 2128 | + moody |
| @@ -1512,11 +2145,12 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1512 | + org-roam | 2145 | + org-roam |
| 1513 | + org-superstar | 2146 | + org-superstar |
| 1514 | + org-table-sticky-header | 2147 | + org-table-sticky-header |
| 2148 | + org-tree-slide | ||
| 1515 | + org-treescope | 2149 | + org-treescope |
| 1516 | + origami | 2150 | + origami |
| 1517 | + outline-mode | 2151 | + outline-mode |
| 1518 | + outline-minor-faces | 2152 | + outline-minor-faces |
| 1519 | + package (=M-x list-packages=) | 2153 | + package (what you get with {{{kbd(M-x list-packages)}}}) |
| 1520 | + page-break-lines | 2154 | + page-break-lines |
| 1521 | + paradox | 2155 | + paradox |
| 1522 | + paren-face | 2156 | + paren-face |
| @@ -1532,23 +2166,28 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1532 | + popup | 2166 | + popup |
| 1533 | + powerline | 2167 | + powerline |
| 1534 | + powerline-evil | 2168 | + powerline-evil |
| 2169 | + prism ([[#h:a94272e0-99da-4149-9e80-11a7e67a2cf2][Note for prism.el]]) | ||
| 1535 | + proced | 2170 | + proced |
| 1536 | + prodigy | 2171 | + prodigy |
| 2172 | + quick-peek | ||
| 1537 | + racket-mode | 2173 | + racket-mode |
| 1538 | + rainbow-blocks | 2174 | + rainbow-blocks |
| 1539 | + rainbow-identifiers | 2175 | + rainbow-identifiers |
| 1540 | + rainbow-delimiters | 2176 | + rainbow-delimiters |
| 1541 | + rcirc | 2177 | + rcirc |
| 1542 | + regexp-builder (also known as =re-builder=) | 2178 | + recursion-indicator |
| 2179 | + regexp-builder (also known as ~re-builder~) | ||
| 1543 | + rg (rg.el) | 2180 | + rg (rg.el) |
| 1544 | + ripgrep | 2181 | + ripgrep |
| 1545 | + rmail | 2182 | + rmail |
| 1546 | + ruler-mode | 2183 | + ruler-mode |
| 1547 | + sallet | 2184 | + sallet |
| 1548 | + selectrum | 2185 | + selectrum |
| 2186 | + selectrum-prescient | ||
| 1549 | + semantic | 2187 | + semantic |
| 1550 | + sesman | 2188 | + sesman |
| 1551 | + shell-script-mode | 2189 | + shell-script-mode |
| 2190 | + shortdoc | ||
| 1552 | + show-paren-mode | 2191 | + show-paren-mode |
| 1553 | + shr | 2192 | + shr |
| 1554 | + side-notes | 2193 | + side-notes |
| @@ -1557,9 +2196,11 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1557 | + smart-mode-line | 2196 | + smart-mode-line |
| 1558 | + smartparens | 2197 | + smartparens |
| 1559 | + smerge | 2198 | + smerge |
| 2199 | + solaire | ||
| 1560 | + spaceline | 2200 | + spaceline |
| 1561 | + speedbar | 2201 | + speedbar |
| 1562 | + spell-fu | 2202 | + spell-fu |
| 2203 | + spray | ||
| 1563 | + stripes | 2204 | + stripes |
| 1564 | + suggest | 2205 | + suggest |
| 1565 | + switch-window | 2206 | + switch-window |
| @@ -1570,6 +2211,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1570 | + syslog-mode | 2211 | + syslog-mode |
| 1571 | + table (built-in table.el) | 2212 | + table (built-in table.el) |
| 1572 | + telephone-line | 2213 | + telephone-line |
| 2214 | + terraform-mode | ||
| 1573 | + term | 2215 | + term |
| 1574 | + tomatinho | 2216 | + tomatinho |
| 1575 | + transient (pop-up windows such as Magit's) | 2217 | + transient (pop-up windows such as Magit's) |
| @@ -1580,7 +2222,7 @@ have lots of extensions, so the "full support" may not be 100% true… | |||
| 1580 | + typescript | 2222 | + typescript |
| 1581 | + undo-tree | 2223 | + undo-tree |
| 1582 | + vc (built-in mode line status for version control) | 2224 | + vc (built-in mode line status for version control) |
| 1583 | + vc-annotate (=C-x v g=) | 2225 | + vc-annotate (the out put of {{{kbd(C-x v g)}}}) |
| 1584 | + vdiff | 2226 | + vdiff |
| 1585 | + vimish-fold | 2227 | + vimish-fold |
| 1586 | + visible-mark | 2228 | + visible-mark |
| @@ -1608,67 +2250,234 @@ Plus many other miscellaneous faces that are provided by the upstream | |||
| 1608 | GNU Emacs distribution. | 2250 | GNU Emacs distribution. |
| 1609 | 2251 | ||
| 1610 | ** Indirectly covered packages | 2252 | ** Indirectly covered packages |
| 1611 | :PROPERTIES: | 2253 | :properties: |
| 1612 | :CUSTOM_ID: h:2cb359c7-3a84-4262-bab3-dcdc1d0034d7 | 2254 | :custom_id: h:2cb359c7-3a84-4262-bab3-dcdc1d0034d7 |
| 1613 | :END: | 2255 | :end: |
| 2256 | #+cindex: Implicitly supported packages | ||
| 1614 | 2257 | ||
| 1615 | These do not require any extra styles because they are configured to | 2258 | These do not require any extra styles because they are configured to |
| 1616 | inherit from some basic faces. Please confirm. | 2259 | inherit from some basic faces. Please confirm. |
| 1617 | 2260 | ||
| 1618 | + edit-indirect | 2261 | + edit-indirect |
| 1619 | + evil-owl | 2262 | + evil-owl |
| 2263 | + fortran-mode | ||
| 2264 | + goggles | ||
| 1620 | + i3wm-config-mode | 2265 | + i3wm-config-mode |
| 1621 | + perl-mode | 2266 | + perl-mode |
| 1622 | + php-mode | 2267 | + php-mode |
| 1623 | + rjsx-mode | 2268 | + rjsx-mode |
| 1624 | + swift-mode | 2269 | + swift-mode |
| 1625 | 2270 | + tab-bar-echo-area | |
| 1626 | ** Will NOT be supported | ||
| 1627 | :PROPERTIES: | ||
| 1628 | :CUSTOM_ID: h:6c6e8d94-6782-47fc-9eef-ad78671e9eea | ||
| 1629 | :END: | ||
| 1630 | |||
| 1631 | I have thus far identified a single package that does fit into the | ||
| 1632 | overarching objective of this project: [[https://github.com/hlissner/emacs-solaire-mode][solaire]]. It basically tries to | ||
| 1633 | cast a less intense background on the main file-visiting buffers, so | ||
| 1634 | that secondary elements like sidebars can have the default (pure | ||
| 1635 | white/black) background. | ||
| 1636 | |||
| 1637 | I will only cover this package if it ever supports the inverse effect: | ||
| 1638 | less intense colors (but still accessible) for ancillary interfaces | ||
| 1639 | and the intended styles for the content you are actually working on. | ||
| 1640 | 2271 | ||
| 1641 | * Notes for individual packages | 2272 | * Notes for individual packages |
| 1642 | :PROPERTIES: | 2273 | :properties: |
| 1643 | :CUSTOM_ID: h:4c4d901a-84d7-4f20-bd99-0808c2b06eba | 2274 | :custom_id: h:4c4d901a-84d7-4f20-bd99-0808c2b06eba |
| 1644 | :END: | 2275 | :end: |
| 1645 | 2276 | ||
| 1646 | This section covers information that may be of interest to users of | 2277 | This section covers information that may be of interest to users of |
| 1647 | individual packages. | 2278 | individual packages. |
| 1648 | 2279 | ||
| 2280 | ** Note for display-fill-column-indicator-mode | ||
| 2281 | :properties: | ||
| 2282 | :custom_id: h:2a602816-bc1b-45bf-9675-4cbbd7bf6cab | ||
| 2283 | :end: | ||
| 2284 | |||
| 2285 | While designing the style for ~display-fill-column-indicator-mode~, we | ||
| 2286 | stayed close to the mode's defaults: to apply a subtle foreground color | ||
| 2287 | to the ~fill-column-indicator~ face, which blends well with the rest of | ||
| 2288 | theme and is consistent with the role of that mode. This is to not | ||
| 2289 | upset the expectations of users. | ||
| 2290 | |||
| 2291 | Nevertheless, ~display-fill-column-indicator-mode~ has some known | ||
| 2292 | limitations pertaining to its choice of using typographic characters to | ||
| 2293 | draw its indicator. What should be a continuous vertical line might | ||
| 2294 | appear as a series of dashes in certain contexts or under specific | ||
| 2295 | conditions: a non-default value for ~line-spacing~, scaled and/or | ||
| 2296 | variable-pitch headings have been observed to cause this effect. | ||
| 2297 | |||
| 2298 | Given that we cannot control such factors, it may be better for affected | ||
| 2299 | users to deviate from the default style of the ~fill-column-indicator~ | ||
| 2300 | face. Instead of setting a foreground color, one could use a background | ||
| 2301 | and have the foreground be indistinguishable from it. For example: | ||
| 2302 | |||
| 2303 | #+begin_src emacs-lisp | ||
| 2304 | (modus-themes-with-colors | ||
| 2305 | (custom-set-faces | ||
| 2306 | `(fill-column-indicator ((,class :background ,bg-inactive | ||
| 2307 | :foreground ,bg-inactive))))) | ||
| 2308 | #+end_src | ||
| 2309 | |||
| 2310 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | ||
| 2311 | |||
| 2312 | ** Note for mmm-mode.el background colors | ||
| 2313 | :properties: | ||
| 2314 | :custom_id: h:99cf0d6c-e478-4e26-9932-3bf3427d13f6 | ||
| 2315 | :end: | ||
| 2316 | |||
| 2317 | The faces used by {{{file(mmm-mode.el)}}} are expected to have a colorful | ||
| 2318 | background, while they should not touch any foreground value. The idea | ||
| 2319 | is that they must not interfere with existing fontification. Those | ||
| 2320 | background colors need to be distinct from each other, such as an | ||
| 2321 | unambiguous red juxtaposed with a clear blue. | ||
| 2322 | |||
| 2323 | While this design may be internally consistent with the raison d'être of | ||
| 2324 | that library, it inevitably produces inaccessible color combinations. | ||
| 2325 | |||
| 2326 | There are two competing goals at play: | ||
| 2327 | |||
| 2328 | 1. Legibility of the text, understood as the contrast ratio between the | ||
| 2329 | background and the foreground. | ||
| 2330 | |||
| 2331 | 2. Semantic precision of each face which entails faithfulness to | ||
| 2332 | color-coding of the underlying background. | ||
| 2333 | |||
| 2334 | As the Modus themes are designed with the express purpose of conforming | ||
| 2335 | with the first point, we have to forgo the apparent color-coding of the | ||
| 2336 | background elements. Instead we use subtle colors that do not undermine | ||
| 2337 | the legibility of the affected text while they still offer a sense of | ||
| 2338 | added context. | ||
| 2339 | |||
| 2340 | Users who might prefer to fall below the minimum 7:1 contrast ratio in | ||
| 2341 | relative luminance (the accessibility target we conform with), can opt | ||
| 2342 | to configure the relevant faces on their own. | ||
| 2343 | |||
| 2344 | [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | ||
| 2345 | |||
| 2346 | This example uses more vivid background colors, though it comes at the | ||
| 2347 | very high cost of degraded legibility. | ||
| 2348 | |||
| 2349 | #+begin_src emacs-lisp | ||
| 2350 | (modus-themes-with-colors | ||
| 2351 | (custom-set-faces | ||
| 2352 | `(mmm-cleanup-submode-face ((,class :background ,yellow-refine-bg))) | ||
| 2353 | `(mmm-code-submode-face ((,class :background ,bg-active))) | ||
| 2354 | `(mmm-comment-submode-face ((,class :background ,blue-refine-bg))) | ||
| 2355 | `(mmm-declaration-submode-face ((,class :background ,cyan-refine-bg))) | ||
| 2356 | `(mmm-default-submode-face ((,class :background ,bg-alt))) | ||
| 2357 | `(mmm-init-submode-face ((,class :background ,magenta-refine-bg))) | ||
| 2358 | `(mmm-output-submode-face ((,class :background ,red-refine-bg))) | ||
| 2359 | `(mmm-special-submode-face ((,class :background ,green-refine-bg))))) | ||
| 2360 | #+end_src | ||
| 2361 | |||
| 2362 | ** Note for prism.el | ||
| 2363 | :properties: | ||
| 2364 | :alt_title: Note for prism | ||
| 2365 | :custom_id: h:a94272e0-99da-4149-9e80-11a7e67a2cf2 | ||
| 2366 | :end: | ||
| 2367 | |||
| 2368 | This package by Adam Porter, aka "alphapapa" or "github-alphapapa", | ||
| 2369 | implements an alternative to the typical coloration of code. Instead of | ||
| 2370 | highlighting the syntactic constructs, it applies color to different | ||
| 2371 | levels of depth in the code structure. | ||
| 2372 | |||
| 2373 | As {{{file(prism.el)}}} offers a broad range of customisations, we cannot | ||
| 2374 | style it directly at the theme level: that would run contrary to the | ||
| 2375 | spirit of the package. Instead, we may offer preset color schemes. | ||
| 2376 | Those should offer a starting point for users to adapt to their needs. | ||
| 2377 | |||
| 2378 | In the following code snippets, we employ the ~modus-themes-with-colors~ | ||
| 2379 | macro: [[#h:51ba3547-b8c8-40d6-ba5a-4586477fd4ae][Face specs at scale using the themes' palette]]. | ||
| 2380 | |||
| 2381 | These are the minimum recommended settings with 16 colors: | ||
| 2382 | |||
| 2383 | #+begin_src emacs-lisp | ||
| 2384 | (setq prism-num-faces 16) | ||
| 2385 | |||
| 2386 | (prism-set-colors | ||
| 2387 | :desaturations '(0) ; do not change---may lower the contrast ratio | ||
| 2388 | :lightens '(0) ; same | ||
| 2389 | :colors (modus-themes-with-colors | ||
| 2390 | (list fg-main | ||
| 2391 | magenta | ||
| 2392 | cyan-alt-other | ||
| 2393 | magenta-alt-other | ||
| 2394 | blue | ||
| 2395 | magenta-alt | ||
| 2396 | cyan-alt | ||
| 2397 | red-alt-other | ||
| 2398 | green | ||
| 2399 | fg-main | ||
| 2400 | cyan | ||
| 2401 | yellow | ||
| 2402 | blue-alt | ||
| 2403 | red-alt | ||
| 2404 | green-alt-other | ||
| 2405 | fg-special-warm))) | ||
| 2406 | #+end_src | ||
| 2407 | |||
| 2408 | With 8 colors: | ||
| 2409 | |||
| 2410 | #+begin_src emacs-lisp | ||
| 2411 | (setq prism-num-faces 8) | ||
| 2412 | |||
| 2413 | (prism-set-colors | ||
| 2414 | :desaturations '(0) ; do not change---may lower the contrast ratio | ||
| 2415 | :lightens '(0) ; same | ||
| 2416 | :colors (modus-themes-with-colors | ||
| 2417 | (list fg-special-cold | ||
| 2418 | magenta | ||
| 2419 | magenta-alt-other | ||
| 2420 | cyan-alt-other | ||
| 2421 | fg-main | ||
| 2422 | blue-alt | ||
| 2423 | red-alt-other | ||
| 2424 | cyan))) | ||
| 2425 | #+end_src | ||
| 2426 | |||
| 2427 | And this is with 4 colors, which produces results that are the closest | ||
| 2428 | to the themes' default aesthetic: | ||
| 2429 | |||
| 2430 | #+begin_src emacs-lisp | ||
| 2431 | (setq prism-num-faces 4) | ||
| 2432 | |||
| 2433 | (prism-set-colors | ||
| 2434 | :desaturations '(0) ; do not change---may lower the contrast ratio | ||
| 2435 | :lightens '(0) ; same | ||
| 2436 | :colors (modus-themes-with-colors | ||
| 2437 | (list fg-main | ||
| 2438 | cyan-alt-other | ||
| 2439 | magenta-alt-other | ||
| 2440 | magenta))) | ||
| 2441 | #+end_src | ||
| 2442 | |||
| 2443 | If you need to apply desaturation and lightening, you can use what the | ||
| 2444 | {{{file(prism.el)}}} documentation recommends, like this (adapting to the | ||
| 2445 | examples with the 4, 8, 16 colors): | ||
| 2446 | |||
| 2447 | #+begin_src emacs-lisp | ||
| 2448 | (prism-set-colors | ||
| 2449 | :desaturations (cl-loop for i from 0 below 16 collect (* i 2.5)) | ||
| 2450 | :lightens (cl-loop for i from 0 below 16 collect (* i 2.5)) | ||
| 2451 | :colors (modus-themes-with-colors | ||
| 2452 | (list fg-main | ||
| 2453 | cyan-alt-other | ||
| 2454 | magenta-alt-other | ||
| 2455 | magenta))) | ||
| 2456 | #+end_src | ||
| 2457 | |||
| 1649 | ** Note on company-mode overlay pop-up | 2458 | ** Note on company-mode overlay pop-up |
| 1650 | :PROPERTIES: | 2459 | :properties: |
| 1651 | :CUSTOM_ID: h:20cef8c4-d11f-4053-8b2c-2872925780b1 | 2460 | :custom_id: h:20cef8c4-d11f-4053-8b2c-2872925780b1 |
| 1652 | :END: | 2461 | :end: |
| 1653 | 2462 | ||
| 1654 | By default, the =company-mode= pop-up that lists completion candidates is | 2463 | By default, the ~company-mode~ pop-up that lists completion candidates is |
| 1655 | drawn using an overlay. This creates alignment issues every time it is | 2464 | drawn using an overlay. This creates alignment issues every time it is |
| 1656 | placed above a piece of text that has a different height than the | 2465 | placed above a piece of text that has a different height than the |
| 1657 | default. | 2466 | default. |
| 1658 | 2467 | ||
| 1659 | The solution recommended by the project's maintainer is to use an | 2468 | The solution recommended by the project's maintainer is to use an |
| 1660 | alternative front-end for drawing the pop-up which uses child frames | 2469 | alternative front-end for drawing the pop-up which draws child frames |
| 1661 | instead of overlays.[fn:: | 2470 | instead of overlays.[fn:: |
| 1662 | https://github.com/company-mode/company-mode/issues/1010][fn:: | 2471 | https://github.com/company-mode/company-mode/issues/1010][fn:: |
| 1663 | https://github.com/tumashu/company-posframe/] | 2472 | https://github.com/tumashu/company-posframe/] |
| 1664 | 2473 | ||
| 1665 | ** Note for ERC escaped color sequences | 2474 | ** Note for ERC escaped color sequences |
| 1666 | :PROPERTIES: | 2475 | :properties: |
| 1667 | :CUSTOM_ID: h:98bdf319-1e32-4469-8a01-771200fba65c | 2476 | :custom_id: h:98bdf319-1e32-4469-8a01-771200fba65c |
| 1668 | :END: | 2477 | :end: |
| 1669 | 2478 | ||
| 1670 | The built-in IRC client =erc= has the ability to colorise any text using | 2479 | The built-in IRC client ~erc~ has the ability to colorise any text using |
| 1671 | escape sequences that start with =^C= (inserted with =C-q C-c=) and are | 2480 | escape sequences that start with =^C= (inserted with {{{kbd(C-q C-c)}}}) and are |
| 1672 | followed by a number for the foreground and background.[fn:: This page | 2481 | followed by a number for the foreground and background.[fn:: This page |
| 1673 | explains the basics, though it is not specific to Emacs: | 2482 | explains the basics, though it is not specific to Emacs: |
| 1674 | https://www.mirc.com/colors.html] Possible numbers are 0-15, with the | 2483 | https://www.mirc.com/colors.html] Possible numbers are 0-15, with the |
| @@ -1681,13 +2490,13 @@ separated by a comma. Like this =^C1,6=. The minimum setup is this: | |||
| 1681 | erc-interpret-mirc-color t) | 2490 | erc-interpret-mirc-color t) |
| 1682 | #+end_src | 2491 | #+end_src |
| 1683 | 2492 | ||
| 1684 | As this allows users to make arbitrary combinations, it is impossible to | 2493 | As this allows users the chance to make arbitrary combinations, it is |
| 1685 | guarantee a consistently high contrast ratio. All we can we do is | 2494 | impossible to guarantee a consistently high contrast ratio. All we can |
| 1686 | provide guidance on the combinations that satisfy the accessibility | 2495 | we do is provide guidance on the combinations that satisfy the |
| 1687 | standard of the themes: | 2496 | accessibility standard of the themes: |
| 1688 | 2497 | ||
| 1689 | + Modus Operandi :: Use foreground color 1 for all backgrounds from | 2498 | + Modus Operandi :: Use foreground color 1 for all backgrounds from |
| 1690 | 2-15. Like so: =C-q C-c1,N= where =N= is the background. | 2499 | 2-15. Like so: {{{kbd(C-q C-c1,N)}}} where =N= is the background. |
| 1691 | 2500 | ||
| 1692 | + Modus Vivendi :: Use foreground color 0 for all backgrounds from | 2501 | + Modus Vivendi :: Use foreground color 0 for all backgrounds from |
| 1693 | 2-13. Use foreground =1= for backgrounds 14, 15. | 2502 | 2-13. Use foreground =1= for backgrounds 14, 15. |
| @@ -1696,35 +2505,38 @@ Colors 0 and 1 are white and black respectively. So combine them | |||
| 1696 | together, if you must. | 2505 | together, if you must. |
| 1697 | 2506 | ||
| 1698 | ** Note for powerline or spaceline | 2507 | ** Note for powerline or spaceline |
| 1699 | :PROPERTIES: | 2508 | :properties: |
| 1700 | :CUSTOM_ID: h:9130a8ba-d8e3-41be-a58b-3cb1eb7b6d17 | 2509 | :custom_id: h:9130a8ba-d8e3-41be-a58b-3cb1eb7b6d17 |
| 1701 | :END: | 2510 | :end: |
| 1702 | 2511 | ||
| 1703 | Both Powerline and Spaceline package users will likely need to use the | 2512 | Both Powerline and Spaceline package users will likely need to use the |
| 1704 | command =powerline-reset= whenever they make changes to their themes | 2513 | command ~powerline-reset~ whenever they make changes to their themes |
| 1705 | and/or modeline setup. | 2514 | and/or modeline setup. |
| 1706 | 2515 | ||
| 1707 | ** Note on shr colors | 2516 | ** Note on SHR colors |
| 1708 | :PROPERTIES: | 2517 | :properties: |
| 1709 | :CUSTOM_ID: h:4cc767dc-ffef-4c5c-9f10-82eb7b8921bf | 2518 | :custom_id: h:4cc767dc-ffef-4c5c-9f10-82eb7b8921bf |
| 1710 | :END: | 2519 | :end: |
| 1711 | 2520 | ||
| 1712 | Emacs' HTML rendering mechanism (=shr=) may need explicit configuration to | 2521 | Emacs' HTML rendering library ({{{file(shr.el)}}}) may need explicit |
| 1713 | respect the theme's colors instead of whatever specifications the | 2522 | configuration to respect the theme's colors instead of whatever |
| 1714 | webpage provides. Consult =C-h v shr-use-colors=. | 2523 | specifications the webpage provides. |
| 2524 | |||
| 2525 | Consult {{{kbd(C-h v shr-use-colors)}}}. | ||
| 1715 | 2526 | ||
| 1716 | ** Note for Helm grep | 2527 | ** Note for Helm grep |
| 1717 | :PROPERTIES: | 2528 | :properties: |
| 1718 | :CUSTOM_ID: h:d28879a2-8e4b-4525-986e-14c0f873d229 | 2529 | :custom_id: h:d28879a2-8e4b-4525-986e-14c0f873d229 |
| 1719 | :END: | 2530 | :end: |
| 1720 | 2531 | ||
| 1721 | There is one face from the Helm package that is meant to highlight the | 2532 | There is one face from the Helm package that is meant to highlight the |
| 1722 | matches of a grep or grep-like command (=ag= or =ripgrep=). It is | 2533 | matches of a grep or grep-like command (=ag= or =ripgrep=). It is |
| 1723 | =helm-grep-match=. However, this face can only apply when the user does | 2534 | ~helm-grep-match~. However, this face can only apply when the user does |
| 1724 | not pass =--color=always= as a command-line option for their command. | 2535 | not pass =--color=always= as a command-line option for their command. |
| 1725 | 2536 | ||
| 1726 | Here is the docstring for that face, which is defined in the | 2537 | Here is the docstring for that face, which is defined in the |
| 1727 | =helm-grep.el= library (view a library with =M-x find-library=). | 2538 | {{{file(helm-grep.el)}}} library (you can always visit the source code with |
| 2539 | {{{kbd(M-x find-library)}}}). | ||
| 1728 | 2540 | ||
| 1729 | #+begin_quote | 2541 | #+begin_quote |
| 1730 | Face used to highlight grep matches. Have no effect when grep backend | 2542 | Face used to highlight grep matches. Have no effect when grep backend |
| @@ -1734,23 +2546,23 @@ use "--color=" | |||
| 1734 | The user must either remove =--color= from the flags passed to the grep | 2546 | The user must either remove =--color= from the flags passed to the grep |
| 1735 | function, or explicitly use =--color=never= (or equivalent). Helm | 2547 | function, or explicitly use =--color=never= (or equivalent). Helm |
| 1736 | provides user-facing customization options for controlling the grep | 2548 | provides user-facing customization options for controlling the grep |
| 1737 | function's parameters, such as =helm-grep-default-command= and | 2549 | function's parameters, such as ~helm-grep-default-command~ and |
| 1738 | =helm-grep-git-grep-command=. | 2550 | ~helm-grep-git-grep-command~. |
| 1739 | 2551 | ||
| 1740 | When =--color=always= is in effect, the grep output will use red text in | 2552 | When =--color=always= is in effect, the grep output will use red text in |
| 1741 | bold letter forms to present the matching part in the list of | 2553 | bold letter forms to present the matching part in the list of |
| 1742 | candidates. That style still meets the contrast ratio target of >= 7:1 | 2554 | candidates. That style still meets the contrast ratio target of >= 7:1 |
| 1743 | (accessibility standard WCAG AAA), because it draws the reference to | 2555 | (accessibility standard WCAG AAA), because it draws the reference to |
| 1744 | ANSI color number 1 (red) from the already-supported array of | 2556 | ANSI color number 1 (red) from the already-supported array of |
| 1745 | =ansi-color-names-vector=. | 2557 | ~ansi-color-names-vector~. |
| 1746 | 2558 | ||
| 1747 | ** Note on vc-annotate-background-mode | 2559 | ** Note on vc-annotate-background-mode |
| 1748 | :PROPERTIES: | 2560 | :properties: |
| 1749 | :CUSTOM_ID: h:5095cbd1-e17a-419c-93e8-951c186362a3 | 2561 | :custom_id: h:5095cbd1-e17a-419c-93e8-951c186362a3 |
| 1750 | :END: | 2562 | :end: |
| 1751 | 2563 | ||
| 1752 | Due to the unique way =vc-annotate= (=C-x v g=) applies colors, support for | 2564 | Due to the unique way ~vc-annotate~ ({{{kbd(C-x v g)}}}) applies colors, support |
| 1753 | its background mode (=vc-annotate-background-mode=) is disabled at the | 2565 | for its background mode (~vc-annotate-background-mode~) is disabled at the |
| 1754 | theme level. | 2566 | theme level. |
| 1755 | 2567 | ||
| 1756 | Normally, such a drastic measure should not belong in a theme: assuming | 2568 | Normally, such a drastic measure should not belong in a theme: assuming |
| @@ -1760,35 +2572,87 @@ while still supporting a useful built-in tool. | |||
| 1760 | 2572 | ||
| 1761 | If there actually is a way to avoid such a course of action, without | 2573 | If there actually is a way to avoid such a course of action, without |
| 1762 | prejudice to the accessibility standard of this project, then please | 2574 | prejudice to the accessibility standard of this project, then please |
| 1763 | report as much or send patches (see [[#h:9c3cd842-14b7-44d7-84b2-a5c8bc3fc3b1][Contributing]]). | 2575 | report as much or send patches ([[#h:9c3cd842-14b7-44d7-84b2-a5c8bc3fc3b1][Contributing]]). |
| 2576 | |||
| 2577 | ** Note on pdf-tools link hints | ||
| 2578 | :properties: | ||
| 2579 | :custom_id: h:2659d13e-b1a5-416c-9a89-7c3ce3a76574 | ||
| 2580 | :end: | ||
| 2581 | |||
| 2582 | Hints are drawn by [[https://imagemagick.org/][ImageMagick]], not Emacs, i.e., ImageMagick doesn't | ||
| 2583 | know about the hint face unless you tell ImageMagick about it. By | ||
| 2584 | default, only the foreground and background color attributes are | ||
| 2585 | passed. The below snippet adds to those the various font attributes. As | ||
| 2586 | it queries various faces, specifically ~pdf-links-read-link~ and the faces | ||
| 2587 | it inherits, it needs to be added to your initialization file after | ||
| 2588 | you've customized any faces. | ||
| 2589 | |||
| 2590 | #+begin_src emacs-lisp | ||
| 2591 | (use-package pdf-links | ||
| 2592 | :config | ||
| 2593 | (let ((spec | ||
| 2594 | (apply #'append | ||
| 2595 | (mapcar | ||
| 2596 | (lambda (name) | ||
| 2597 | (list name | ||
| 2598 | (face-attribute 'pdf-links-read-link | ||
| 2599 | name nil 'default))) | ||
| 2600 | '(:family :width :weight :slant))))) | ||
| 2601 | (setq pdf-links-read-link-convert-commands | ||
| 2602 | `("-density" "96" | ||
| 2603 | "-family" ,(plist-get spec :family) | ||
| 2604 | "-stretch" ,(let* ((width (plist-get spec :width)) | ||
| 2605 | (name (symbol-name width))) | ||
| 2606 | (replace-regexp-in-string "-" "" | ||
| 2607 | (capitalize name))) | ||
| 2608 | "-weight" ,(pcase (plist-get spec :weight) | ||
| 2609 | ('ultra-light "Thin") | ||
| 2610 | ('extra-light "ExtraLight") | ||
| 2611 | ('light "Light") | ||
| 2612 | ('semi-bold "SemiBold") | ||
| 2613 | ('bold "Bold") | ||
| 2614 | ('extra-bold "ExtraBold") | ||
| 2615 | ('ultra-bold "Black") | ||
| 2616 | (_weight "Normal")) | ||
| 2617 | "-style" ,(pcase (plist-get spec :slant) | ||
| 2618 | ('italic "Italic") | ||
| 2619 | ('oblique "Oblique") | ||
| 2620 | (_slant "Normal")) | ||
| 2621 | "-pointsize" "%P" | ||
| 2622 | "-undercolor" "%f" | ||
| 2623 | "-fill" "%b" | ||
| 2624 | "-draw" "text %X,%Y '%c'")))) | ||
| 2625 | #+end_src | ||
| 1764 | 2626 | ||
| 1765 | * Contributing | 2627 | * Contributing |
| 1766 | :PROPERTIES: | 2628 | :properties: |
| 1767 | :CUSTOM_ID: h:9c3cd842-14b7-44d7-84b2-a5c8bc3fc3b1 | 2629 | :custom_id: h:9c3cd842-14b7-44d7-84b2-a5c8bc3fc3b1 |
| 1768 | :END: | 2630 | :end: |
| 1769 | 2631 | ||
| 1770 | This section documents the canonical sources of the themes and the ways | 2632 | This section documents the canonical sources of the themes and the ways |
| 1771 | in which you can contribute to their ongoing development. | 2633 | in which you can contribute to their ongoing development. |
| 1772 | 2634 | ||
| 1773 | ** Sources of the themes | 2635 | ** Sources of the themes |
| 1774 | :PROPERTIES: | 2636 | :properties: |
| 1775 | :CUSTOM_ID: h:89504f1c-c9a1-4bd9-ab39-78fd0eddb47c | 2637 | :custom_id: h:89504f1c-c9a1-4bd9-ab39-78fd0eddb47c |
| 1776 | :END: | 2638 | :end: |
| 2639 | #+cindex: Sources of the themes | ||
| 1777 | 2640 | ||
| 1778 | The =modus-operandi= and =modus-vivendi= themes are built into Emacs. | 2641 | The ~modus-operandi~ and ~modus-vivendi~ themes are built into Emacs. |
| 1779 | Currently they are in the project's =master= branch, which is tracking the | 2642 | Currently they are in Emacs' git main branch (trunk), which is tracking |
| 1780 | next development release target. | 2643 | the next development release target. |
| 1781 | 2644 | ||
| 1782 | The source code of the themes is [[https://gitlab.com/protesilaos/modus-themes/][available on Gitlab]], for the time | 2645 | The source code of the themes is [[https://gitlab.com/protesilaos/modus-themes/][available on Gitlab]], for the time |
| 1783 | being. A [[https://github.com/protesilaos/modus-themes/][mirror on Github]] is also on offer. | 2646 | being. A [[https://github.com/protesilaos/modus-themes/][mirror on Github]] is also on offer. |
| 1784 | 2647 | ||
| 1785 | An HTML version of this manual is available as an extension to the | 2648 | An HTML version of this manual is provided as an extension of the |
| 1786 | [[https://protesilaos.com/modus-themes/][author's personal website]] (does not rely on any non-free code). | 2649 | [[https://protesilaos.com/modus-themes/][author's personal website]] (does not rely on any non-free code). |
| 1787 | 2650 | ||
| 1788 | ** Issues you can help with | 2651 | ** Issues you can help with |
| 1789 | :PROPERTIES: | 2652 | :properties: |
| 1790 | :CUSTOM_ID: h:6536c8d5-3f98-43ab-a787-b94120e735e8 | 2653 | :custom_id: h:6536c8d5-3f98-43ab-a787-b94120e735e8 |
| 1791 | :END: | 2654 | :end: |
| 2655 | #+cindex: Contributing | ||
| 1792 | 2656 | ||
| 1793 | A few tasks you can help with: | 2657 | A few tasks you can help with: |
| 1794 | 2658 | ||
| @@ -1802,8 +2666,8 @@ A few tasks you can help with: | |||
| 1802 | 2666 | ||
| 1803 | [[#h:111773e2-f26f-4b68-8c4f-9794ca6b9633][Patches require copyright assignment to the FSF]]. | 2667 | [[#h:111773e2-f26f-4b68-8c4f-9794ca6b9633][Patches require copyright assignment to the FSF]]. |
| 1804 | 2668 | ||
| 1805 | It would be great if your feedback also includes some screenshots, GIFs, | 2669 | It is preferable that your feedback includes some screenshots, GIFs, or |
| 1806 | or short videos, as well as further instructions to reproduce a given | 2670 | short videos, as well as further instructions to reproduce a given |
| 1807 | setup. Though this is not a requirement. | 2671 | setup. Though this is not a requirement. |
| 1808 | 2672 | ||
| 1809 | Whatever you do, bear in mind the overarching objective of the Modus | 2673 | Whatever you do, bear in mind the overarching objective of the Modus |
| @@ -1813,11 +2677,9 @@ between aesthetics and accessibility, it shall always be made in the | |||
| 1813 | interest of the latter. | 2677 | interest of the latter. |
| 1814 | 2678 | ||
| 1815 | ** Patches require copyright assignment to the FSF | 2679 | ** Patches require copyright assignment to the FSF |
| 1816 | :PROPERTIES: | 2680 | :properties: |
| 1817 | :ALT_TITLE: Merge requests | 2681 | :custom_id: h:111773e2-f26f-4b68-8c4f-9794ca6b9633 |
| 1818 | :DESCRIPTION: Legal considerations for code patches | 2682 | :end: |
| 1819 | :CUSTOM_ID: h:111773e2-f26f-4b68-8c4f-9794ca6b9633 | ||
| 1820 | :END: | ||
| 1821 | 2683 | ||
| 1822 | Code contributions are most welcome. For any major edit (more than 15 | 2684 | Code contributions are most welcome. For any major edit (more than 15 |
| 1823 | lines, or so, in aggregate per person), you need to make a copyright | 2685 | lines, or so, in aggregate per person), you need to make a copyright |
| @@ -1875,48 +2737,58 @@ your changes? Do you attend a school which might make such a claim?] | |||
| 1875 | [Which files have you changed so far, and which new files have you written | 2737 | [Which files have you changed so far, and which new files have you written |
| 1876 | so far?] | 2738 | so far?] |
| 1877 | 2739 | ||
| 1878 | Changed a couple of themes that are part of the Emacs source code: | ||
| 1879 | |||
| 1880 | ./etc/themes/modus-operandi-theme.el | ||
| 1881 | ./etc/themes/modus-vivendi-theme.el | ||
| 1882 | #+end_example | 2740 | #+end_example |
| 1883 | 2741 | ||
| 1884 | * Acknowledgements | 2742 | * Acknowledgements |
| 1885 | :PROPERTIES: | 2743 | :properties: |
| 1886 | :CUSTOM_ID: h:95c3da23-217f-404e-b5f3-56c75760ebcf | 2744 | :custom_id: h:95c3da23-217f-404e-b5f3-56c75760ebcf |
| 1887 | :END: | 2745 | :end: |
| 2746 | #+cindex: Contributors | ||
| 1888 | 2747 | ||
| 1889 | The Modus themes are a collective effort. Every contribution counts. | 2748 | The Modus themes are a collective effort. Every bit of work matters. |
| 1890 | 2749 | ||
| 1891 | + Author/maintainer :: Protesilaos Stavrou. | 2750 | + Author/maintainer :: Protesilaos Stavrou. |
| 1892 | 2751 | ||
| 1893 | + Contributions to code or documentation :: Anders Johansson, Basil | 2752 | + Contributions to code or documentation :: Anders Johansson, Basil |
| 1894 | L. Contovounesios, Eli Zaretskii, Madhavan Krishnan, Markus Beppler, | 2753 | L.{{{space()}}} Contovounesios, Carlo Zancanaro, Eli Zaretskii, Kostadin |
| 1895 | Matthew Stevenson, Shreyas Ragavan, Stefan Kangas, Vincent Murphy. | 2754 | Ninev, Madhavan Krishnan, Markus Beppler, Matthew Stevenson, Nicolas |
| 1896 | 2755 | De Jaeghere, Shreyas Ragavan, Stefan Kangas, Vincent Murphy, Xinglu | |
| 1897 | + Ideas and user feedback :: Aaron Jensen, Adam Spiers, Alex Griffin, | 2756 | Chen. |
| 1898 | Alex Peitsinis, Alexey Shmalko, Anders Johansson, André Alexandre | 2757 | |
| 1899 | Gomes, Arif Rezai, Basil L. Contovounesios, Damien Cassou, Dario | 2758 | + Ideas and user feedback :: Aaron Jensen, Adam Spiers, Adrian Manea, |
| 1900 | Gjorgjevski, David Edmondson, Davor Rotim, Divan Santana, Gerry | 2759 | Alex Griffin, Alex Peitsinis, Alexey Shmalko, Alok Singh, Anders |
| 1901 | Agbobada, Gianluca Recchia, Ilja Kocken, Iris Garcia, Len Trigg, | 2760 | Johansson, André Alexandre Gomes, Arif Rezai, Basil L.{{{space()}}} |
| 1902 | Manuel Uberti, Mark Burton, Markus Beppler, Michael Goldenberg, Murilo | 2761 | Contovounesios, Burgess Chang, Christian Tietze, Christopher Dimech, |
| 1903 | Pereira, Nicolas De Jaeghere, Paul Poloskov, Pierre Téchoueyres, Roman | 2762 | Damien Cassou, Daniel Mendler, Dario Gjorgjevski, David Edmondson, |
| 1904 | Rudakov, Ryan Phillips, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, | 2763 | Davor Rotim, Divan Santana, Gerry Agbobada, Gianluca Recchia, Gustavo |
| 1905 | Thibaut Verron, Trey Merkley, Togan Muftuoglu, Uri Sharf, Utkarsh | 2764 | Barros, Hörmetjan Yiltiz, Ilja Kocken, Iris Garcia, Jeremy Friesen, |
| 1906 | Singh, Vincent Foley. As well as users: Ben, Eugene, Fourchaux, | 2765 | John Haman, Joshua O'Connor, Kevin Fleming, Kostadin Ninev, Len Trigg, |
| 1907 | Fredrik, Moesasji, Nick, TheBlob42, bepolymathe, dinko, doolio, | 2766 | Manuel Uberti, Mark Burton, Markus Beppler, Michael Goldenberg, Morgan |
| 1908 | jixiuf, okamsn, tycho garen. | 2767 | Smith, Murilo Pereira, Nicolas De Jaeghere, Paul Poloskov, Pete |
| 1909 | 2768 | Kazmier, Peter Wu, Philip K., Pierre Téchoueyres, Roman Rudakov, Ryan | |
| 1910 | + Packaging :: Dhavan Vaidya (Debian), Stefan Kangas (core Emacs), | 2769 | Phillips, Sam Kleinman, Shreyas Ragavan, Simon Pugnet, Tassilo Horn, |
| 1911 | Stefan Monnier (GNU Elpa). | 2770 | Thibaut Verron, Trey Merkley, Togan Muftuoglu, Toon Claes, Uri Sharf, |
| 2771 | Utkarsh Singh, Vincent Foley. As well as users: Ben, CsBigDataHub1, | ||
| 2772 | Emacs Contrib, Eugene, Fourchaux, Fredrik, Moesasji, Nick, TheBlob42, | ||
| 2773 | bepolymathe, doolio, fleimgruber, iSeeU, jixiuf, okamsn. | ||
| 2774 | |||
| 2775 | + Packaging :: Basil L.{{{space()}}} Contovounesios, Eli Zaretskii, Glenn | ||
| 2776 | Morris, Mauro Aranda, Richard Stallman, Stefan Kangas (core Emacs), | ||
| 2777 | Stefan Monnier (GNU Elpa), André Alexandre Gomes, Dimakakos Dimos, | ||
| 2778 | Morgan Smith, Nicolas Goaziou (Guix), Dhavan Vaidya (Debian). | ||
| 1912 | 2779 | ||
| 1913 | + Inspiration for certain features :: Bozhidar Batsov (zenburn-theme), | 2780 | + Inspiration for certain features :: Bozhidar Batsov (zenburn-theme), |
| 1914 | Fabrice Niessen (leuven-theme). | 2781 | Fabrice Niessen (leuven-theme). |
| 1915 | 2782 | ||
| 2783 | Special thanks, in no particular order, to Manuel Uberti and Omar | ||
| 2784 | AntolÃn Camarena for their long time contributions and insightful | ||
| 2785 | commentary. | ||
| 2786 | |||
| 1916 | * Meta | 2787 | * Meta |
| 1917 | :PROPERTIES: | 2788 | :properties: |
| 1918 | :CUSTOM_ID: h:13752581-4378-478c-af17-165b6e76bc1b | 2789 | :custom_id: h:13752581-4378-478c-af17-165b6e76bc1b |
| 1919 | :END: | 2790 | :end: |
| 2791 | #+cindex: Development notes | ||
| 1920 | 2792 | ||
| 1921 | If you are curious about the principles that govern the development of | 2793 | If you are curious about the principles that govern the development of |
| 1922 | this project read the essay [[https://protesilaos.com/codelog/2020-03-17-design-modus-themes-emacs/][On the design of the Modus themes]] | 2794 | this project read the essay [[https://protesilaos.com/codelog/2020-03-17-design-modus-themes-emacs/][On the design of the Modus themes]] |
| @@ -1931,32 +2803,501 @@ of this sort): | |||
| 1931 | + [[https://protesilaos.com/codelog/2020-07-04-modus-themes-faint-colours/][Modus themes: new "faint syntax" option]] (2020-07-04) | 2803 | + [[https://protesilaos.com/codelog/2020-07-04-modus-themes-faint-colours/][Modus themes: new "faint syntax" option]] (2020-07-04) |
| 1932 | + [[https://protesilaos.com/codelog/2020-07-08-modus-themes-nuanced-colours/][Modus themes: major review of "nuanced" colours]] (2020-07-08) | 2804 | + [[https://protesilaos.com/codelog/2020-07-08-modus-themes-nuanced-colours/][Modus themes: major review of "nuanced" colours]] (2020-07-08) |
| 1933 | + [[https://protesilaos.com/codelog/2020-09-14-modus-themes-review-blues/][Modus themes: review of blue colours]] (2020-09-14) | 2805 | + [[https://protesilaos.com/codelog/2020-09-14-modus-themes-review-blues/][Modus themes: review of blue colours]] (2020-09-14) |
| 2806 | + [[https://protesilaos.com/codelog/2020-12-27-modus-themes-review-rainbow-delimiters/][Modus themes: review rainbow-delimiters faces]] (2020-12-27) | ||
| 2807 | + [[https://protesilaos.com/codelog/2021-01-11-modus-themes-review-select-faint-colours/][Modus themes: review of select "faint" colours]] (2021-01-11) | ||
| 2808 | + [[https://protesilaos.com/codelog/2021-02-25-modus-themes-diffs-deuteranopia/][The Modus themes now cover deuteranopia in diffs]] (2021-02-25) | ||
| 1934 | 2809 | ||
| 1935 | And here are the canonical sources for this project's documentation: | 2810 | And here are the canonical sources of this project's documentation: |
| 1936 | 2811 | ||
| 1937 | + Manual :: <https://protesilaos.com/modus-themes> | 2812 | + Manual :: <https://protesilaos.com/modus-themes> |
| 1938 | + Change Log :: <https://protesilaos.com/modus-themes-changelog> | 2813 | + Change Log :: <https://protesilaos.com/modus-themes-changelog> |
| 1939 | + Screenshots :: <https://protesilaos.com/modus-themes-pictures> | 2814 | + Screenshots :: <https://protesilaos.com/modus-themes-pictures> |
| 1940 | 2815 | ||
| 1941 | * External projects (ports) | ||
| 1942 | :PROPERTIES: | ||
| 1943 | :CUSTOM_ID: h:21adb7c8-2208-41e8-803c-052e42e2c05d | ||
| 1944 | :END: | ||
| 1945 | |||
| 1946 | The present section documents projects that extend the scope of the | ||
| 1947 | Modus themes. The following list will be updated whenever relevant | ||
| 1948 | information is brought to my attention. If you already have or intend | ||
| 1949 | to produce such a port, feel welcome [[https://protesilaos.com/contact][to contact me]]. | ||
| 1950 | |||
| 1951 | + Modus exporter :: This is [[https://github.com/polaris64/modus-exporter][an Elisp library written by Simon Pugnet]]. | ||
| 1952 | Licensed under the terms of the GNU General Public License. It is | ||
| 1953 | meant to capture the color values of the active Modus theme (Operandi | ||
| 1954 | or Vivendi) and output it as a valid theme for some other application. | ||
| 1955 | |||
| 1956 | * GNU Free Documentation License | 2816 | * GNU Free Documentation License |
| 1957 | :PROPERTIES: | 2817 | :properties: |
| 1958 | :APPENDIX: t | 2818 | :appendix: t |
| 1959 | :CUSTOM_ID: h:3077c3d2-7f90-4228-8f0a-73124f4026f6 | 2819 | :custom_id: h:3077c3d2-7f90-4228-8f0a-73124f4026f6 |
| 1960 | :END: | 2820 | :end: |
| 1961 | 2821 | ||
| 1962 | #+texinfo: @include doclicense.texi | 2822 | #+texinfo: @include doclicense.texi |
| 2823 | |||
| 2824 | #+begin_export html | ||
| 2825 | |||
| 2826 | GNU Free Documentation License | ||
| 2827 | Version 1.3, 3 November 2008 | ||
| 2828 | |||
| 2829 | |||
| 2830 | Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. | ||
| 2831 | <https://fsf.org/> | ||
| 2832 | Everyone is permitted to copy and distribute verbatim copies | ||
| 2833 | of this license document, but changing it is not allowed. | ||
| 2834 | |||
| 2835 | 0. PREAMBLE | ||
| 2836 | |||
| 2837 | The purpose of this License is to make a manual, textbook, or other | ||
| 2838 | functional and useful document "free" in the sense of freedom: to | ||
| 2839 | assure everyone the effective freedom to copy and redistribute it, | ||
| 2840 | with or without modifying it, either commercially or noncommercially. | ||
| 2841 | Secondarily, this License preserves for the author and publisher a way | ||
| 2842 | to get credit for their work, while not being considered responsible | ||
| 2843 | for modifications made by others. | ||
| 2844 | |||
| 2845 | This License is a kind of "copyleft", which means that derivative | ||
| 2846 | works of the document must themselves be free in the same sense. It | ||
| 2847 | complements the GNU General Public License, which is a copyleft | ||
| 2848 | license designed for free software. | ||
| 2849 | |||
| 2850 | We have designed this License in order to use it for manuals for free | ||
| 2851 | software, because free software needs free documentation: a free | ||
| 2852 | program should come with manuals providing the same freedoms that the | ||
| 2853 | software does. But this License is not limited to software manuals; | ||
| 2854 | it can be used for any textual work, regardless of subject matter or | ||
| 2855 | whether it is published as a printed book. We recommend this License | ||
| 2856 | principally for works whose purpose is instruction or reference. | ||
| 2857 | |||
| 2858 | |||
| 2859 | 1. APPLICABILITY AND DEFINITIONS | ||
| 2860 | |||
| 2861 | This License applies to any manual or other work, in any medium, that | ||
| 2862 | contains a notice placed by the copyright holder saying it can be | ||
| 2863 | distributed under the terms of this License. Such a notice grants a | ||
| 2864 | world-wide, royalty-free license, unlimited in duration, to use that | ||
| 2865 | work under the conditions stated herein. The "Document", below, | ||
| 2866 | refers to any such manual or work. Any member of the public is a | ||
| 2867 | licensee, and is addressed as "you". You accept the license if you | ||
| 2868 | copy, modify or distribute the work in a way requiring permission | ||
| 2869 | under copyright law. | ||
| 2870 | |||
| 2871 | A "Modified Version" of the Document means any work containing the | ||
| 2872 | Document or a portion of it, either copied verbatim, or with | ||
| 2873 | modifications and/or translated into another language. | ||
| 2874 | |||
| 2875 | A "Secondary Section" is a named appendix or a front-matter section of | ||
| 2876 | the Document that deals exclusively with the relationship of the | ||
| 2877 | publishers or authors of the Document to the Document's overall | ||
| 2878 | subject (or to related matters) and contains nothing that could fall | ||
| 2879 | directly within that overall subject. (Thus, if the Document is in | ||
| 2880 | part a textbook of mathematics, a Secondary Section may not explain | ||
| 2881 | any mathematics.) The relationship could be a matter of historical | ||
| 2882 | connection with the subject or with related matters, or of legal, | ||
| 2883 | commercial, philosophical, ethical or political position regarding | ||
| 2884 | them. | ||
| 2885 | |||
| 2886 | The "Invariant Sections" are certain Secondary Sections whose titles | ||
| 2887 | are designated, as being those of Invariant Sections, in the notice | ||
| 2888 | that says that the Document is released under this License. If a | ||
| 2889 | section does not fit the above definition of Secondary then it is not | ||
| 2890 | allowed to be designated as Invariant. The Document may contain zero | ||
| 2891 | Invariant Sections. If the Document does not identify any Invariant | ||
| 2892 | Sections then there are none. | ||
| 2893 | |||
| 2894 | The "Cover Texts" are certain short passages of text that are listed, | ||
| 2895 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that | ||
| 2896 | the Document is released under this License. A Front-Cover Text may | ||
| 2897 | be at most 5 words, and a Back-Cover Text may be at most 25 words. | ||
| 2898 | |||
| 2899 | A "Transparent" copy of the Document means a machine-readable copy, | ||
| 2900 | represented in a format whose specification is available to the | ||
| 2901 | general public, that is suitable for revising the document | ||
| 2902 | straightforwardly with generic text editors or (for images composed of | ||
| 2903 | pixels) generic paint programs or (for drawings) some widely available | ||
| 2904 | drawing editor, and that is suitable for input to text formatters or | ||
| 2905 | for automatic translation to a variety of formats suitable for input | ||
| 2906 | to text formatters. A copy made in an otherwise Transparent file | ||
| 2907 | format whose markup, or absence of markup, has been arranged to thwart | ||
| 2908 | or discourage subsequent modification by readers is not Transparent. | ||
| 2909 | An image format is not Transparent if used for any substantial amount | ||
| 2910 | of text. A copy that is not "Transparent" is called "Opaque". | ||
| 2911 | |||
| 2912 | Examples of suitable formats for Transparent copies include plain | ||
| 2913 | ASCII without markup, Texinfo input format, LaTeX input format, SGML | ||
| 2914 | or XML using a publicly available DTD, and standard-conforming simple | ||
| 2915 | HTML, PostScript or PDF designed for human modification. Examples of | ||
| 2916 | transparent image formats include PNG, XCF and JPG. Opaque formats | ||
| 2917 | include proprietary formats that can be read and edited only by | ||
| 2918 | proprietary word processors, SGML or XML for which the DTD and/or | ||
| 2919 | processing tools are not generally available, and the | ||
| 2920 | machine-generated HTML, PostScript or PDF produced by some word | ||
| 2921 | processors for output purposes only. | ||
| 2922 | |||
| 2923 | The "Title Page" means, for a printed book, the title page itself, | ||
| 2924 | plus such following pages as are needed to hold, legibly, the material | ||
| 2925 | this License requires to appear in the title page. For works in | ||
| 2926 | formats which do not have any title page as such, "Title Page" means | ||
| 2927 | the text near the most prominent appearance of the work's title, | ||
| 2928 | preceding the beginning of the body of the text. | ||
| 2929 | |||
| 2930 | The "publisher" means any person or entity that distributes copies of | ||
| 2931 | the Document to the public. | ||
| 2932 | |||
| 2933 | A section "Entitled XYZ" means a named subunit of the Document whose | ||
| 2934 | title either is precisely XYZ or contains XYZ in parentheses following | ||
| 2935 | text that translates XYZ in another language. (Here XYZ stands for a | ||
| 2936 | specific section name mentioned below, such as "Acknowledgements", | ||
| 2937 | "Dedications", "Endorsements", or "History".) To "Preserve the Title" | ||
| 2938 | of such a section when you modify the Document means that it remains a | ||
| 2939 | section "Entitled XYZ" according to this definition. | ||
| 2940 | |||
| 2941 | The Document may include Warranty Disclaimers next to the notice which | ||
| 2942 | states that this License applies to the Document. These Warranty | ||
| 2943 | Disclaimers are considered to be included by reference in this | ||
| 2944 | License, but only as regards disclaiming warranties: any other | ||
| 2945 | implication that these Warranty Disclaimers may have is void and has | ||
| 2946 | no effect on the meaning of this License. | ||
| 2947 | |||
| 2948 | 2. VERBATIM COPYING | ||
| 2949 | |||
| 2950 | You may copy and distribute the Document in any medium, either | ||
| 2951 | commercially or noncommercially, provided that this License, the | ||
| 2952 | copyright notices, and the license notice saying this License applies | ||
| 2953 | to the Document are reproduced in all copies, and that you add no | ||
| 2954 | other conditions whatsoever to those of this License. You may not use | ||
| 2955 | technical measures to obstruct or control the reading or further | ||
| 2956 | copying of the copies you make or distribute. However, you may accept | ||
| 2957 | compensation in exchange for copies. If you distribute a large enough | ||
| 2958 | number of copies you must also follow the conditions in section 3. | ||
| 2959 | |||
| 2960 | You may also lend copies, under the same conditions stated above, and | ||
| 2961 | you may publicly display copies. | ||
| 2962 | |||
| 2963 | |||
| 2964 | 3. COPYING IN QUANTITY | ||
| 2965 | |||
| 2966 | If you publish printed copies (or copies in media that commonly have | ||
| 2967 | printed covers) of the Document, numbering more than 100, and the | ||
| 2968 | Document's license notice requires Cover Texts, you must enclose the | ||
| 2969 | copies in covers that carry, clearly and legibly, all these Cover | ||
| 2970 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on | ||
| 2971 | the back cover. Both covers must also clearly and legibly identify | ||
| 2972 | you as the publisher of these copies. The front cover must present | ||
| 2973 | the full title with all words of the title equally prominent and | ||
| 2974 | visible. You may add other material on the covers in addition. | ||
| 2975 | Copying with changes limited to the covers, as long as they preserve | ||
| 2976 | the title of the Document and satisfy these conditions, can be treated | ||
| 2977 | as verbatim copying in other respects. | ||
| 2978 | |||
| 2979 | If the required texts for either cover are too voluminous to fit | ||
| 2980 | legibly, you should put the first ones listed (as many as fit | ||
| 2981 | reasonably) on the actual cover, and continue the rest onto adjacent | ||
| 2982 | pages. | ||
| 2983 | |||
| 2984 | If you publish or distribute Opaque copies of the Document numbering | ||
| 2985 | more than 100, you must either include a machine-readable Transparent | ||
| 2986 | copy along with each Opaque copy, or state in or with each Opaque copy | ||
| 2987 | a computer-network location from which the general network-using | ||
| 2988 | public has access to download using public-standard network protocols | ||
| 2989 | a complete Transparent copy of the Document, free of added material. | ||
| 2990 | If you use the latter option, you must take reasonably prudent steps, | ||
| 2991 | when you begin distribution of Opaque copies in quantity, to ensure | ||
| 2992 | that this Transparent copy will remain thus accessible at the stated | ||
| 2993 | location until at least one year after the last time you distribute an | ||
| 2994 | Opaque copy (directly or through your agents or retailers) of that | ||
| 2995 | edition to the public. | ||
| 2996 | |||
| 2997 | It is requested, but not required, that you contact the authors of the | ||
| 2998 | Document well before redistributing any large number of copies, to | ||
| 2999 | give them a chance to provide you with an updated version of the | ||
| 3000 | Document. | ||
| 3001 | |||
| 3002 | |||
| 3003 | 4. MODIFICATIONS | ||
| 3004 | |||
| 3005 | You may copy and distribute a Modified Version of the Document under | ||
| 3006 | the conditions of sections 2 and 3 above, provided that you release | ||
| 3007 | the Modified Version under precisely this License, with the Modified | ||
| 3008 | Version filling the role of the Document, thus licensing distribution | ||
| 3009 | and modification of the Modified Version to whoever possesses a copy | ||
| 3010 | of it. In addition, you must do these things in the Modified Version: | ||
| 3011 | |||
| 3012 | A. Use in the Title Page (and on the covers, if any) a title distinct | ||
| 3013 | from that of the Document, and from those of previous versions | ||
| 3014 | (which should, if there were any, be listed in the History section | ||
| 3015 | of the Document). You may use the same title as a previous version | ||
| 3016 | if the original publisher of that version gives permission. | ||
| 3017 | B. List on the Title Page, as authors, one or more persons or entities | ||
| 3018 | responsible for authorship of the modifications in the Modified | ||
| 3019 | Version, together with at least five of the principal authors of the | ||
| 3020 | Document (all of its principal authors, if it has fewer than five), | ||
| 3021 | unless they release you from this requirement. | ||
| 3022 | C. State on the Title page the name of the publisher of the | ||
| 3023 | Modified Version, as the publisher. | ||
| 3024 | D. Preserve all the copyright notices of the Document. | ||
| 3025 | E. Add an appropriate copyright notice for your modifications | ||
| 3026 | adjacent to the other copyright notices. | ||
| 3027 | F. Include, immediately after the copyright notices, a license notice | ||
| 3028 | giving the public permission to use the Modified Version under the | ||
| 3029 | terms of this License, in the form shown in the Addendum below. | ||
| 3030 | G. Preserve in that license notice the full lists of Invariant Sections | ||
| 3031 | and required Cover Texts given in the Document's license notice. | ||
| 3032 | H. Include an unaltered copy of this License. | ||
| 3033 | I. Preserve the section Entitled "History", Preserve its Title, and add | ||
| 3034 | to it an item stating at least the title, year, new authors, and | ||
| 3035 | publisher of the Modified Version as given on the Title Page. If | ||
| 3036 | there is no section Entitled "History" in the Document, create one | ||
| 3037 | stating the title, year, authors, and publisher of the Document as | ||
| 3038 | given on its Title Page, then add an item describing the Modified | ||
| 3039 | Version as stated in the previous sentence. | ||
| 3040 | J. Preserve the network location, if any, given in the Document for | ||
| 3041 | public access to a Transparent copy of the Document, and likewise | ||
| 3042 | the network locations given in the Document for previous versions | ||
| 3043 | it was based on. These may be placed in the "History" section. | ||
| 3044 | You may omit a network location for a work that was published at | ||
| 3045 | least four years before the Document itself, or if the original | ||
| 3046 | publisher of the version it refers to gives permission. | ||
| 3047 | K. For any section Entitled "Acknowledgements" or "Dedications", | ||
| 3048 | Preserve the Title of the section, and preserve in the section all | ||
| 3049 | the substance and tone of each of the contributor acknowledgements | ||
| 3050 | and/or dedications given therein. | ||
| 3051 | L. Preserve all the Invariant Sections of the Document, | ||
| 3052 | unaltered in their text and in their titles. Section numbers | ||
| 3053 | or the equivalent are not considered part of the section titles. | ||
| 3054 | M. Delete any section Entitled "Endorsements". Such a section | ||
| 3055 | may not be included in the Modified Version. | ||
| 3056 | N. Do not retitle any existing section to be Entitled "Endorsements" | ||
| 3057 | or to conflict in title with any Invariant Section. | ||
| 3058 | O. Preserve any Warranty Disclaimers. | ||
| 3059 | |||
| 3060 | If the Modified Version includes new front-matter sections or | ||
| 3061 | appendices that qualify as Secondary Sections and contain no material | ||
| 3062 | copied from the Document, you may at your option designate some or all | ||
| 3063 | of these sections as invariant. To do this, add their titles to the | ||
| 3064 | list of Invariant Sections in the Modified Version's license notice. | ||
| 3065 | These titles must be distinct from any other section titles. | ||
| 3066 | |||
| 3067 | You may add a section Entitled "Endorsements", provided it contains | ||
| 3068 | nothing but endorsements of your Modified Version by various | ||
| 3069 | parties--for example, statements of peer review or that the text has | ||
| 3070 | been approved by an organization as the authoritative definition of a | ||
| 3071 | standard. | ||
| 3072 | |||
| 3073 | You may add a passage of up to five words as a Front-Cover Text, and a | ||
| 3074 | passage of up to 25 words as a Back-Cover Text, to the end of the list | ||
| 3075 | of Cover Texts in the Modified Version. Only one passage of | ||
| 3076 | Front-Cover Text and one of Back-Cover Text may be added by (or | ||
| 3077 | through arrangements made by) any one entity. If the Document already | ||
| 3078 | includes a cover text for the same cover, previously added by you or | ||
| 3079 | by arrangement made by the same entity you are acting on behalf of, | ||
| 3080 | you may not add another; but you may replace the old one, on explicit | ||
| 3081 | permission from the previous publisher that added the old one. | ||
| 3082 | |||
| 3083 | The author(s) and publisher(s) of the Document do not by this License | ||
| 3084 | give permission to use their names for publicity for or to assert or | ||
| 3085 | imply endorsement of any Modified Version. | ||
| 3086 | |||
| 3087 | |||
| 3088 | 5. COMBINING DOCUMENTS | ||
| 3089 | |||
| 3090 | You may combine the Document with other documents released under this | ||
| 3091 | License, under the terms defined in section 4 above for modified | ||
| 3092 | versions, provided that you include in the combination all of the | ||
| 3093 | Invariant Sections of all of the original documents, unmodified, and | ||
| 3094 | list them all as Invariant Sections of your combined work in its | ||
| 3095 | license notice, and that you preserve all their Warranty Disclaimers. | ||
| 3096 | |||
| 3097 | The combined work need only contain one copy of this License, and | ||
| 3098 | multiple identical Invariant Sections may be replaced with a single | ||
| 3099 | copy. If there are multiple Invariant Sections with the same name but | ||
| 3100 | different contents, make the title of each such section unique by | ||
| 3101 | adding at the end of it, in parentheses, the name of the original | ||
| 3102 | author or publisher of that section if known, or else a unique number. | ||
| 3103 | Make the same adjustment to the section titles in the list of | ||
| 3104 | Invariant Sections in the license notice of the combined work. | ||
| 3105 | |||
| 3106 | In the combination, you must combine any sections Entitled "History" | ||
| 3107 | in the various original documents, forming one section Entitled | ||
| 3108 | "History"; likewise combine any sections Entitled "Acknowledgements", | ||
| 3109 | and any sections Entitled "Dedications". You must delete all sections | ||
| 3110 | Entitled "Endorsements". | ||
| 3111 | |||
| 3112 | |||
| 3113 | 6. COLLECTIONS OF DOCUMENTS | ||
| 3114 | |||
| 3115 | You may make a collection consisting of the Document and other | ||
| 3116 | documents released under this License, and replace the individual | ||
| 3117 | copies of this License in the various documents with a single copy | ||
| 3118 | that is included in the collection, provided that you follow the rules | ||
| 3119 | of this License for verbatim copying of each of the documents in all | ||
| 3120 | other respects. | ||
| 3121 | |||
| 3122 | You may extract a single document from such a collection, and | ||
| 3123 | distribute it individually under this License, provided you insert a | ||
| 3124 | copy of this License into the extracted document, and follow this | ||
| 3125 | License in all other respects regarding verbatim copying of that | ||
| 3126 | document. | ||
| 3127 | |||
| 3128 | |||
| 3129 | 7. AGGREGATION WITH INDEPENDENT WORKS | ||
| 3130 | |||
| 3131 | A compilation of the Document or its derivatives with other separate | ||
| 3132 | and independent documents or works, in or on a volume of a storage or | ||
| 3133 | distribution medium, is called an "aggregate" if the copyright | ||
| 3134 | resulting from the compilation is not used to limit the legal rights | ||
| 3135 | of the compilation's users beyond what the individual works permit. | ||
| 3136 | When the Document is included in an aggregate, this License does not | ||
| 3137 | apply to the other works in the aggregate which are not themselves | ||
| 3138 | derivative works of the Document. | ||
| 3139 | |||
| 3140 | If the Cover Text requirement of section 3 is applicable to these | ||
| 3141 | copies of the Document, then if the Document is less than one half of | ||
| 3142 | the entire aggregate, the Document's Cover Texts may be placed on | ||
| 3143 | covers that bracket the Document within the aggregate, or the | ||
| 3144 | electronic equivalent of covers if the Document is in electronic form. | ||
| 3145 | Otherwise they must appear on printed covers that bracket the whole | ||
| 3146 | aggregate. | ||
| 3147 | |||
| 3148 | |||
| 3149 | 8. TRANSLATION | ||
| 3150 | |||
| 3151 | Translation is considered a kind of modification, so you may | ||
| 3152 | distribute translations of the Document under the terms of section 4. | ||
| 3153 | Replacing Invariant Sections with translations requires special | ||
| 3154 | permission from their copyright holders, but you may include | ||
| 3155 | translations of some or all Invariant Sections in addition to the | ||
| 3156 | original versions of these Invariant Sections. You may include a | ||
| 3157 | translation of this License, and all the license notices in the | ||
| 3158 | Document, and any Warranty Disclaimers, provided that you also include | ||
| 3159 | the original English version of this License and the original versions | ||
| 3160 | of those notices and disclaimers. In case of a disagreement between | ||
| 3161 | the translation and the original version of this License or a notice | ||
| 3162 | or disclaimer, the original version will prevail. | ||
| 3163 | |||
| 3164 | If a section in the Document is Entitled "Acknowledgements", | ||
| 3165 | "Dedications", or "History", the requirement (section 4) to Preserve | ||
| 3166 | its Title (section 1) will typically require changing the actual | ||
| 3167 | title. | ||
| 3168 | |||
| 3169 | |||
| 3170 | 9. TERMINATION | ||
| 3171 | |||
| 3172 | You may not copy, modify, sublicense, or distribute the Document | ||
| 3173 | except as expressly provided under this License. Any attempt | ||
| 3174 | otherwise to copy, modify, sublicense, or distribute it is void, and | ||
| 3175 | will automatically terminate your rights under this License. | ||
| 3176 | |||
| 3177 | However, if you cease all violation of this License, then your license | ||
| 3178 | from a particular copyright holder is reinstated (a) provisionally, | ||
| 3179 | unless and until the copyright holder explicitly and finally | ||
| 3180 | terminates your license, and (b) permanently, if the copyright holder | ||
| 3181 | fails to notify you of the violation by some reasonable means prior to | ||
| 3182 | 60 days after the cessation. | ||
| 3183 | |||
| 3184 | Moreover, your license from a particular copyright holder is | ||
| 3185 | reinstated permanently if the copyright holder notifies you of the | ||
| 3186 | violation by some reasonable means, this is the first time you have | ||
| 3187 | received notice of violation of this License (for any work) from that | ||
| 3188 | copyright holder, and you cure the violation prior to 30 days after | ||
| 3189 | your receipt of the notice. | ||
| 3190 | |||
| 3191 | Termination of your rights under this section does not terminate the | ||
| 3192 | licenses of parties who have received copies or rights from you under | ||
| 3193 | this License. If your rights have been terminated and not permanently | ||
| 3194 | reinstated, receipt of a copy of some or all of the same material does | ||
| 3195 | not give you any rights to use it. | ||
| 3196 | |||
| 3197 | |||
| 3198 | 10. FUTURE REVISIONS OF THIS LICENSE | ||
| 3199 | |||
| 3200 | The Free Software Foundation may publish new, revised versions of the | ||
| 3201 | GNU Free Documentation License from time to time. Such new versions | ||
| 3202 | will be similar in spirit to the present version, but may differ in | ||
| 3203 | detail to address new problems or concerns. See | ||
| 3204 | https://www.gnu.org/licenses/. | ||
| 3205 | |||
| 3206 | Each version of the License is given a distinguishing version number. | ||
| 3207 | If the Document specifies that a particular numbered version of this | ||
| 3208 | License "or any later version" applies to it, you have the option of | ||
| 3209 | following the terms and conditions either of that specified version or | ||
| 3210 | of any later version that has been published (not as a draft) by the | ||
| 3211 | Free Software Foundation. If the Document does not specify a version | ||
| 3212 | number of this License, you may choose any version ever published (not | ||
| 3213 | as a draft) by the Free Software Foundation. If the Document | ||
| 3214 | specifies that a proxy can decide which future versions of this | ||
| 3215 | License can be used, that proxy's public statement of acceptance of a | ||
| 3216 | version permanently authorizes you to choose that version for the | ||
| 3217 | Document. | ||
| 3218 | |||
| 3219 | 11. RELICENSING | ||
| 3220 | |||
| 3221 | "Massive Multiauthor Collaboration Site" (or "MMC Site") means any | ||
| 3222 | World Wide Web server that publishes copyrightable works and also | ||
| 3223 | provides prominent facilities for anybody to edit those works. A | ||
| 3224 | public wiki that anybody can edit is an example of such a server. A | ||
| 3225 | "Massive Multiauthor Collaboration" (or "MMC") contained in the site | ||
| 3226 | means any set of copyrightable works thus published on the MMC site. | ||
| 3227 | |||
| 3228 | "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 | ||
| 3229 | license published by Creative Commons Corporation, a not-for-profit | ||
| 3230 | corporation with a principal place of business in San Francisco, | ||
| 3231 | California, as well as future copyleft versions of that license | ||
| 3232 | published by that same organization. | ||
| 3233 | |||
| 3234 | "Incorporate" means to publish or republish a Document, in whole or in | ||
| 3235 | part, as part of another Document. | ||
| 3236 | |||
| 3237 | An MMC is "eligible for relicensing" if it is licensed under this | ||
| 3238 | License, and if all works that were first published under this License | ||
| 3239 | somewhere other than this MMC, and subsequently incorporated in whole or | ||
| 3240 | in part into the MMC, (1) had no cover texts or invariant sections, and | ||
| 3241 | (2) were thus incorporated prior to November 1, 2008. | ||
| 3242 | |||
| 3243 | The operator of an MMC Site may republish an MMC contained in the site | ||
| 3244 | under CC-BY-SA on the same site at any time before August 1, 2009, | ||
| 3245 | provided the MMC is eligible for relicensing. | ||
| 3246 | |||
| 3247 | |||
| 3248 | ADDENDUM: How to use this License for your documents | ||
| 3249 | |||
| 3250 | To use this License in a document you have written, include a copy of | ||
| 3251 | the License in the document and put the following copyright and | ||
| 3252 | license notices just after the title page: | ||
| 3253 | |||
| 3254 | Copyright (c) YEAR YOUR NAME. | ||
| 3255 | Permission is granted to copy, distribute and/or modify this document | ||
| 3256 | under the terms of the GNU Free Documentation License, Version 1.3 | ||
| 3257 | or any later version published by the Free Software Foundation; | ||
| 3258 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. | ||
| 3259 | A copy of the license is included in the section entitled "GNU | ||
| 3260 | Free Documentation License". | ||
| 3261 | |||
| 3262 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, | ||
| 3263 | replace the "with...Texts." line with this: | ||
| 3264 | |||
| 3265 | with the Invariant Sections being LIST THEIR TITLES, with the | ||
| 3266 | Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. | ||
| 3267 | |||
| 3268 | If you have Invariant Sections without Cover Texts, or some other | ||
| 3269 | combination of the three, merge those two alternatives to suit the | ||
| 3270 | situation. | ||
| 3271 | |||
| 3272 | If your document contains nontrivial examples of program code, we | ||
| 3273 | recommend releasing these examples in parallel under your choice of | ||
| 3274 | free software license, such as the GNU General Public License, | ||
| 3275 | to permit their use in free software. | ||
| 3276 | #+end_export | ||
| 3277 | |||
| 3278 | #+html: <!-- | ||
| 3279 | |||
| 3280 | * Indices | ||
| 3281 | :properties: | ||
| 3282 | :custom_id: h:55104b26-8e94-46cf-9975-43ea00316489 | ||
| 3283 | :end: | ||
| 3284 | |||
| 3285 | ** Function index | ||
| 3286 | :properties: | ||
| 3287 | :index: fn | ||
| 3288 | :custom_id: h:6bec5005-529c-4521-ae05-3d990baffb5b | ||
| 3289 | :end: | ||
| 3290 | |||
| 3291 | ** Variable index | ||
| 3292 | :properties: | ||
| 3293 | :index: vr | ||
| 3294 | :custom_id: h:16ad8df6-b015-40a9-9259-03d4f7a23ee4 | ||
| 3295 | :end: | ||
| 3296 | |||
| 3297 | ** Concept index | ||
| 3298 | :properties: | ||
| 3299 | :index: cp | ||
| 3300 | :custom_id: h:6aa7a656-884b-4c39-b759-087e412eec13 | ||
| 3301 | :end: | ||
| 3302 | |||
| 3303 | #+html: --> | ||