emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/modus-operandi-theme c01f05e 095/153: New customisation


From: Stefan Monnier
Subject: [elpa] externals/modus-operandi-theme c01f05e 095/153: New customisation option to disable font mixing
Date: Thu, 18 Mar 2021 13:47:47 -0400 (EDT)

branch: externals/modus-operandi-theme
commit c01f05edb8eba53f61894ae354e52966ea518a43
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    New customisation option to disable font mixing
    
    * modus-operandi-theme.el (modus-operandi-theme-no-mixed-fonts)
    (modus-operandi-theme-mixed-fonts): Add new defcustom and accompanying
    helper function for disabling mixed fonts.
    
    * modus-operandi-theme.el (custom-theme-set-faces): Implement
    conditional inheritance of the fixed-pitch face.
    
    * modus-vivendi-theme.el (modus-vivendi-theme-no-mixed-fonts)
    (modus-vivendi-theme-mixed-fonts): Add new defcustom and accompanying
    helper function for disabling mixed fonts.
    
    * modus-vivendi-theme.el (custom-theme-set-faces): Implement conditional
    inheritance of the fixed-pitch face.
    
    * doc/modus-themes.org (Option for no font mixing): Document new boolean
    type customisation option.
---
 doc/modus-themes.info   | 178 ++++++++++++++++++++++++++++--------------------
 doc/modus-themes.org    |  29 ++++++++
 modus-operandi-theme.el |  91 ++++++++++++++++++-------
 modus-vivendi-theme.el  |  91 ++++++++++++++++++-------
 4 files changed, 264 insertions(+), 125 deletions(-)

diff --git a/doc/modus-themes.info b/doc/modus-themes.info
index c26d109..89f0211 100644
--- a/doc/modus-themes.info
+++ b/doc/modus-themes.info
@@ -72,6 +72,7 @@ Customisation Options
 * Bold constructs::              Toggle bold constructs in code
 * Slanted constructs::           Toggle slanted constructs (italics) in code
 * Syntax highlighting::          Toggle subtle colouration in programming modes
+* No mixed fonts::               Toggle mixing of font families
 * Link underline::               Toggle underlined text in links
 * Command prompts::              Choose among plain, subtle, or intense prompts
 * Mode line::                    Choose among plain, three-dimension, or 
moody-compliant styles
@@ -453,6 +454,7 @@ theme (see *note Enable and load::).
 * Bold constructs::              Toggle bold constructs in code
 * Slanted constructs::           Toggle slanted constructs (italics) in code
 * Syntax highlighting::          Toggle subtle colouration in programming modes
+* No mixed fonts::               Toggle mixing of font families
 * Link underline::               Toggle underlined text in links
 * Command prompts::              Choose among plain, subtle, or intense prompts
 * Mode line::                    Choose among plain, three-dimension, or 
moody-compliant styles
@@ -519,7 +521,7 @@ typically affects documentation strings and code comments.
    The default is to not use italics unless it is absolutely necessary.
 
 
-File: modus-themes.info,  Node: Syntax highlighting,  Next: Link underline,  
Prev: Slanted constructs,  Up: Customisation Options
+File: modus-themes.info,  Node: Syntax highlighting,  Next: No mixed fonts,  
Prev: Slanted constructs,  Up: Customisation Options
 
 4.3 Option for faint code syntax highlighting
 =============================================
@@ -542,9 +544,38 @@ have effects in other places that are hard-wired to rely 
directly on
 font-lock.  The author is aware of ‘vc-dir’ as a case in point.
 
 
-File: modus-themes.info,  Node: Link underline,  Next: Command prompts,  Prev: 
Syntax highlighting,  Up: Customisation Options
+File: modus-themes.info,  Node: No mixed fonts,  Next: Link underline,  Prev: 
Syntax highlighting,  Up: Customisation Options
 
-4.4 Option for no link underline
+4.4 Option for no font mixing
+=============================
+
+Symbol names:
+
+   • ‘modus-operandi-theme-no-mixed-fonts’
+   • ‘modus-vivendi-theme-no-mixed-fonts’
+
+   Possible values:
+
+  1. ‘nil’ (default)
+  2. ‘t’
+
+   By default, the themes configure some spacing-sensitive faces, such
+as Org tables and code blocks, to always inherit from the ‘fixed-pitch’
+face.  This is to ensure that those constructs remain monospaced when
+users opt for something like the built-in ‘M-x variable-pitch-mode’.
+Otherwise the layout would break.
+
+   The obvious downside with this theme design is that users need to
+explicitly configure the font family of ‘fixed-pitch’ in order to apply
+their desired typeface (see *note Font configurations for Org (and
+others): Font configs (DIY).). That may be something they do not want to
+do.  Hence this option to disable any kind of technique for mixing
+fonts.
+
+
+File: modus-themes.info,  Node: Link underline,  Next: Command prompts,  Prev: 
No mixed fonts,  Up: Customisation Options
+
+4.5 Option for no link underline
 ================================
 
 Symbol names:
@@ -563,7 +594,7 @@ The default is to apply an underline.
 
 File: modus-themes.info,  Node: Command prompts,  Next: Mode line,  Prev: Link 
underline,  Up: Customisation Options
 
-4.5 Option for command prompt styles
+4.6 Option for command prompt styles
 ====================================
 
 Symbol names:
