From 32dc7f9bc1ee63629f45e58870b66de4e091bcde Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Fri, 30 Dec 2022 18:04:24 +0200 Subject: [PATCH] Deprecate modus-themes-region; use overrides This is the last user option that we need to deprecate for the release of version 4. Now all colour-related changes happen through palette overrides. Thanks to Christian Tietze for reminding me about it: . --- doc/modus-themes.org | 71 +++------------------------- modus-operandi-deuteranopia-theme.el | 4 +- modus-operandi-theme.el | 4 +- modus-operandi-tinted-theme.el | 2 +- modus-themes.el | 54 +-------------------- modus-vivendi-deuteranopia-theme.el | 4 +- modus-vivendi-theme.el | 4 +- modus-vivendi-tinted-theme.el | 2 +- 8 files changed, 18 insertions(+), 127 deletions(-) diff --git a/doc/modus-themes.org b/doc/modus-themes.org index c52a76b..ad19803 100644 --- a/doc/modus-themes.org +++ b/doc/modus-themes.org @@ -307,8 +307,7 @@ This is how a basic setup could look like: ;; Add all your customizations prior to loading the themes. (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) ;; Load the theme of your choice. (load-theme 'modus-operandi) @@ -325,8 +324,7 @@ This is how a basic setup could look like: ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) ;; Load the theme of your choice. (load-theme 'modus-operandi :no-confim) @@ -355,8 +353,7 @@ package configurations in their setup. We use this as an example: :init ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) :config ;; Load the theme of your choice. (load-theme 'modus-operandi) @@ -370,8 +367,7 @@ package configurations in their setup. We use this as an example: :init ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) :config ;; Load the theme of your choice. (load-theme 'modus-operandi :no-confim) @@ -384,8 +380,7 @@ The same without ~use-package~: ;;; For the built-in themes which cannot use `require': ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) ;; Load the theme of your choice: (load-theme 'modus-operandi) ;; OR (load-theme 'modus-vivendi) @@ -399,8 +394,7 @@ The same without ~use-package~: ;; Add all your customizations prior to loading the themes (setq modus-themes-italic-constructs t - modus-themes-bold-constructs nil - modus-themes-region '(bg-only no-extend)) + modus-themes-bold-constructs nil) ;; Load the theme of your choice: (load-theme 'modus-operandi :no-confim) ;; OR (load-theme 'modus-vivendi :no-confim) @@ -506,11 +500,6 @@ reloaded for changes to take effect. '((matches . (extrabold)) (selection . (semibold italic text-also))) - ;; Options for `modus-themes-region' are either nil (the default), - ;; or a list of properties that may include any of those symbols: - ;; `no-extend', `bg-only'. - modus-themes-region '(bg-only no-extend) - modus-themes-org-blocks 'gray-background ; {nil,'gray-background,'tinted-background} ;; The `modus-themes-headings' is an alist: read the manual's @@ -792,54 +781,6 @@ Is the same as: [[#h:d959f789-0517-4636-8780-18123f936f91][Make completion matches more or less colorful]]. -** Option for active region -:properties: -:alt_title: Active region -:description: Choose between various styles for the active region -:custom_id: h:60798063-b4ad-45ea-b9a7-ff7b5c0ab74c -:end: -#+vindex: modus-themes-region - -[ Simplified as part of {{{development-version}}}. It no longer - accepts an =accented= symbol. Changes to colors can be implemented - via the overrides. ] - -Brief: Control the style of the region. - -Symbol: ~modus-themes-region~ (=choice= type, list of properties) - -Possible values are expressed as a list of properties (default is ~nil~ or -an empty list). The list can include any of the following symbols: - -+ ~no-extend~ -+ ~bg-only~ - -The default (a ~nil~ value or an empty list) is a prominent gray -background that overrides all foreground colors in the area it -encompasses. Its reach extends to the edge of the window. - -The ~no-extend~ property limits the region to the end of the line, so that -it does not reach the edge of the window. - -The ~bg-only~ property makes the region's background color more subtle to -allow the underlying text to retain its foreground colors. - -Combinations of any of those properties are expressed as a list, like in -these examples: - -#+begin_src emacs-lisp -(no-extend) -(bg-only no-extend) -#+end_src - -The order in which the properties are set is not significant. - -In user configuration files the form may look like this: - -#+begin_src emacs-lisp -(setq modus-themes-region '(bg-only no-extend)) -#+end_src - ** Option for org-mode block styles :properties: :alt_title: Org mode blocks diff --git a/modus-operandi-deuteranopia-theme.el b/modus-operandi-deuteranopia-theme.el index 5003012..0dd35d3 100644 --- a/modus-operandi-deuteranopia-theme.el +++ b/modus-operandi-deuteranopia-theme.el @@ -158,8 +158,8 @@ standard).") (bg-hover "#97dfed") (bg-hover-secondary "#f5d0a0") (bg-hl-line "#d0d6ec") - (bg-region "#bcbcbc") - (bg-region-subtle "#f0e0cc") + (bg-region "#bdbdbd") + (fg-region "#000000") (bg-char-0 "#7feaff") (bg-char-1 "#ffaaff") diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el index 220e2bd..7fe06a6 100644 --- a/modus-operandi-theme.el +++ b/modus-operandi-theme.el @@ -156,8 +156,8 @@ which corresponds to a minimum contrast in relative luminance of (bg-hover "#94d4ff") (bg-hover-secondary "#f5d0a0") (bg-hl-line "#d0d6ec") - (bg-region "#bcbcbc") - (bg-region-subtle "#f0e0cc") + (bg-region "#bdbdbd") + (fg-region "#000000") (bg-char-0 "#7feaff") (bg-char-1 "#ffaaff") diff --git a/modus-operandi-tinted-theme.el b/modus-operandi-tinted-theme.el index d8449b6..e081411 100644 --- a/modus-operandi-tinted-theme.el +++ b/modus-operandi-tinted-theme.el @@ -156,7 +156,7 @@ which corresponds to a minimum contrast in relative luminance of (bg-hover-secondary "#f5d0a0") (bg-hl-line "#f1d5d0") (bg-region "#c2bcb5") - (bg-region-subtle "#d9f2c0") + (fg-region "#000000") (bg-char-0 "#7feaff") (bg-char-1 "#ffaaff") diff --git a/modus-themes.el b/modus-themes.el index a85801b..052afe8 100644 --- a/modus-themes.el +++ b/modus-themes.el @@ -732,43 +732,7 @@ In user configuration files the form may look like this: (make-obsolete-variable 'modus-themes-paren-match nil "4.0.0") (make-obsolete-variable 'modus-themes-syntax nil "4.0.0") (make-obsolete-variable 'modus-themes-links nil "4.0.0") - -(defcustom modus-themes-region nil - "Control the overall style of the active region. - -The value is a list of properties, each designated by a symbol. -The default (a nil value or an empty list) is a prominent gray -background that overrides all foreground colors in the area it -encompasses. Its reach extends to the edge of the window. - -The `no-extend' property limits the region to the end of the -line, so that it does not reach the edge of the window. - -The `bg-only' property makes the region's background color more -subtle to allow the underlying text to retain its foreground -colors. - -Combinations of properties are expressed as a list, like in these -examples: - - (no-extend) - (bg-only no-extend) - -The order in which the properties are set is not significant. - -In user configuration files the form may look like this: - - (setq modus-themes-region (quote (bg-only no-extend)))" - :group 'modus-themes - :package-version '(modus-themes . "4.0.0") - :version "30.1" - :type '(set :tag "Properties" :greedy t - (const :tag "Do not extend to the edge of the window" no-extend) - (const :tag "Background only (preserve underlying colors)" bg-only)) - :set #'modus-themes--set-option - :initialize #'custom-initialize-default - :link '(info-link "(modus-themes) Active region")) - +(make-obsolete-variable 'modus-themes-region nil "4.0.0") (make-obsolete-variable 'modus-themes-deuteranopia nil "4.0.0") (make-obsolete-variable 'modus-themes-mail-citations nil "4.0.0") (make-obsolete-variable 'modus-themes-tabs-accented nil "4.0.0") @@ -1409,20 +1373,6 @@ FG and BG are the main colors." :weight (if (and weight (null bold)) weight 'unspecified)))) -(defun modus-themes--region (bg fg bgsubtle) - "Apply `modus-themes-region' styles. - -BG and FG are the main values that are used by default. BGSUBTLE -is a less intense variant of BG." - (let* ((properties (modus-themes--list-or-warn 'modus-themes-region)) - (bg-only (memq 'bg-only properties))) - (list :background - (if bg-only bgsubtle bg) - :foreground - (if bg-only 'unspecified fg) - :extend - (if (memq 'no-extend properties) nil t)))) - ;;;; Face specifications @@ -1563,7 +1513,7 @@ is a less intense variant of BG." `(pgtk-im-0 ((,c :inherit modus-themes-intense-cyan))) `(read-multiple-choice-face ((,c :inherit (bold modus-themes-mark-alt)))) `(rectangle-preview ((,c :inherit secondary-selection))) - `(region ((,c ,@(modus-themes--region bg-region fg-main bg-region-subtle)))) + `(region ((,c :background ,bg-region :foreground ,fg-region))) `(secondary-selection ((,c :background ,bg-hover-secondary))) `(separator-line ((,c :underline ,bg-active))) `(shadow ((,c :foreground ,fg-dim))) diff --git a/modus-vivendi-deuteranopia-theme.el b/modus-vivendi-deuteranopia-theme.el index 7180d7c..f3fed82 100644 --- a/modus-vivendi-deuteranopia-theme.el +++ b/modus-vivendi-deuteranopia-theme.el @@ -157,8 +157,8 @@ standard).") (bg-hover "#004f70") (bg-hover-secondary "#654a39") (bg-hl-line "#2f3849") - (bg-region "#5c5c5c") - (bg-region-subtle "#4f1c2f") + (bg-region "#5a5a5a") + (fg-region "#ffffff") (bg-char-0 "#0050af") (bg-char-1 "#7f1f7f") diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el index be4605f..accdc8b 100644 --- a/modus-vivendi-theme.el +++ b/modus-vivendi-theme.el @@ -155,8 +155,8 @@ which corresponds to a minimum contrast in relative luminance of (bg-hover "#004f70") (bg-hover-secondary "#654a39") (bg-hl-line "#2f3849") - (bg-region "#5c5c5c") - (bg-region-subtle "#4f1c2f") + (bg-region "#5a5a5a") + (fg-region "#ffffff") (bg-char-0 "#0050af") (bg-char-1 "#7f1f7f") diff --git a/modus-vivendi-tinted-theme.el b/modus-vivendi-tinted-theme.el index f1689e2..ae4a66c 100644 --- a/modus-vivendi-tinted-theme.el +++ b/modus-vivendi-tinted-theme.el @@ -150,7 +150,7 @@ which corresponds to a minimum contrast in relative luminance of (bg-hover-secondary "#654a39") (bg-hl-line "#303a6f") (bg-region "#555a66") - (bg-region-subtle "#0f4f30") + (fg-region "#ffffff") (bg-char-0 "#0050af") (bg-char-1 "#7f1f7f")