[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ef-themes 6bf14ecaae 1/4: Add ef-themes-region user opt
From: |
ELPA Syncer |
Subject: |
[elpa] externals/ef-themes 6bf14ecaae 1/4: Add ef-themes-region user option |
Date: |
Thu, 3 Nov 2022 22:57:44 -0400 (EDT) |
branch: externals/ef-themes
commit 6bf14ecaaeca2d4e4f3a6c00e49b6dc9571c3cec
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add ef-themes-region user option
---
README.org | 41 ++++++++++++++++++++++
ef-autumn-theme.el | 3 ++
ef-bio-theme.el | 3 ++
ef-cherie-theme.el | 3 ++
ef-cyprus-theme.el | 3 ++
ef-dark-theme.el | 3 ++
ef-day-theme.el | 3 ++
ef-deuteranopia-dark-theme.el | 3 ++
ef-deuteranopia-light-theme.el | 3 ++
ef-duo-dark-theme.el | 3 ++
ef-duo-light-theme.el | 3 ++
ef-frost-theme.el | 3 ++
ef-light-theme.el | 3 ++
ef-night-theme.el | 3 ++
ef-spring-theme.el | 3 ++
ef-summer-theme.el | 3 ++
ef-themes.el | 80 +++++++++++++++++++++++++++++++++++++++++-
ef-trio-dark-theme.el | 3 ++
ef-trio-light-theme.el | 3 ++
ef-tritanopia-dark-theme.el | 3 ++
ef-tritanopia-light-theme.el | 3 ++
ef-winter-theme.el | 3 ++
22 files changed, 180 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index a9c0517bd7..b1963e8aef 100644
--- a/README.org
+++ b/README.org
@@ -368,6 +368,47 @@ will retain the original aesthetic for that level. For
example:
(t . t))) ; default style for all other levels
#+end_src
+** Style of region highlight
+:PROPERTIES:
+:CUSTOM_ID: h:1d5fa3d8-a769-455a-aac7-5c1b925bb10b
+:END:
+
+[ This user option is part of {{{development-version}}}. ]
+
+#+vindex: ef-themes-region
+The user option ~ef-themes-region~ controls the appearance of the
+~region~ face (the highlighted selection of an area).
+
+The value it accepts is a list of symbols.
+
+If ~nil~ or an empty list (the default), use a subtle background for
+the region and preserve the color of selected text.
+
+The ~no-extend~ symbol limits the highlighted area to the end of the
+line, so that it does not reach the edge of the window.
+
+The ~neutral~ symbol makes the highlighted area's background gray (or
+more gray, depending on the theme).
+
+The ~intense~ symbol amplifies the intensity of the highlighted area's
+background color. It also overrides any text color to keep it
+legible.
+
+Combinations of those symbols are expressed in any order.
+
+In user configuration files the form may look like this:
+
+#+begin_src emacs-lisp
+(setq modus-themes-region '(intense no-extend))
+#+end_src
+
+Other examples:
+
+#+begin_src emacs-lisp
+(setq modus-themes-region '(intense))
+(setq modus-themes-region '(intense no-extend neutral))
+#+end_src
+
* Loading a theme
:PROPERTIES:
:CUSTOM_ID: h:75d74aea-d17f-497f-a3b8-f0bf4c372de0
diff --git a/ef-autumn-theme.el b/ef-autumn-theme.el
index bd1ac9f1fb..8c8b88a60a 100644
--- a/ef-autumn-theme.el
+++ b/ef-autumn-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#4f4400")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-bio-theme.el b/ef-bio-theme.el
index d79de33045..e172d1da70 100644
--- a/ef-bio-theme.el
+++ b/ef-bio-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#0f5450")
+
;; Mappings
(err red)
(warning yellow-cooler)
diff --git a/ef-cherie-theme.el b/ef-cherie-theme.el
index 088dc1ee17..dcc3198f0c 100644
--- a/ef-cherie-theme.el
+++ b/ef-cherie-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#3f3460")
+
;; Mappings
(err red-warmer)
(warning yellow-warmer)
diff --git a/ef-cyprus-theme.el b/ef-cyprus-theme.el
index b10da96b3a..83d9aaaf39 100644
--- a/ef-cyprus-theme.el
+++ b/ef-cyprus-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af5f")
+ ;; Conditional hues
+ (bg-region-intense "#dcd09f")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-dark-theme.el b/ef-dark-theme.el
index 13ba89c439..0775bc112c 100644
--- a/ef-dark-theme.el
+++ b/ef-dark-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#3a3465")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-day-theme.el b/ef-day-theme.el
index cf69ecefa1..50f8d0f9a9 100644
--- a/ef-day-theme.el
+++ b/ef-day-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#dfc39a")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-deuteranopia-dark-theme.el b/ef-deuteranopia-dark-theme.el
index 0f8402a257..1695b9547d 100644
--- a/ef-deuteranopia-dark-theme.el
+++ b/ef-deuteranopia-dark-theme.el
@@ -147,6 +147,9 @@
(underline-warning "#bfaf50")
(underline-info "#22cff2")
+ ;; Conditional hues
+ (bg-region-intense "#1f1f70")
+
;; Mappings
(err yellow-warmer)
(warning yellow)
diff --git a/ef-deuteranopia-light-theme.el b/ef-deuteranopia-light-theme.el
index 8da64e61d2..a0c944f212 100644
--- a/ef-deuteranopia-light-theme.el
+++ b/ef-deuteranopia-light-theme.el
@@ -147,6 +147,9 @@
(underline-warning "#6f3f00")
(underline-info "#025f92")
+ ;; Conditional hues
+ (bg-region-intense "#cfcf9a")
+
;; Mappings
(err yellow-warmer)
(warning yellow)
diff --git a/ef-duo-dark-theme.el b/ef-duo-dark-theme.el
index 15507e6568..1ef3f80bd3 100644
--- a/ef-duo-dark-theme.el
+++ b/ef-duo-dark-theme.el
@@ -147,6 +147,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#1f2f70")
+
;; Mappings
(err red)
(warning yellow)
diff --git a/ef-duo-light-theme.el b/ef-duo-light-theme.el
index 857466c457..7412c42afb 100644
--- a/ef-duo-light-theme.el
+++ b/ef-duo-light-theme.el
@@ -148,6 +148,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#dfc2b0")
+
;; Mappings
(err red)
(warning yellow)
diff --git a/ef-frost-theme.el b/ef-frost-theme.el
index f2bb3ce5e6..b7d9fc3de9 100644
--- a/ef-frost-theme.el
+++ b/ef-frost-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#aadfcc")
+
;; Mappings
(err red)
(warning yellow-cooler)
diff --git a/ef-light-theme.el b/ef-light-theme.el
index 117b7357a8..adf7335c20 100644
--- a/ef-light-theme.el
+++ b/ef-light-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#afdfc0")
+
;; Mappings
(err red-warmer)
(warning yellow-warmer)
diff --git a/ef-night-theme.el b/ef-night-theme.el
index dcbfec121f..285543b237 100644
--- a/ef-night-theme.el
+++ b/ef-night-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#3f2f60")
+
;; Mappings
(err red)
(warning yellow-warmer)
diff --git a/ef-spring-theme.el b/ef-spring-theme.el
index 755b831ef1..521d88c710 100644
--- a/ef-spring-theme.el
+++ b/ef-spring-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#dfb0d0")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-summer-theme.el b/ef-summer-theme.el
index d4106df886..5a5f6d51fc 100644
--- a/ef-summer-theme.el
+++ b/ef-summer-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#caaadf")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-themes.el b/ef-themes.el
index f38beaeff3..c6e5ac17b7 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -256,8 +256,59 @@ ELPA (by Protesilaos))."
:type 'boolean
:link '(info-link "(ef-themes) UI typeface"))
+(defcustom ef-themes-region nil
+ "Control the appearance of the `region' face.
+
+The value is a list of symbols.
+
+If nil or an empty list (the default), use a subtle background
+for the region and preserve the color of selected text.
+
+The `no-extend' symbol limits the highlighted area to the end of
+the line, so that it does not reach the edge of the window.
+
+The `neutral' symbol makes the highlighted area's background
+gray (or more gray, depending on the theme).
+
+The `intense' symbol amplifies the intensity of the highlighted
+area's background color. It also overrides any text color to
+keep it legible.
+
+Combinations of those symbols are expressed in any order.
+
+In user configuration files the form may look like this:
+
+ (setq modus-themes-region \\='(intense no-extend))
+
+Other examples:
+
+ (setq modus-themes-region \\='(intense))
+ (setq modus-themes-region \\='(intense no-extend neutral))"
+ :group 'ef-themes
+ :package-version '(ef-themes . "0.10.0")
+ :type '(set :tag "Properties" :greedy t
+ (const :tag "Do not extend to the edge of the window" no-extend)
+ (const :tag "More neutral/gray background" neutral)
+ (const :tag "More intense background (also override text color)"
accented))
+ :link '(info-link "(ef-themes) Style of region highlight"))
+
;;; Helpers for user options
+(defun ef-themes--warn (option)
+ "Warn that OPTION has changed."
+ (prog1 nil
+ (display-warning
+ 'ef-themes
+ (format "`%s' has changed; please read the updated documentation" option)
+ :warning)))
+
+(defun ef-themes--list-or-warn (option)
+ "Return list or nil value of OPTION, else `ef-themes--warn'."
+ (let* ((value (symbol-value option)))
+ (if (or (null value) (listp value))
+ value
+ (ef-themes--warn option))))
+
(defun ef-themes--fixed-pitch ()
"Conditional application of `fixed-pitch' inheritance."
(when ef-themes-mixed-fonts
@@ -310,6 +361,33 @@ sequence given SEQ-PRED, using SEQ-DEFAULT as a fallback."
:weight
(or weight 'unspecified))))
+(defun ef-themes--region (bg bgneutral bgintense bgintenseneutral fgintense)
+ "Apply `ef-themes-region' styles.
+
+BG is the default background. BGNEUTRAL is its gray counterpart.
+BGINTENSE is an amplified variant of BG, while BGINTENSENEUTRAL
+is a more intense neutral background. FGINTENSE is the
+foreground that is used with any of the intense backgrounds."
+ (let ((properties (ef-themes--list-or-warn 'ef-themes-region)))
+ (list
+ :background
+ (cond
+ ((and (memq 'intense properties) (memq 'neutral properties))
+ bgintenseneutral)
+ ((memq 'intense properties)
+ bgintense)
+ ((memq 'neutral properties)
+ bgneutral)
+ (bg))
+ :foreground
+ (if (memq 'intense properties)
+ fgintense
+ 'unspecified)
+ :extend
+ (if (memq 'no-extend properties)
+ nil
+ t))))
+
;;; Commands and their helper functions
(defun ef-themes--list-enabled-themes ()
@@ -608,7 +686,7 @@ Helper function for `ef-themes-preview-colors'."
`(cursor ((,c :background ,cursor)))
`(default ((,c :background ,bg-main :foreground ,fg-main)))
`(italic ((,c :slant italic)))
- `(region ((,c :background ,bg-region)))
+ `(region ((,c ,@(ef-themes--region bg-region bg-alt bg-region-intense
bg-active fg-intense))))
`(vertical-border ((,c :foreground ,border)))
;;;;; all other basic faces
`(button ((,c :foreground ,link :underline ,border)))
diff --git a/ef-trio-dark-theme.el b/ef-trio-dark-theme.el
index 81301218f4..ae0b9e63e0 100644
--- a/ef-trio-dark-theme.el
+++ b/ef-trio-dark-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#5d336c")
+
;; Mappings
(err red-warmer)
(warning yellow)
diff --git a/ef-trio-light-theme.el b/ef-trio-light-theme.el
index 85c65dcd3d..3e8e811c08 100644
--- a/ef-trio-light-theme.el
+++ b/ef-trio-light-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#bf5f00")
(underline-info "#02af52")
+ ;; Conditional hues
+ (bg-region-intense "#aacacf")
+
;; Mappings
(err red-warmer)
(warning yellow-warmer)
diff --git a/ef-tritanopia-dark-theme.el b/ef-tritanopia-dark-theme.el
index c591f7cbbc..7116cd991e 100644
--- a/ef-tritanopia-dark-theme.el
+++ b/ef-tritanopia-dark-theme.el
@@ -147,6 +147,9 @@
(underline-warning "#ffafa0")
(underline-info "#22ffd2")
+ ;; Conditional hues
+ (bg-region-intense "#5f303f")
+
;; Mappings
(err red-warmer)
(warning magenta)
diff --git a/ef-tritanopia-light-theme.el b/ef-tritanopia-light-theme.el
index 70e0ed88e9..a95084016b 100644
--- a/ef-tritanopia-light-theme.el
+++ b/ef-tritanopia-light-theme.el
@@ -147,6 +147,9 @@
(underline-warning "#af7f90")
(underline-info "#22afc2")
+ ;; Conditional hues
+ (bg-region-intense "#dfa5a5")
+
;; Mappings
(err red-warmer)
(warning magenta)
diff --git a/ef-winter-theme.el b/ef-winter-theme.el
index a603411b8c..5ef582b8fd 100644
--- a/ef-winter-theme.el
+++ b/ef-winter-theme.el
@@ -144,6 +144,9 @@
(underline-warning "#c0b000")
(underline-info "#22b022")
+ ;; Conditional hues
+ (bg-region-intense "#4f2f5d")
+
;; Mappings
(err red-warmer)
(warning yellow)