@@ -589,7 +620,7 @@ relying on an accented foreground colour.
 
 File: modus-themes.info,  Node: Mode line,  Next: Completion UIs,  Prev: 
Command prompts,  Up: Customisation Options
 
-4.6 Option for mode line presentation
+4.7 Option for mode line presentation
 =====================================
 
 Symbol names:
@@ -640,7 +671,7 @@ been carefully designed to be highly accessible).
 
 File: modus-themes.info,  Node: Completion UIs,  Next: Fringes,  Prev: Mode 
line,  Up: Customisation Options
 
-4.7 Option for completion framework aesthetics
+4.8 Option for completion framework aesthetics
 ==============================================
 
 Symbol names:
@@ -686,7 +717,7 @@ spend some time with every one of the ‘nil’ (default), 
‘moderate’, and
 
 File: modus-themes.info,  Node: Fringes,  Next: Line highlighting,  Prev: 
Completion UIs,  Up: Customisation Options
 
-4.8 Option for fringe visibility
+4.9 Option for fringe visibility
 ================================
 
 Symbol names:
@@ -711,8 +742,8 @@ space given to them by ‘fringe-mode’.
 
 File: modus-themes.info,  Node: Line highlighting,  Next: Matching 
parentheses,  Prev: Fringes,  Up: Customisation Options
 
-4.9 Option for line highlighting (hl-line-mode)
-===============================================
+4.10 Option for line highlighting (hl-line-mode)
+================================================
 
 Symbol names:
 
@@ -733,7 +764,7 @@ packages that enable ‘hl-line-mode’, such as ‘elfeed’ and 
‘mu4e’.
 
 File: modus-themes.info,  Node: Matching parentheses,  Next: Diffs,  Prev: 
Line highlighting,  Up: Customisation Options
 
-4.10 Option for parenthesis matching (show-paren-mode)
+4.11 Option for parenthesis matching (show-paren-mode)
 ======================================================
 
 Symbol names:
@@ -754,7 +785,7 @@ overlays.
 
 File: modus-themes.info,  Node: Diffs,  Next: Org mode blocks,  Prev: Matching 
parentheses,  Up: Customisation Options
 
-4.11 Option for diff buffer looks
+4.12 Option for diff buffer looks
 =================================
 
 Symbol names:
@@ -796,7 +827,7 @@ consistent with the overall intent of the aforementioned.
 
 File: modus-themes.info,  Node: Org mode blocks,  Next: Heading styles,  Prev: 
Diffs,  Up: Customisation Options
 
-4.12 Option for org-mode block styles
+4.13 Option for org-mode block styles
 =====================================
 
 Symbol names:
@@ -834,7 +865,7 @@ each code block (inefficient at scale, but it still works).
 
 File: modus-themes.info,  Node: Heading styles,  Next: Scaled headings,  Prev: 
Org mode blocks,  Up: Customisation Options
 
-4.13 Option for headings’ overall style
+4.14 Option for headings’ overall style
 =======================================
 
 This is defined as an alist and, therefore, uses a different approach
@@ -935,7 +966,7 @@ option), just specify the value t like this:
 
 File: modus-themes.info,  Node: Scaled headings,  Next: Headings' font,  Prev: 
Heading styles,  Up: Customisation Options
 
-4.14 Option for scaled headings
+4.15 Option for scaled headings
 ===============================
 
 Symbol names:
@@ -959,7 +990,7 @@ headings and body copy.
 
 File: modus-themes.info,  Node: Scaled heading sizes,  Up: Scaled headings
 
-4.14.1 Control the scale of headings
+4.15.1 Control the scale of headings
 ------------------------------------
 
 In addition to toggles for enabling scaled headings, users can also
@@ -1003,7 +1034,7 @@ issue tracker).
 
 File: modus-themes.info,  Node: Headings' font,  Prev: Scaled headings,  Up: 
Customisation Options
 
-4.15 Option for variable-pitch font in headings
+4.16 Option for variable-pitch font in headings
 ===============================================
 
 Symbol names:
@@ -2356,63 +2387,64 @@ Appendix A GNU Free Documentation License
 
 Tag Table:
 Node: Top218
