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

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

[elpa] externals/modus-operandi-theme a339d41 97/99: New CUSTOM OPTION f


From: Stefan Monnier
Subject: [elpa] externals/modus-operandi-theme a339d41 97/99: New CUSTOM OPTION for intense paren matching
Date: Fri, 31 Jul 2020 09:25:34 -0400 (EDT)

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

    New CUSTOM OPTION for intense paren matching
    
    This should address issue 70:
    https://gitlab.com/protesilaos/modus-themes/-/issues/70
---
 README.org              | 17 +++++++++++++++++
 modus-operandi-theme.el | 20 ++++++++++++++++++--
 modus-vivendi-theme.el  | 20 ++++++++++++++++++--
 3 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 969b1ac..4972a15 100644
--- a/README.org
+++ b/README.org
@@ -570,6 +570,23 @@ that enable =hl-line-mode=, such as =elfeed= and =mu4e=.
 
 The default is to use a more subtle grey.
 
+** Option for intense parenthesis matching (show-paren-mode)
+
+Symbol names:
+
++ =modus-operandi-theme-intense-paren-match=
++ =modus-vivendi-theme-intense-paren-match=
+
+Possible values:
+
+1. =nil= (default)
+2. =t=
+
+Apply a more intense background to the matching parentheses (or
+delimiters).  This affects tools such as the built-in =show-paren-mode= as
+well as the =smartparens= package.  The default is to use a subtle warm
+colour for the background of those overlays.
+
 ** Option for intense standard completions
    :PROPERTIES:
    :CUSTOM_ID: h:5b0b1e66-8287-4f3f-ba14-011c29320a3f
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 87de3c9..575faf4 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -51,6 +51,7 @@
 ;;     modus-operandi-theme-subtle-diffs                   (boolean)
 ;;     modus-operandi-theme-faint-syntax                   (boolean)
 ;;     modus-operandi-theme-intense-hl-line                (boolean)
+;;     modus-operandi-theme-intense-paren-match            (boolean)
 ;;     modus-operandi-theme-intense-standard-completions   (boolean)
 ;;     modus-operandi-theme-override-colors-alist          (alist)
 ;;
@@ -558,6 +559,10 @@ association list)."
   "Use more prominent background for `hl-line-mode'."
   :type 'boolean)
 
+(defcustom modus-operandi-theme-intense-paren-match nil
+  "Use more prominent colour for parenthesis matching."
+  :type 'boolean)
+
 (defcustom modus-operandi-theme-faint-syntax nil
   "Use less saturated colours for code syntax highlighting."
   :type 'boolean)
@@ -571,6 +576,15 @@ association list)."
   (when modus-operandi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(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
+something similar.  INTENSEBG must be easier to discern next to
+other backgrounds."
+  (if modus-operandi-theme-intense-paren-match
+      (list :background intensebg)
+    (list :background normalbg)))
+
 (defun modus-operandi-theme-syntax-foreground (normal faint)
   "Apply foreground value to code syntax.
 NORMAL is the more saturated colour, which should be the default.
@@ -3310,7 +3324,8 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(sh-heredoc ((,class :foreground ,blue-alt)))
    `(sh-quoted-exec ((,class ,@(modus-operandi-theme-bold-weight) :foreground 
,magenta-alt)))
 ;;;;; show-paren-mode
-   `(show-paren-match ((,class :background ,bg-paren-match :foreground 
,fg-main)))
+   `(show-paren-match ((,class ,@(modus-operandi-theme-paren bg-paren-match 
blue-intense-bg)
+                               :foreground ,fg-main)))
    `(show-paren-match-expression ((,class :inherit modus-theme-special-calm)))
    `(show-paren-mismatch ((,class :inherit modus-theme-intense-red)))
 ;;;;; side-notes
@@ -3346,7 +3361,8 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; smartparens
    `(sp-pair-overlay-face ((,class :inherit modus-theme-special-warm)))
    `(sp-show-pair-enclosing ((,class :inherit modus-theme-special-mild)))
-   `(sp-show-pair-match-face ((,class :background ,bg-paren-match :foreground 
,fg-main)))
+   `(sp-show-pair-match-face ((,class ,@(modus-operandi-theme-paren 
bg-paren-match blue-intense-bg)
+                                      :foreground ,fg-main)))
    `(sp-show-pair-mismatch-face ((,class :inherit modus-theme-intense-red)))
    `(sp-wrap-overlay-closing-pair ((,class :inherit sp-pair-overlay-face)))
    `(sp-wrap-overlay-face ((,class :inherit sp-pair-overlay-face)))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 24956e8..0150efd 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -51,6 +51,7 @@
 ;;     modus-vivendi-theme-subtle-diffs                   (boolean)
 ;;     modus-vivendi-theme-faint-syntax                   (boolean)
 ;;     modus-vivendi-theme-intense-hl-line                (boolean)
+;;     modus-vivendi-theme-intense-paren-match            (boolean)
 ;;     modus-vivendi-theme-intense-standard-completions   (boolean)
 ;;     modus-vivendi-theme-override-colors-alist          (alist)
 ;;
@@ -558,6 +559,10 @@ association list)."
   "Use more prominent background for `hl-line-mode'."
   :type 'boolean)
 
+(defcustom modus-vivendi-theme-intense-paren-match nil
+  "Use more prominent colour for parenthesis matching."
+  :type 'boolean)
+
 (defcustom modus-vivendi-theme-faint-syntax nil
   "Use less saturated colours for code syntax highlighting."
   :type 'boolean)
@@ -571,6 +576,15 @@ association list)."
   (when modus-vivendi-theme-bold-constructs
     (list :inherit 'bold)))
 
+(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
+something similar.  INTENSEBG must be easier to discern next to
+other backgrounds."
+  (if modus-vivendi-theme-intense-paren-match
+      (list :background intensebg)
+    (list :background normalbg)))
+
 (defun modus-vivendi-theme-syntax-foreground (normal faint)
   "Apply foreground value to headings.
 NORMAL is the more saturated colour, which should be the default.
@@ -3310,7 +3324,8 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(sh-heredoc ((,class :foreground ,blue-alt)))
    `(sh-quoted-exec ((,class ,@(modus-vivendi-theme-bold-weight) :foreground 
,magenta-alt)))
 ;;;;; show-paren-mode
-   `(show-paren-match ((,class :background ,bg-paren-match :foreground 
,fg-main)))
+   `(show-paren-match ((,class ,@(modus-vivendi-theme-paren bg-paren-match 
blue-intense-bg)
+                               :foreground ,fg-main)))
    `(show-paren-match-expression ((,class :inherit modus-theme-special-calm)))
    `(show-paren-mismatch ((,class :inherit modus-theme-intense-red)))
 ;;;;; side-notes
@@ -3346,7 +3361,8 @@ Also bind `class' to ((class color) (min-colors 89))."
 ;;;;; smartparens
    `(sp-pair-overlay-face ((,class :inherit modus-theme-special-warm)))
    `(sp-show-pair-enclosing ((,class :inherit modus-theme-special-mild)))
-   `(sp-show-pair-match-face ((,class :background ,bg-paren-match :foreground 
,fg-main)))
+   `(sp-show-pair-match-face ((,class ,@(modus-vivendi-theme-paren 
bg-paren-match blue-intense-bg)
+                                      :foreground ,fg-main)))
    `(sp-show-pair-mismatch-face ((,class :inherit modus-theme-intense-red)))
    `(sp-wrap-overlay-closing-pair ((,class :inherit sp-pair-overlay-face)))
    `(sp-wrap-overlay-face ((,class :inherit sp-pair-overlay-face)))



reply via email to

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