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

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

[elpa] externals/modus-operandi-theme 8a0b566 43/99: Refine conditional


From: Stefan Monnier
Subject: [elpa] externals/modus-operandi-theme 8a0b566 43/99: Refine conditional beg/end styles for Org blocks
Date: Fri, 31 Jul 2020 09:25:23 -0400 (EDT)

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

    Refine conditional beg/end styles for Org blocks
    
    This is based on feedback I received in issue 57:
    https://gitlab.com/protesilaos/modus-themes/-/issues/57
    
    Refer to that link for up-to-date screenshots and/or to share your
    thoughts.
---
 modus-operandi-theme.el | 21 +++++++++++++++------
 modus-vivendi-theme.el  | 21 +++++++++++++++------
 2 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 57f605c..7564e65 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -555,16 +555,25 @@ as the rest of the buffer."
        (list :background bgblk))
     (list :background nil)))
 
-(defun modus-operandi-theme-org-block-delim (bgext fgext bg fg)
+(defun modus-operandi-theme-org-block-delim (bgaccent fgaccent bg fg)
   "Conditionally set the styles of Org block delimiters.
-BGEXT and FGEXT apply a background and foreground colour
-respectively and set the `:extend' attribute where applicable.
-BG and FG should be a largely neutral colour combination."
+BG, FG, BGACCENT, FGACCENT apply a background and foreground
+colour respectively and set the `:extend' attribute where
+applicable.
+
+The former pair is a greyscale combination that should be more
+distinct than the background of the block.
+
+The latter pair should be more subtle than the background of the
+block, as it is used when source blocks are cast on a
+coloured/accented backdrop."
   (if (or modus-operandi-theme-distinct-org-blocks
           modus-operandi-theme-rainbow-org-src-blocks)
       (append
        (and (>= emacs-major-version 27) '(:extend t))
-       (list :background bgext :foreground fgext))
+       (if modus-operandi-theme-rainbow-org-src-blocks
+           (list :background bgaccent :foreground fgaccent)
+         (list :background bg :foreground fg)))
     (list :background bg :foreground fg)))
 
 (defun modus-operandi-theme-modeline-box (col3d col &optional btn int)
@@ -2817,7 +2826,7 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(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
-                                      bg-active fg-special-cold
+                                      bg-dim fg-special-cold
                                       bg-alt fg-special-mild)
                                    :inherit fixed-pitch)))
    `(org-block-end-line ((,class :inherit org-block-begin-line)))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 96c9dd5..56edcca 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -555,16 +555,25 @@ as the rest of the buffer."
        (list :background bgblk))
     (list :background nil)))
 
-(defun modus-vivendi-theme-org-block-delim (bgext fgext bg fg)
+(defun modus-vivendi-theme-org-block-delim (bgaccent fgaccent bg fg)
   "Conditionally set the styles of Org block delimiters.
-BGEXT and FGEXT apply a background and foreground colour
-respectively and set the `:extend' attribute where applicable.
-BG and FG should be a largely neutral colour combination."
+BG, FG, BGACCENT, FGACCENT apply a background and foreground
+colour respectively and set the `:extend' attribute where
+applicable.
+
+The former pair is a greyscale combination that should be more
+distinct than the background of the block.
+
+The latter pair should be more subtle than the background of the
+block, as it is used when source blocks are cast on a
+coloured/accented backdrop."
   (if (or modus-vivendi-theme-distinct-org-blocks
           modus-vivendi-theme-rainbow-org-src-blocks)
       (append
        (and (>= emacs-major-version 27) '(:extend t))
-       (list :background bgext :foreground fgext))
+       (if modus-vivendi-theme-rainbow-org-src-blocks
+           (list :background bgaccent :foreground fgaccent)
+         (list :background bg :foreground fg)))
     (list :background bg :foreground fg)))
 
 (defun modus-vivendi-theme-modeline-box (col3d col &optional btn int)
@@ -2817,7 +2826,7 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(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
-                                      bg-active fg-special-cold
+                                      bg-dim fg-special-cold
                                       bg-alt fg-special-mild)
                                    :inherit fixed-pitch)))
    `(org-block-end-line ((,class :inherit org-block-begin-line)))



reply via email to

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