-Node: Overview3874
-Node: How do the themes look like5559
-Node: Installation6042
-Node: Install from the archives6692
-Node: Install on GNU/Linux7379
-Node: Debian 11 Bullseye7824
-Node: GNU Guix8233
-Node: Enable and load8584
-Node: Load automatically9161
-Node: Load at a given time or at sunset/sunrise9974
-Ref: Load at a given time or at sunset/sunrise-Footnote-112012
-Ref: Load at a given time or at sunset/sunrise-Footnote-212140
-Node: Toggle between the themes on demand12223
-Node: Configure options prior to loading12970
-Ref: Configure options prior to loading-Footnote-115566
-Node: Customisation Options15741
-Node: Bold constructs17421
-Node: Slanted constructs18420
-Node: Syntax highlighting19011
-Node: Link underline19739
-Node: Command prompts20226
-Node: Mode line21024
-Node: Completion UIs23461
-Node: Fringes25402
-Node: Line highlighting26166
-Node: Matching parentheses26832
-Node: Diffs27476
-Node: Org mode blocks29269
-Node: Heading styles30772
-Node: Scaled headings34161
-Node: Scaled heading sizes34778
-Node: Headings' font36737
-Node: Advanced customisation (do-it-yourself)37361
-Node: Tweak colours (DIY)38365
-Node: Font configs (DIY)41999
-Ref: Font configs (DIY)-Footnote-144579
-Ref: Font configs (DIY)-Footnote-244766
-Node: Org user faces (DIY)44988
-Node: Face coverage48209
-Node: Supported packages48711
-Node: Covered indirectly54670
-Node: Will NOT be supported55039
-Node: Notes for individual packages55757
-Node: Note for ERC escaped colour sequences56205
-Ref: Note for ERC escaped colour sequences-Footnote-157588
-Node: Note for powerline or spaceline57698
-Node: Note on shr colours58116
-Node: Note for Helm grep58529
-Node: Note on vc-annotate-background-mode59976
-Node: Contributing60830
-Node: Sources of the themes61249
-Node: Issues you can help with62011
-Node: Merge requests63198
-Node: Acknowledgements64280
-Node: Meta65544
-Node: External projects (ports)66736
-Node: GNU Free Documentation License67559
+Node: Overview3938
+Node: How do the themes look like5623
+Node: Installation6106
+Node: Install from the archives6756
+Node: Install on GNU/Linux7443
+Node: Debian 11 Bullseye7888
+Node: GNU Guix8297
+Node: Enable and load8648
+Node: Load automatically9225
+Node: Load at a given time or at sunset/sunrise10038
+Ref: Load at a given time or at sunset/sunrise-Footnote-112076
+Ref: Load at a given time or at sunset/sunrise-Footnote-212204
+Node: Toggle between the themes on demand12287
+Node: Configure options prior to loading13034
+Ref: Configure options prior to loading-Footnote-115630
+Node: Customisation Options15805
+Node: Bold constructs17549
+Node: Slanted constructs18548
+Node: Syntax highlighting19139
+Node: No mixed fonts19867
+Node: Link underline20915
+Node: Command prompts21397
+Node: Mode line22195
+Node: Completion UIs24632
+Node: Fringes26573
+Node: Line highlighting27337
+Node: Matching parentheses28005
+Node: Diffs28649
+Node: Org mode blocks30442
+Node: Heading styles31945
+Node: Scaled headings35334
+Node: Scaled heading sizes35951
+Node: Headings' font37910
+Node: Advanced customisation (do-it-yourself)38534
+Node: Tweak colours (DIY)39538
+Node: Font configs (DIY)43172
+Ref: Font configs (DIY)-Footnote-145752
+Ref: Font configs (DIY)-Footnote-245939
+Node: Org user faces (DIY)46161
+Node: Face coverage49382
+Node: Supported packages49884
+Node: Covered indirectly55843
+Node: Will NOT be supported56212
+Node: Notes for individual packages56930
+Node: Note for ERC escaped colour sequences57378
+Ref: Note for ERC escaped colour sequences-Footnote-158761
+Node: Note for powerline or spaceline58871
+Node: Note on shr colours59289
+Node: Note for Helm grep59702
+Node: Note on vc-annotate-background-mode61149
+Node: Contributing62003
+Node: Sources of the themes62422
+Node: Issues you can help with63184
+Node: Merge requests64371
+Node: Acknowledgements65453
+Node: Meta66717
+Node: External projects (ports)67909
+Node: GNU Free Documentation License68732
 
 End Tag Table
 
diff --git a/doc/modus-themes.org b/doc/modus-themes.org
index db83aa2..e3be2b9 100644
--- a/doc/modus-themes.org
+++ b/doc/modus-themes.org
@@ -411,6 +411,35 @@ This option essentially affects the font-lock faces, so it 
may also have
 effects in other places that are hard-wired to rely directly on
 font-lock.  The author is aware of =vc-dir= as a case in point.
 
+** Option for no font mixing
+:PROPERTIES:
+:ALT_TITLE: No mixed fonts
+:DESCRIPTION: Toggle mixing of font families
+:CUSTOM_ID: h:115e6c23-ee35-4a16-8cef-e2fcbb08e28b
+:END:
+
+Symbol names:
+
++ =modus-operandi-theme-no-mixed-fonts=
++ =modus-vivendi-theme-no-mixed-fonts=
+
+Possible values:
+
+1. =nil= (default)
+2. =t=
+
+By default, the themes configure some spacing-sensitive faces, such as
+Org tables and code blocks, to always inherit from the =fixed-pitch= face.
+This is to ensure that those constructs remain monospaced when users opt
+for something like the built-in =M-x variable-pitch-mode=.  Otherwise the
+layout would break.
+
+The obvious downside with this theme design is that users need to
+explicitly configure the font family of =fixed-pitch= in order to apply
+their desired typeface (see [[#h:defcf4fc-8fa8-4c29-b12e-7119582cc929][Font 
configurations for Org (and others)]]).
+That may be something they do not want to do.  Hence this option to
+disable any kind of technique for mixing fonts.
+
 ** Option for no link underline
 :PROPERTIES:
 :ALT_TITLE: Link underline
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index ea47ba0..be2c574 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -42,6 +42,7 @@
 ;;     modus-operandi-theme-slanted-constructs             (boolean)
 ;;     modus-operandi-theme-bold-constructs                (boolean)
 ;;     modus-operandi-theme-variable-pitch-headings        (boolean)
