[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/modus-operandi-theme feaef70 08/54: Refine ORG-MODE fac
From: |
Stefan Monnier |
Subject: |
[elpa] externals/modus-operandi-theme feaef70 08/54: Refine ORG-MODE faces for mixed font workflows |
Date: |
Thu, 4 Jun 2020 08:20:10 -0400 (EDT) |
branch: externals/modus-operandi-theme
commit feaef70a558ad732f3cb35e060fc018af0d9b39a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Refine ORG-MODE faces for mixed font workflows
Several faces will now use a monospaced font even when the user opts for
a proportionately-spaced family as their main typeface.
The previous settings would "break" the layout when the user enabled
something like (variable-pitch-mode). Now things work as expected.
Note though that depending on the user's font settings, some adjustments
may be necessary (though these are outside the scope of the themes).
Example:
(set-face-attribute 'variable-pitch nil :family "Source Sans Pro" :height
110)
(set-face-attribute 'fixed-pitch nil :family "Source Code Pro" :height 110)
This set of changes was recommended in issue 40:
https://gitlab.com/protesilaos/modus-themes/-/issues/40
---
README.org | 30 ++++++++++++++++++++++++++++++
modus-operandi-theme.el | 16 +++++++++-------
modus-vivendi-theme.el | 16 +++++++++-------
3 files changed, 48 insertions(+), 14 deletions(-)
diff --git a/README.org b/README.org
index ae34777..0a31c36 100644
--- a/README.org
+++ b/README.org
@@ -466,6 +466,36 @@ package which offers live colour previews. This is how I
configure it:
(setq rainbow-x-colors nil))
#+end_src
+** Optional minimum extra configurations for mixed fonts
+ :PROPERTIES:
+ :CUSTOM_ID: h:ea30ff0e-3bb6-4801-baf1-d49169d94cd5
+ :END:
+
+The themes are designed to cope well with mixed font settings.
+Currently this applies to Org mode (courtesy of
[[https://gitlab.com/protesilaos/modus-themes/-/issues/40][Ben in issue 40]]).
+
+In practice it means that some parts of an Org buffer will use a
+monospaced font even when the user opts for a proportionately-spaced
+typeface as their default (such as by enabling =(variable-pitch-mode)=).
+This is to ensure that code blocks and other relevant elements use the
+appropriate type settings and are positioned correctly.
+
+To specify the font families and their respective height, you could do
+something like:
+
+#+begin_src emacs-lisp
+(set-face-attribute 'variable-pitch nil :family "Source Sans Pro" :height 110)
+(set-face-attribute 'fixed-pitch nil :family "Source Code Pro" :height 110)
+#+end_src
+
+In this example, you are defining the attributes of the =variable-pitch=
+face (proportional) and of =fixed-pitch= (monospace), which are then
+inherited by other faces at the theme level.
+
+If any Org power user is reading this section, I encourage you to
+recommend some other /minimal/ tweaks and customisations that could
+improve the user experience.
+
* Face coverage
:PROPERTIES:
:CUSTOM_ID: h:944a3bdf-f545-40a0-a26c-b2cec8b2b316
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index f9cd957..b320f16 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -2457,11 +2457,12 @@ 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-src-block bg-dim bg-main)
:foreground ,fg-main))))
+ `(org-block ((,class (,@(modus-operandi-theme-org-src-block bg-dim bg-main)
+ :inherit fixed-pitch :foreground ,fg-main))))
`(org-block-begin-line ((,class (,@(and (>= emacs-major-version 27)
modus-operandi-theme-distinct-org-blocks
'(:extend t))
- :background ,bg-alt :foreground
,fg-special-mild))))
+ :inherit fixed-pitch :background ,bg-alt
:foreground ,fg-special-mild))))
`(org-block-end-line ((,class (:inherit org-block-begin-line))))
`(org-checkbox ((,class (:weight bold))))
`(org-checkbox-statistics-done ((,class (:foreground ,green
@@ -2471,14 +2472,14 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-operandi-theme-heading-block
yellow-nuanced-bg
yellow-nuanced)))))
`(org-clock-overlay ((,class (:inherit modus-theme-special-cold))))
- `(org-code ((,class (:foreground ,magenta))))
+ `(org-code ((,class (:inherit fixed-pitch :foreground ,magenta))))
`(org-column ((,class (:background ,bg-alt))))
`(org-column-title ((,class (:underline t :background ,bg-alt :weight
bold))))
`(org-date ((,class (:foreground ,blue-nuanced))))
`(org-date-selected ((,class (:inherit modus-theme-intense-cyan :weight
bold))))
`(org-default ((,class (:background ,bg-main :foreground ,fg-main))))
`(org-document-info ((,class (:foreground ,fg-special-cold))))
- `(org-document-title ((,class (:foreground ,fg-special-cold :weight bold))))
+ `(org-document-info-keyword ((,class (:inherit fixed-pitch :foreground
,fg-alt))))
`(org-document-title ((,class (,@(modus-operandi-theme-scale
modus-operandi-theme-scale-5)
:foreground ,fg-special-cold :weight bold))))
`(org-done ((,class (,@(modus-operandi-theme-org-todo-block
green-nuanced-bg green-nuanced green)))))
@@ -2498,6 +2499,7 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-operandi-theme-heading-block
green-nuanced-bg
green-nuanced)))))
`(org-hide ((,class (:foreground ,bg-main))))
+ `(org-indent ((,class (:inherit (fixed-pitch org-hide)))))
`(org-latex-and-related ((,class (:foreground ,magenta-refine-fg))))
`(org-level-1 ((,class (:inherit ,modus-theme-variable-pitch :weight bold
,@(modus-operandi-theme-heading-foreground
fg-main magenta-alt-other)
@@ -2530,7 +2532,7 @@ Also bind `class' to ((class color) (min-colors 89))."
`(org-link ((,class (:inherit link))))
`(org-list-dt ((,class (:weight bold))))
`(org-macro ((,class (:inherit org-latex-and-related))))
- `(org-meta-line ((,class (:foreground ,fg-alt :slant ,modus-theme-slant))))
+ `(org-meta-line ((,class (:inherit fixed-pitch :foreground ,fg-alt :slant
,modus-theme-slant))))
`(org-mode-line-clock ((,class (:background ,bg-main :foreground
,fg-main))))
`(org-mode-line-clock-overrun ((,class (:inherit modus-theme-active-red))))
`(org-priority ((,class (,@(modus-operandi-theme-org-todo-block
blue-nuanced-bg blue-nuanced magenta)
@@ -2542,7 +2544,7 @@ Also bind `class' to ((class color) (min-colors 89))."
`(org-scheduled-today ((,class (:foreground ,yellow-alt-other))))
`(org-sexp-date ((,class (:inherit org-date))))
`(org-special-keyword ((,class (,@(modus-operandi-theme-org-todo-block
cyan-nuanced-bg cyan-nuanced cyan-alt)))))
- `(org-table ((,class (:foreground ,fg-special-cold))))
+ `(org-table ((,class (:inherit fixed-pitch :foreground ,fg-special-cold))))
`(org-tag ((,class (:foreground ,magenta-nuanced :weight normal))))
`(org-tag-group ((,class (:foreground ,cyan-nuanced :weight bold))))
`(org-target ((,class (:underline t))))
@@ -2551,7 +2553,7 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-operandi-theme-heading-foreground
magenta-alt-other red-alt-other)))))
`(org-upcoming-deadline ((,class (:foreground ,red-alt-other))))
`(org-upcoming-distant-deadline ((,class (:foreground ,red-nuanced))))
- `(org-verbatim ((,class (:background ,bg-alt :foreground
,fg-special-calm))))
+ `(org-verbatim ((,class (:inherit fixed-pitch :background ,bg-alt
:foreground ,fg-special-calm))))
`(org-verse ((,class (:inherit org-quote))))
`(org-warning ((,class (:foreground ,blue-intense))))
;;;; org-journal
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 2d370ea..ccaf838 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -2457,11 +2457,12 @@ 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-src-block bg-dim bg-main)
:foreground ,fg-main))))
+ `(org-block ((,class (,@(modus-vivendi-theme-org-src-block bg-dim bg-main)
+ :inherit fixed-pitch :foreground ,fg-main))))
`(org-block-begin-line ((,class (,@(and (>= emacs-major-version 27)
modus-vivendi-theme-distinct-org-blocks
'(:extend t))
- :background ,bg-alt :foreground
,fg-special-mild))))
+ :inherit fixed-pitch :background ,bg-alt
:foreground ,fg-special-mild))))
`(org-block-end-line ((,class (:inherit org-block-begin-line))))
`(org-checkbox ((,class (:weight bold))))
`(org-checkbox-statistics-done ((,class (:foreground ,green
@@ -2471,14 +2472,14 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-vivendi-theme-heading-block
yellow-nuanced-bg
yellow-nuanced)))))
`(org-clock-overlay ((,class (:inherit modus-theme-special-cold))))
- `(org-code ((,class (:foreground ,magenta))))
+ `(org-code ((,class (:inherit fixed-pitch :foreground ,magenta))))
`(org-column ((,class (:background ,bg-alt))))
`(org-column-title ((,class (:underline t :background ,bg-alt :weight
bold))))
`(org-date ((,class (:foreground ,blue-nuanced))))
`(org-date-selected ((,class (:inherit modus-theme-intense-cyan :weight
bold))))
`(org-default ((,class (:background ,bg-main :foreground ,fg-main))))
`(org-document-info ((,class (:foreground ,fg-special-cold))))
- `(org-document-title ((,class (:foreground ,fg-special-cold :weight bold))))
+ `(org-document-info-keyword ((,class (:inherit fixed-pitch :foreground
,fg-alt))))
`(org-document-title ((,class (,@(modus-vivendi-theme-scale
modus-vivendi-theme-scale-5)
:foreground ,fg-special-cold :weight bold))))
`(org-done ((,class (,@(modus-vivendi-theme-org-todo-block green-nuanced-bg
green-nuanced green)))))
@@ -2498,6 +2499,7 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-vivendi-theme-heading-block
green-nuanced-bg
green-nuanced)))))
`(org-hide ((,class (:foreground ,bg-main))))
+ `(org-indent ((,class (:inherit (fixed-pitch org-hide)))))
`(org-latex-and-related ((,class (:foreground ,magenta-refine-fg))))
`(org-level-1 ((,class (:inherit ,modus-theme-variable-pitch :weight bold
,@(modus-vivendi-theme-heading-foreground
fg-main magenta-alt-other)
@@ -2530,7 +2532,7 @@ Also bind `class' to ((class color) (min-colors 89))."
`(org-link ((,class (:inherit link))))
`(org-list-dt ((,class (:weight bold))))
`(org-macro ((,class (:inherit org-latex-and-related))))
- `(org-meta-line ((,class (:foreground ,fg-alt :slant ,modus-theme-slant))))
+ `(org-meta-line ((,class (:inherit fixed-pitch :foreground ,fg-alt :slant
,modus-theme-slant))))
`(org-mode-line-clock ((,class (:background ,bg-main :foreground
,fg-main))))
`(org-mode-line-clock-overrun ((,class (:inherit modus-theme-active-red))))
`(org-priority ((,class (,@(modus-vivendi-theme-org-todo-block
blue-nuanced-bg blue-nuanced magenta)
@@ -2542,7 +2544,7 @@ Also bind `class' to ((class color) (min-colors 89))."
`(org-scheduled-today ((,class (:foreground ,yellow-alt-other))))
`(org-sexp-date ((,class (:inherit org-date))))
`(org-special-keyword ((,class (,@(modus-vivendi-theme-org-todo-block
cyan-nuanced-bg cyan-nuanced cyan-alt)))))
- `(org-table ((,class (:foreground ,fg-special-cold))))
+ `(org-table ((,class (:inherit fixed-pitch :foreground ,fg-special-cold))))
`(org-tag ((,class (:foreground ,magenta-nuanced :weight normal))))
`(org-tag-group ((,class (:foreground ,cyan-nuanced :weight bold))))
`(org-target ((,class (:underline t))))
@@ -2551,7 +2553,7 @@ Also bind `class' to ((class color) (min-colors 89))."
,@(modus-vivendi-theme-heading-foreground
magenta-alt-other red-alt-other)))))
`(org-upcoming-deadline ((,class (:foreground ,red-alt-other))))
`(org-upcoming-distant-deadline ((,class (:foreground ,red-nuanced))))
- `(org-verbatim ((,class (:background ,bg-alt :foreground
,fg-special-calm))))
+ `(org-verbatim ((,class (:inherit fixed-pitch :background ,bg-alt
:foreground ,fg-special-calm))))
`(org-verse ((,class (:inherit org-quote))))
`(org-warning ((,class (:foreground ,blue-intense))))
;;;; org-journal
- [elpa] externals/modus-operandi-theme 2ffe984 16/54: Clarify docs for scaled headings and their values, (continued)
- [elpa] externals/modus-operandi-theme 2ffe984 16/54: Clarify docs for scaled headings and their values, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 7c37202 17/54: Don't set background in regular ORG modeline clock, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme ae0e956 25/54: Fix regression with byte compilation, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 7a8a7cb 19/54: Implement minor palette tweaks for Modus Operandi, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 1faab94 30/54: Tweak MAGIT header line key colour, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 9b5d56d 33/54: Add support for EROS, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 40667a5 37/54: Review EROS face (better for longer echo messages), Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 39809b0 39/54: Review IMENU-LIST faces (more harmonious combos), Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme e42eb37 45/54: Add support for missing `helm-comint-*' faces, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 4a9bd23 06/54: Apply optional highest scale to org-document-title, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme feaef70 08/54: Refine ORG-MODE faces for mixed font workflows,
Stefan Monnier <=
- [elpa] externals/modus-operandi-theme c72b01c 11/54: Add support for INDIUM, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 58a9924 12/54: Add support for VDIFF, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 91ce02b 09/54: Expand README on face customisation, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 4b3f6a3 27/54: Add tentative support for CIRCE, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 148f73a 46/54: Add support for missing `helm-eshell-*' faces, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 7c67f73 50/54: Add support for EL-SEARCH, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme f76c36a 13/54: Major review of colours for tabs. Tweak faces., Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme a937f90 14/54: Modus Vivendi: tweak colour for header lines, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme 78a2baf 18/54: Clarify that Org #+TITLE does not scale in v0.8.1, Stefan Monnier, 2020/06/04
- [elpa] externals/modus-operandi-theme a99bec3 20/54: Improve README section on font family settings, Stefan Monnier, 2020/06/04