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

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

[elpa] externals/modus-vivendi-theme 3709b5b 02/73: New CUSTOM OPTION to


From: Stefan Monnier
Subject: [elpa] externals/modus-vivendi-theme 3709b5b 02/73: New CUSTOM OPTION to choose fringe visibility
Date: Wed, 26 Aug 2020 09:20:50 -0400 (EDT)

branch: externals/modus-vivendi-theme
commit 3709b5ba5236108afbdf66228d4ff283a06f5f0e
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    New CUSTOM OPTION to choose fringe visibility
---
 README.org              | 16 +++++++++-------
 modus-operandi-theme.el | 33 ++++++++++++++++++++++++++++++---
 modus-vivendi-theme.el  | 33 ++++++++++++++++++++++++++++++---
 3 files changed, 69 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index 4972a15..ddfb76d 100644
--- a/README.org
+++ b/README.org
@@ -398,27 +398,29 @@ not of keywords that are added to it, like "TODO".  This 
is outside the
 control of the themes and I am not aware of any way to make such
 keywords scale accordingly (see [[*Font configurations for Org (and 
others)][issue 37]]).
 
-** Option for visible fringes
+** Option for "subtle" or "intense" fringe visibility
    :PROPERTIES:
    :CUSTOM_ID: h:d989f116-7559-40bc-bf94-ef508d480960
    :END:
 
 Symbol names:
 
-+ =modus-operandi-theme-visible-fringe=
-+ =modus-vivendi-theme-visible-fringe=
++ =modus-operandi-theme-fringes=
++ =modus-vivendi-theme-fringes=
 
 Possible values:
 
 1. =nil= (default)
-2. =t=
+2. =subtle=
+3. =intense=
 
-When enabled, this will render the fringes in a subtle background
-colour.
+The "subtle" symbol will apply a greyscale background that is visible,
+yet close enough to the main background colour.  While the "intense"
+symbol will use a more noticeable greyscale background.
 
 The default is to use the same colour as that of the main background,
 meaning that the fringes are not obvious though they still occupy the
-space given to them by =fringe-mode= (8px on either side by default).
+space given to them by =fringe-mode= (8 pixels on either side by default).
 
 ** Option for more slanted constructs
    :PROPERTIES:
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index efb4624..77dd1fb 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -45,7 +45,7 @@
 ;;     modus-operandi-theme-rainbow-headings               (boolean)
 ;;     modus-operandi-theme-section-headings               (boolean)
 ;;     modus-operandi-theme-scale-headings                 (boolean)
-;;     modus-operandi-theme-visible-fringes                (boolean)
+;;     modus-operandi-theme-fringes                        (choice)
 ;;     modus-operandi-theme-org-blocks                     (choice)
 ;;     modus-operandi-theme-3d-modeline                    (boolean)
 ;;     modus-operandi-theme-subtle-diffs                   (boolean)