+;;     modus-operandi-theme-no-mixed-fonts                 (boolean)
 ;;     modus-operandi-theme-headings                       (alist)
 ;;     modus-operandi-theme-scale-headings                 (boolean)
 ;;     modus-operandi-theme-fringes                        (choice)
@@ -448,6 +449,19 @@ between foreground and background is >= 7:1)."
   "Use proportional fonts (variable-pitch) in headings."
   :type 'boolean)
 
+(defcustom modus-operandi-theme-no-mixed-fonts nil
+  "Disable inheritance from `fixed-pitch' in some faces.
+
+This is done by default to allow spacing-sensitive constructs,
+such as Org tables and code blocks, to remain monospaced when
+users opt for something like the command `variable-pitch-mode'.
+The downside with the default is that users need to explicitly
+configure the font family of `fixed-pitch' in order to get a
+consistent experience.  That may be something they do not want to
+do.  Hence this option to disable any kind of technique for
+mixing fonts."
+  :type 'boolean)
+
 (make-obsolete 'modus-operandi-theme-rainbow-headings
                'modus-operandi-theme-headings
                "`modus-operandi-theme' 0.13.0")
@@ -806,6 +820,11 @@ effect than the former."
   (when modus-operandi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(defun modus-operandi-theme-mixed-fonts ()
+  "Conditional application of `fixed-pitch' inheritance."
+  (unless modus-operandi-theme-no-mixed-fonts
+    (list :inherit 'fixed-pitch)))
+
 (defun modus-operandi-theme-fringe (subtlebg intensebg)
   "Conditional use of background colours for fringes.
 SUBTLEBG should be a subtle greyscale value.  INTENSEBG must be a
@@ -2832,7 +2851,8 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(indium-repl-prompt-face ((,class :foreground ,cyan-alt-other)))
    `(indium-repl-stdout-face ((,class :foreground ,fg-main)))
 ;;;;; info
-   `(Info-quoted ((,class :inherit fixed-pitch :foreground ,magenta))) ; the 
capitalisation is canonical
+   `(Info-quoted ((,class ,@(modus-operandi-theme-mixed-fonts)
+                          :foreground ,magenta))) ; the capitalisation is 
canonical
    `(info-header-node ((,class :inherit bold :foreground ,fg-alt)))
    `(info-header-xref ((,class :foreground ,blue-active)))
    `(info-index-match ((,class :inherit match)))
@@ -3165,7 +3185,7 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; markdown-mode
    `(markdown-blockquote-face ((,class :foreground ,fg-special-warm :slant 
,modus-theme-slant)))
    `(markdown-bold-face ((,class :inherit bold)))
-   `(markdown-code-face ((,class :inherit fixed-pitch)))
+   `(markdown-code-face ((,class ,@(modus-operandi-theme-mixed-fonts))))
    `(markdown-comment-face ((,class :foreground ,fg-alt :slant 
,modus-theme-slant)))
    `(markdown-footnote-marker-face ((,class :inherit bold :foreground 
,cyan-alt)))
    `(markdown-footnote-text-face ((,class :foreground ,fg-main :slant 
,modus-theme-slant)))
@@ -3190,15 +3210,23 @@ Also bind `class' to ((class color) (min-colors 89))."
                                         6 yellow-nuanced yellow-alt-other 
yellow-nuanced-bg bg-region))))
    `(markdown-header-rule-face ((,class :inherit bold :foreground 
,fg-special-warm)))
    `(markdown-hr-face ((,class :inherit bold :foreground ,fg-special-warm)))
-   `(markdown-html-attr-name-face ((,class :inherit fixed-pitch :foreground 
,cyan)))
-   `(markdown-html-attr-value-face ((,class :inherit fixed-pitch :foreground 
,blue)))
-   `(markdown-html-entity-face ((,class :inherit fixed-pitch :foreground 
,cyan)))
-   `(markdown-html-tag-delimiter-face ((,class :inherit fixed-pitch 
:foreground ,fg-special-mild)))
-   `(markdown-html-tag-name-face ((,class :inherit fixed-pitch :foreground 
,magenta-alt)))
-   `(markdown-inline-code-face ((,class :inherit fixed-pitch :foreground 
,magenta)))
+   `(markdown-html-attr-name-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                           :foreground ,cyan)))
+   `(markdown-html-attr-value-face ((,class 
,@(modus-operandi-theme-mixed-fonts)
+                                            :foreground ,blue)))
+   `(markdown-html-entity-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                        :foreground ,cyan)))
+   `(markdown-html-tag-delimiter-face ((,class 
,@(modus-operandi-theme-mixed-fonts)
+                                               :foreground ,fg-special-mild)))
+   `(markdown-html-tag-name-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                          :foreground ,magenta-alt)))
+   `(markdown-inline-code-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                        :foreground ,magenta)))
    `(markdown-italic-face ((,class :foreground ,fg-special-cold :slant 
italic)))
-   `(markdown-language-info-face ((,class :inherit fixed-pitch :foreground 
,fg-special-cold)))
-   `(markdown-language-keyword-face ((,class :inherit fixed-pitch :foreground 
,green-alt-other)))
+   `(markdown-language-info-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                          :foreground ,fg-special-cold)))
+   `(markdown-language-keyword-face ((,class 
,@(modus-operandi-theme-mixed-fonts)
+                                             :foreground ,green-alt-other)))
    `(markdown-line-break-face ((,class :inherit modus-theme-refine-cyan 
:underline t)))
    `(markdown-link-face ((,class :inherit link)))
    `(markdown-link-title-face ((,class :foreground ,fg-special-cold :slant 
,modus-theme-slant)))
@@ -3210,11 +3238,13 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(markdown-missing-link-face ((,class :inherit bold :foreground ,yellow)))
    `(markdown-plain-url-face ((,class :inherit markdown-link-face)))
    `(markdown-pre-face ((,class ,@(and (>= emacs-major-version 27) '(:extend 
t))
-                                :inherit fixed-pitch :background ,bg-dim
+                                ,@(modus-operandi-theme-mixed-fonts)
+                                :background ,bg-dim
                                 :foreground ,fg-special-mild)))
    `(markdown-reference-face ((,class :inherit markdown-markup-face)))
    `(markdown-strike-through-face ((,class :strike-through t)))
-   `(markdown-table-face ((,class :inherit fixed-pitch :foreground 
,fg-special-cold)))
+   `(markdown-table-face ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                  :foreground ,fg-special-cold)))
    `(markdown-url-face ((,class :foreground ,blue-alt)))
 ;;;;; markup-faces (`adoc-mode')
    `(markup-anchor-face ((,class :foreground ,fg-inactive)))
@@ -3509,12 +3539,13 @@ Also bind `class' to ((class color) (min-colors 89))."
                                    :foreground ,fg-special-mild
                                    ,@(modus-operandi-theme-scale 
modus-operandi-theme-scale-3))))
    `(org-archived ((,class :background ,bg-alt :foreground ,fg-alt)))
-   `(org-block ((,class ,@(modus-operandi-theme-org-block bg-dim)
-                        :inherit fixed-pitch :foreground ,fg-main)))
-   `(org-block-begin-line ((,class ,@(modus-operandi-theme-org-block-delim
+   `(org-block ((,class ,@(modus-operandi-theme-mixed-fonts)
+                        ,@(modus-operandi-theme-org-block bg-dim)
+                        :foreground ,fg-main)))
+   `(org-block-begin-line ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                   ,@(modus-operandi-theme-org-block-delim
                                       bg-dim fg-special-cold
-                                      bg-alt fg-special-mild)
-                                   :inherit fixed-pitch)))
+                                      bg-alt fg-special-mild))))
    `(org-block-end-line ((,class :inherit org-block-begin-line)))
    `(org-checkbox ((,class :box (:line-width 1 :color ,bg-active)
                            :background ,bg-inactive :foreground ,fg-active)))
@@ -3525,21 +3556,24 @@ Also bind `class' to ((class color) (min-colors 89))."
                                            :foreground ,red-alt
                                            :inherit 
,modus-theme-variable-pitch)))
    `(org-clock-overlay ((,class :inherit modus-theme-special-cold)))
-   `(org-code ((,class :inherit fixed-pitch :foreground ,magenta)))
+   `(org-code ((,class ,@(modus-operandi-theme-mixed-fonts) :foreground 
,magenta)))
    `(org-column ((,class :background ,bg-alt)))
    `(org-column-title ((,class :inherit bold :underline t :background 
,bg-alt)))
    `(org-date ((,class :inherit (button fixed-pitch) :foreground 
,cyan-alt-other)))
    `(org-date-selected ((,class :inherit bold :foreground ,blue-alt 
:inverse-video t)))
    `(org-document-info ((,class :foreground ,fg-special-cold)))
-   `(org-document-info-keyword ((,class :inherit fixed-pitch :foreground 
,fg-alt)))
+   `(org-document-info-keyword ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                        :foreground ,fg-alt)))
    `(org-document-title ((,class :inherit (bold ,modus-theme-variable-pitch) 
:foreground ,fg-special-cold
                                  ,@(modus-operandi-theme-scale 
modus-operandi-theme-scale-5))))
    `(org-done ((,class :box ,bg-region :background ,bg-dim :foreground ,green
                        :inherit ,modus-theme-variable-pitch)))
-   `(org-drawer ((,class :inherit fixed-pitch :foreground ,cyan)))
+   `(org-drawer ((,class ,@(modus-operandi-theme-mixed-fonts)
+                         :foreground ,cyan)))
    `(org-ellipsis ((,class :foreground nil))) ; inherits from the heading's 
colour
    `(org-footnote ((,class :inherit button :foreground ,blue-alt)))
-   `(org-formula ((,class :inherit fixed-pitch :foreground ,red-alt)))
+   `(org-formula ((,class ,@(modus-operandi-theme-mixed-fonts)
+                          :foreground ,red-alt)))
    `(org-habit-alert-face ((,class :inherit modus-theme-intense-yellow)))
    `(org-habit-alert-future-face ((,class :inherit modus-theme-refine-yellow)))
    `(org-habit-clear-face ((,class :inherit modus-theme-intense-magenta)))
@@ -3576,20 +3610,24 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(org-link ((,class :inherit link)))
    `(org-list-dt ((,class :inherit bold)))
    `(org-macro ((,class :background ,blue-nuanced-bg :foreground 
,magenta-alt-other)))
-   `(org-meta-line ((,class :inherit fixed-pitch :background ,cyan-nuanced-bg 
:foreground ,cyan-nuanced)))
+   `(org-meta-line ((,class ,@(modus-operandi-theme-mixed-fonts)
+                            :background ,cyan-nuanced-bg :foreground 
,cyan-nuanced)))
    `(org-mode-line-clock ((,class :foreground ,fg-main)))
    `(org-mode-line-clock-overrun ((,class :inherit modus-theme-active-red)))
    `(org-priority ((,class :box ,bg-region :background ,bg-dim :foreground 
,magenta
                            :inherit ,modus-theme-variable-pitch)))