@@ -501,10 +501,25 @@ For more on the matter, read the documentation of
 `set-face-attribute', specifically the ':height' section."
   :type 'number)
 
+(define-obsolete-variable-alias 'modus-operandi-theme-visible-fringes
+  'modus-operandi-theme-fringes "`modus-operandi-theme' 0.12.0")
+
 (defcustom modus-operandi-theme-visible-fringes nil
   "Use a visible style for fringes."
   :type 'boolean)
 
+(defcustom modus-operandi-theme-fringes nil
+  "Define the visibility of fringes.
+
+Nil means the fringes have no background colour.  Option `subtle'
+will apply a greyscale value that is visible yet close to the
+main buffer background colour.  Option `intense' will use a more
+pronounced greyscale value."
+  :type '(choice
+             (const :tag "No visible fringes (default)" nil)
+             (const :tag "Subtle greyscale background" subtle)
+             (const :tag "Intense greyscale background" intense)))
+
 (define-obsolete-variable-alias 'modus-operandi-theme-distinct-org-blocks
   'modus-operandi-theme-org-blocks "`modus-operandi-theme' 0.11.0")
 
@@ -576,6 +591,19 @@ association list)."
   (when modus-operandi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(defun modus-operandi-theme-fringe (subtlebg intensebg)
+  "Conditional use of intense colours for matching parentheses.
+NORMALBG should the special palette colour 'bg-paren-match' or
+something similar.  INTENSEBG must be easier to discern next to
+other backgrounds."
+  (cond
+   ((eq modus-operandi-theme-fringes 'intense)
+    (list :background intensebg))
+   ((eq modus-operandi-theme-fringes 'subtle)
+    (list :background subtlebg))
+   (t
+    (list :background nil))))
+
 (defun modus-operandi-theme-paren (normalbg intensebg)
   "Conditional use of intense colours for matching parentheses.
 NORMALBG should the special palette colour 'bg-paren-match' or
@@ -1033,8 +1061,7 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; absolute essentials
    `(default ((,class :background ,bg-main :foreground ,fg-main)))
    `(cursor ((,class :background ,fg-main)))
-   `(fringe ((,class :background
-                     ,(if modus-operandi-theme-visible-fringes bg-inactive 
bg-main)
+   `(fringe ((,class ,@(modus-operandi-theme-fringe bg-inactive bg-active)
                      :foreground ,fg-main)))
    `(vertical-border ((,class :foreground ,fg-window-divider-inner)))
 ;;;;; basic and/or ungrouped styles
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 91cc562..120fd12 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -45,7 +45,7 @@
 ;;     modus-vivendi-theme-rainbow-headings               (boolean)
 ;;     modus-vivendi-theme-section-headings               (boolean)
 ;;     modus-vivendi-theme-scale-headings                 (boolean)
-;;     modus-vivendi-theme-visible-fringes                (boolean)
+;;     modus-vivendi-theme-fringes                        (choice)
 ;;     modus-vivendi-theme-org-blocks                     (choice)
 ;;     modus-vivendi-theme-3d-modeline                    (boolean)
 ;;     modus-vivendi-theme-subtle-diffs                   (boolean)
@@ -501,10 +501,25 @@ For more on the matter, read the documentation of
 `set-face-attribute', specifically the ':height' section."
   :type 'number)
 
+(define-obsolete-variable-alias 'modus-vivendi-theme-visible-fringes
+  'modus-vivendi-theme-fringes "`modus-vivendi-theme' 0.12.0")
+
 (defcustom modus-vivendi-theme-visible-fringes nil
   "Use a visible style for fringes."
   :type 'boolean)
 
+(defcustom modus-vivendi-theme-fringes nil
+  "Define the visibility of fringes.
+
+Nil means the fringes have no background colour.  Option `subtle'
+will apply a greyscale value that is visible yet close to the
+main buffer background colour.  Option `intense' will use a more
+pronounced greyscale value."
+  :type '(choice
+             (const :tag "No visible fringes (default)" nil)
+             (const :tag "Subtle greyscale background" subtle)
+             (const :tag "Intense greyscale background" intense)))
+
 (define-obsolete-variable-alias 'modus-vivendi-theme-distinct-org-blocks
   'modus-vivendi-theme-org-blocks "`modus-vivendi-theme' 0.11.0")
 
@@ -576,6 +591,19 @@ association list)."
   (when modus-vivendi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(defun modus-vivendi-theme-fringe (subtlebg intensebg)
+  "Conditional use of intense colours for matching parentheses.
+NORMALBG should the special palette colour 'bg-paren-match' or
+something similar.  INTENSEBG must be easier to discern next to
+other backgrounds."
+  (cond
+   ((eq modus-vivendi-theme-fringes 'intense)
+    (list :background intensebg))
+   ((eq modus-vivendi-theme-fringes 'subtle)
+    (list :background subtlebg))
+   (t
+    (list :background nil))))
+
 (defun modus-vivendi-theme-paren (normalbg intensebg)
   "Conditional use of intense colours for matching parentheses.
 NORMALBG should the special palette colour 'bg-paren-match' or
@@ -1033,8 +1061,7 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; absolute essentials
    `(default ((,class :background ,bg-main :foreground ,fg-main)))
    `(cursor ((,class :background ,fg-main)))
-   `(fringe ((,class :background
-                     ,(if modus-vivendi-theme-visible-fringes bg-inactive 
bg-main)
+   `(fringe ((,class ,@(modus-vivendi-theme-fringe bg-inactive bg-active)
                      :foreground ,fg-main)))
    `(vertical-border ((,class :foreground ,fg-window-divider-inner)))
 ;;;;; basic and/or ungrouped styles



reply via email to

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