-   `(org-property-value ((,class :inherit fixed-pitch :foreground 
,cyan-alt-other)))
+   `(org-property-value ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                 :foreground ,cyan-alt-other)))
    `(org-quote ((,class ,@(modus-operandi-theme-org-block bg-dim)
                         :foreground ,fg-special-calm :slant 
,modus-theme-slant)))
    `(org-scheduled ((,class :foreground ,fg-special-warm)))
    `(org-scheduled-previously ((,class :foreground ,yellow-alt-other)))
    `(org-scheduled-today ((,class :foreground ,magenta-alt-other)))
    `(org-sexp-date ((,class :inherit org-date)))
-   `(org-special-keyword ((,class :inherit fixed-pitch :foreground 
,blue-nuanced)))
-   `(org-table ((,class :inherit fixed-pitch :foreground ,fg-special-cold)))
+   `(org-special-keyword ((,class ,@(modus-operandi-theme-mixed-fonts)
+                                  :foreground ,blue-nuanced)))
+   `(org-table ((,class ,@(modus-operandi-theme-mixed-fonts)
+                        :foreground ,fg-special-cold)))
    `(org-table-header ((,class :inherit (fixed-pitch 
modus-theme-intense-neutral))))
    `(org-tag ((,class :foreground ,magenta-nuanced)))
    `(org-tag-group ((,class :inherit bold :foreground ,cyan-nuanced)))
@@ -3599,7 +3637,8 @@ Also bind `class' to ((class color) (min-colors 89))."
                        :inherit ,modus-theme-variable-pitch)))
    `(org-upcoming-deadline ((,class :foreground ,red-alt-other)))
    `(org-upcoming-distant-deadline ((,class :foreground ,red-nuanced)))
-   `(org-verbatim ((,class :inherit fixed-pitch :background ,bg-alt 
:foreground ,fg-special-calm)))
+   `(org-verbatim ((,class ,@(modus-operandi-theme-mixed-fonts)
+                           :background ,bg-alt :foreground ,fg-special-calm)))
    `(org-verse ((,class :inherit org-quote)))
    `(org-warning ((,class :inherit bold :foreground ,red-alt-other)))
 ;;;;; org-journal
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index fde5064..8ce6dfa 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -42,6 +42,7 @@
 ;;     modus-vivendi-theme-slanted-constructs             (boolean)
 ;;     modus-vivendi-theme-bold-constructs                (boolean)
 ;;     modus-vivendi-theme-variable-pitch-headings        (boolean)
+;;     modus-vivendi-theme-no-mixed-fonts                 (boolean)
 ;;     modus-vivendi-theme-headings                       (alist)
 ;;     modus-vivendi-theme-scale-headings                 (boolean)
 ;;     modus-vivendi-theme-fringes                        (choice)
@@ -448,6 +449,19 @@ between foreground and background is >= 7:1)."
   "Use proportional fonts (variable-pitch) in headings."
   :type 'boolean)
 
+(defcustom modus-vivendi-theme-no-mixed-fonts nil
+  "Disable inheritance from `fixed-pitch' in some faces.
+
+This is done by default to allow spacing-sensitive constructs,
+such as Org tables and code blocks, to remain monospaced when
+users opt for something like the command `variable-pitch-mode'.
+The downside with the default is that users need to explicitly
+configure the font family of `fixed-pitch' in order to get a
+consistent experience.  That may be something they do not want to
+do.  Hence this option to disable any kind of technique for
+mixing fonts."
+  :type 'boolean)
+
 (make-obsolete 'modus-vivendi-theme-rainbow-headings
                'modus-vivendi-theme-headings
                "`modus-vivendi-theme' 0.13.0")
@@ -806,6 +820,11 @@ effect than the former."
   (when modus-vivendi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(defun modus-vivendi-theme-mixed-fonts ()
+  "Conditional application of `fixed-pitch' inheritance."
+  (unless modus-vivendi-theme-no-mixed-fonts
+    (list :inherit 'fixed-pitch)))
+
 (defun modus-vivendi-theme-fringe (subtlebg intensebg)
   "Conditional use of background colours for fringes.
 SUBTLEBG should be a subtle greyscale value.  INTENSEBG must be a
@@ -2832,7 +2851,8 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(indium-repl-prompt-face ((,class :foreground ,cyan-alt-other)))
    `(indium-repl-stdout-face ((,class :foreground ,fg-main)))
 ;;;;; info
-   `(Info-quoted ((,class :inherit fixed-pitch :foreground ,magenta))) ; the 
capitalisation is canonical
+   `(Info-quoted ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                          :foreground ,magenta))) ; the capitalisation is 
canonical
    `(info-header-node ((,class :inherit bold :foreground ,fg-alt)))
    `(info-header-xref ((,class :foreground ,blue-active)))
    `(info-index-match ((,class :inherit match)))
@@ -3165,7 +3185,7 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; markdown-mode
    `(markdown-blockquote-face ((,class :foreground ,fg-special-warm :slant 
,modus-theme-slant)))
    `(markdown-bold-face ((,class :inherit bold)))
-   `(markdown-code-face ((,class :inherit fixed-pitch)))
+   `(markdown-code-face ((,class ,@(modus-vivendi-theme-mixed-fonts))))
    `(markdown-comment-face ((,class :foreground ,fg-alt :slant 
,modus-theme-slant)))
    `(markdown-footnote-marker-face ((,class :inherit bold :foreground 
,cyan-alt)))
    `(markdown-footnote-text-face ((,class :foreground ,fg-main :slant 
,modus-theme-slant)))
@@ -3190,15 +3210,23 @@ Also bind `class' to ((class color) (min-colors 89))."
                                         6 yellow-nuanced yellow-alt-other 
yellow-nuanced-bg bg-region))))
    `(markdown-header-rule-face ((,class :inherit bold :foreground 
,fg-special-warm)))
    `(markdown-hr-face ((,class :inherit bold :foreground ,fg-special-warm)))
-   `(markdown-html-attr-name-face ((,class :inherit fixed-pitch :foreground 
,cyan)))
-   `(markdown-html-attr-value-face ((,class :inherit fixed-pitch :foreground 
,blue)))
-   `(markdown-html-entity-face ((,class :inherit fixed-pitch :foreground 
,cyan)))
-   `(markdown-html-tag-delimiter-face ((,class :inherit fixed-pitch 
:foreground ,fg-special-mild)))
-   `(markdown-html-tag-name-face ((,class :inherit fixed-pitch :foreground 
,magenta-alt)))
-   `(markdown-inline-code-face ((,class :inherit fixed-pitch :foreground 
,magenta)))
+   `(markdown-html-attr-name-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                           :foreground ,cyan)))
+   `(markdown-html-attr-value-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                            :foreground ,blue)))
+   `(markdown-html-entity-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                        :foreground ,cyan)))
+   `(markdown-html-tag-delimiter-face ((,class 
,@(modus-vivendi-theme-mixed-fonts)
+                                               :foreground ,fg-special-mild)))
+   `(markdown-html-tag-name-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                          :foreground ,magenta-alt)))
+   `(markdown-inline-code-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                        :foreground ,magenta)))
    `(markdown-italic-face ((,class :foreground ,fg-special-cold :slant 
italic)))
-   `(markdown-language-info-face ((,class :inherit fixed-pitch :foreground 
,fg-special-cold)))
-   `(markdown-language-keyword-face ((,class :inherit fixed-pitch :foreground 
,green-alt-other)))
+   `(markdown-language-info-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                          :foreground ,fg-special-cold)))
+   `(markdown-language-keyword-face ((,class 
,@(modus-vivendi-theme-mixed-fonts)
+                                             :foreground ,green-alt-other)))
    `(markdown-line-break-face ((,class :inherit modus-theme-refine-cyan 
:underline t)))
    `(markdown-link-face ((,class :inherit link)))
    `(markdown-link-title-face ((,class :foreground ,fg-special-cold :slant 
,modus-theme-slant)))
@@ -3210,11 +3238,13 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(markdown-missing-link-face ((,class :inherit bold :foreground ,yellow)))
    `(markdown-plain-url-face ((,class :inherit markdown-link-face)))
    `(markdown-pre-face ((,class ,@(and (>= emacs-major-version 27) '(:extend 
t))
-                                :inherit fixed-pitch :background ,bg-dim
+                                ,@(modus-vivendi-theme-mixed-fonts)
+                                :background ,bg-dim
                                 :foreground ,fg-special-mild)))
    `(markdown-reference-face ((,class :inherit markdown-markup-face)))
    `(markdown-strike-through-face ((,class :strike-through t)))
-   `(markdown-table-face ((,class :inherit fixed-pitch :foreground 
,fg-special-cold)))
+   `(markdown-table-face ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                  :foreground ,fg-special-cold)))
    `(markdown-url-face ((,class :foreground ,blue-alt)))
 ;;;;; markup-faces (`adoc-mode')
    `(markup-anchor-face ((,class :foreground ,fg-inactive)))
@@ -3509,12 +3539,13 @@ Also bind `class' to ((class color) (min-colors 89))."
                                    :foreground ,fg-special-mild
                                    ,@(modus-vivendi-theme-scale 
modus-vivendi-theme-scale-3))))
    `(org-archived ((,class :background ,bg-alt :foreground ,fg-alt)))
-   `(org-block ((,class ,@(modus-vivendi-theme-org-block bg-dim)
-                        :inherit fixed-pitch :foreground ,fg-main)))
-   `(org-block-begin-line ((,class ,@(modus-vivendi-theme-org-block-delim
+   `(org-block ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                        ,@(modus-vivendi-theme-org-block bg-dim)
+                        :foreground ,fg-main)))
+   `(org-block-begin-line ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                   ,@(modus-vivendi-theme-org-block-delim
                                       bg-dim fg-special-cold
-                                      bg-alt fg-special-mild)
-                                   :inherit fixed-pitch)))
+                                      bg-alt fg-special-mild))))
    `(org-block-end-line ((,class :inherit org-block-begin-line)))
    `(org-checkbox ((,class :box (:line-width 1 :color ,bg-active)
                            :background ,bg-inactive :foreground ,fg-active)))
@@ -3525,21 +3556,24 @@ Also bind `class' to ((class color) (min-colors 89))."
                                            :foreground ,red-alt
                                            :inherit 
,modus-theme-variable-pitch)))
    `(org-clock-overlay ((,class :inherit modus-theme-special-cold)))
-   `(org-code ((,class :inherit fixed-pitch :foreground ,magenta)))
+   `(org-code ((,class ,@(modus-vivendi-theme-mixed-fonts) :foreground 
,magenta)))
    `(org-column ((,class :background ,bg-alt)))
    `(org-column-title ((,class :inherit bold :underline t :background 
,bg-alt)))
    `(org-date ((,class :inherit (button fixed-pitch) :foreground 
,cyan-alt-other)))
    `(org-date-selected ((,class :inherit bold :foreground ,blue-alt 
:inverse-video t)))
    `(org-document-info ((,class :foreground ,fg-special-cold)))
-   `(org-document-info-keyword ((,class :inherit fixed-pitch :foreground 
,fg-alt)))
+   `(org-document-info-keyword ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                        :foreground ,fg-alt)))
    `(org-document-title ((,class :inherit (bold ,modus-theme-variable-pitch) 
:foreground ,fg-special-cold
                                  ,@(modus-vivendi-theme-scale 
modus-vivendi-theme-scale-5))))
    `(org-done ((,class :box ,bg-region :background ,bg-dim :foreground ,green
                        :inherit ,modus-theme-variable-pitch)))
-   `(org-drawer ((,class :inherit fixed-pitch :foreground ,cyan)))
+   `(org-drawer ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                         :foreground ,cyan)))
    `(org-ellipsis ((,class :foreground nil))) ; inherits from the heading's 
colour
    `(org-footnote ((,class :inherit button :foreground ,blue-alt)))
-   `(org-formula ((,class :inherit fixed-pitch :foreground ,red-alt)))
+   `(org-formula ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                          :foreground ,red-alt)))
    `(org-habit-alert-face ((,class :inherit modus-theme-intense-yellow)))
    `(org-habit-alert-future-face ((,class :inherit modus-theme-refine-yellow)))
    `(org-habit-clear-face ((,class :inherit modus-theme-intense-magenta)))
@@ -3576,20 +3610,24 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(org-link ((,class :inherit link)))
    `(org-list-dt ((,class :inherit bold)))
    `(org-macro ((,class :background ,blue-nuanced-bg :foreground 
,magenta-alt-other)))
-   `(org-meta-line ((,class :inherit fixed-pitch :background ,cyan-nuanced-bg 
:foreground ,cyan-nuanced)))
+   `(org-meta-line ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                            :background ,cyan-nuanced-bg :foreground 
,cyan-nuanced)))
    `(org-mode-line-clock ((,class :foreground ,fg-main)))
    `(org-mode-line-clock-overrun ((,class :inherit modus-theme-active-red)))
    `(org-priority ((,class :box ,bg-region :background ,bg-dim :foreground 
,magenta
                            :inherit ,modus-theme-variable-pitch)))
-   `(org-property-value ((,class :inherit fixed-pitch :foreground 
,cyan-alt-other)))
+   `(org-property-value ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                 :foreground ,cyan-alt-other)))
    `(org-quote ((,class ,@(modus-vivendi-theme-org-block bg-dim)
                         :foreground ,fg-special-calm :slant 
,modus-theme-slant)))
    `(org-scheduled ((,class :foreground ,fg-special-warm)))
    `(org-scheduled-previously ((,class :foreground ,yellow-alt-other)))
    `(org-scheduled-today ((,class :foreground ,magenta-alt-other)))
    `(org-sexp-date ((,class :inherit org-date)))
-   `(org-special-keyword ((,class :inherit fixed-pitch :foreground 
,blue-nuanced)))
-   `(org-table ((,class :inherit fixed-pitch :foreground ,fg-special-cold)))
+   `(org-special-keyword ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                                  :foreground ,blue-nuanced)))
+   `(org-table ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                        :foreground ,fg-special-cold)))
    `(org-table-header ((,class :inherit (fixed-pitch 
modus-theme-intense-neutral))))
    `(org-tag ((,class :foreground ,magenta-nuanced)))
    `(org-tag-group ((,class :inherit bold :foreground ,cyan-nuanced)))
@@ -3599,7 +3637,8 @@ Also bind `class' to ((class color) (min-colors 89))."
                        :inherit ,modus-theme-variable-pitch)))
    `(org-upcoming-deadline ((,class :foreground ,red-alt-other)))
    `(org-upcoming-distant-deadline ((,class :foreground ,red-nuanced)))
-   `(org-verbatim ((,class :inherit fixed-pitch :background ,bg-alt 
:foreground ,fg-special-calm)))
+   `(org-verbatim ((,class ,@(modus-vivendi-theme-mixed-fonts)
+                           :background ,bg-alt :foreground ,fg-special-calm)))
    `(org-verse ((,class :inherit org-quote)))
    `(org-warning ((,class :inherit bold :foreground ,red-alt-other)))
 ;;;;; org-journal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]