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

    New custom option for intense standard completions
---
 README.org              | 21 ++++++++++++++++++++
 modus-operandi-theme.el | 51 ++++++++++++++++++++++++++++++++++++++++---------
 modus-vivendi-theme.el  | 51 ++++++++++++++++++++++++++++++++++++++++---------
 3 files changed, 105 insertions(+), 18 deletions(-)

diff --git a/README.org b/README.org
index b8cca80..7d68c84 100644
--- a/README.org
+++ b/README.org
@@ -356,6 +356,27 @@ The default is to use colour-coded backgrounds for 
line-wise highlights.
 which is, nonetheless, more subtle with this option than with its
 default equivalent.
 
+** Option for intense standard completions
+   :PROPERTIES:
+   :CUSTOM_ID: h:5b0b1e66-8287-4f3f-ba14-011c29320a3f
+   :END:
+
++ =modus-operandi-theme-intense-standard-completions=
++ =modus-vivendi-theme-intense-standard-completions=
+
+Display faces for built-in completion frameworks, such as =icomplete=,
+with a combination of background and foreground colours.  This covers
+every completion interface that either is part of the upstream Emacs
+distribution or extends some built-in library.  For example, =orderless=
+is a powerful completion style that can be used with core Emacs.  So it
+also is covered by this customisation option.
+
+With this enabled, Icomplete and others will use similar UI metaphors to
+those of =ivy=, =helm=, =selectrum= (among others).
+
+The default is to only use foreground colour values for the various
+matching characters or items of standard completion tools.
+
 ** Option for proportional fonts in headings
    :PROPERTIES:
    :CUSTOM_ID: h:33023fa6-6482-45d4-9b5e-3c73c945718f
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 9144152..d794a24 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -49,6 +49,7 @@
 ;;     modus-operandi-theme-distinct-org-blocks
 ;;     modus-operandi-theme-3d-modeline
 ;;     modus-operandi-theme-subtle-diffs
+;;     modus-operandi-theme-intense-standard-completions
 ;;     modus-operandi-theme-override-colors-alist
 ;;
 ;; The default scale is as follows (it can be customised as well):
@@ -476,6 +477,10 @@ For more on the matter, read the documentation of
   "Use fewer/dim backgrounds in `diff-mode', `ediff',`magit'."
   :type 'boolean)
 
+(defcustom modus-operandi-theme-intense-standard-completions nil
+  "Use prominent backgrounds for Icomplete, Ido, or similar."
+  :type 'boolean)
+
 ;; Helper functions that are meant to ease the implementation of the
 ;; above customisation options.
 (defun modus-operandi-theme-heading-foreground (subtle rainbow)
@@ -544,6 +549,17 @@ INTENSE-FG should be one of the dedicated foregrounds for 
diffs"
       (list :background subtle-bg :foreground subtle-fg)
     (list :background intense-bg :foreground intense-fg)))
 
+(defun modus-operandi-theme-completions (subtle-fg intense-bg intense-fg)
+  "Combinations for `modus-operandi-theme-intense-standard-completions'.
+
+SUBTLE-FG should be an appropriate accent value.  INTENSE-BG
+should be one of the accented backgrounds.  INTENSE-FG should be
+one of the foreground intended to be combined with the
+aforementioned background."
+  (if modus-operandi-theme-intense-standard-completions
+      (list :background intense-bg :foreground intense-fg)
+    (list :foreground subtle-fg)))
+
 (defun modus-operandi-theme-scale (amount)
   "Scale heading by AMOUNT.
 
@@ -1153,8 +1169,11 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(compilation-warning ((,class (:foreground ,yellow :weight 
,modus-theme-bold))))
    ;;;; completions
    `(completions-annotations ((,class (:foreground ,fg-special-cold :slant 
,modus-theme-slant))))
-   `(completions-common-part ((,class (:foreground ,cyan-alt-other))))
-   `(completions-first-difference ((,class (:foreground ,blue-alt-other 
:weight bold))))
+   `(completions-common-part ((,class (,@(modus-operandi-theme-completions
+                                        cyan-alt-other green-refine-bg 
green-refine-fg)))))
+   `(completions-first-difference ((,class (,@(modus-operandi-theme-completions
+                                               blue-alt-other blue-intense-bg 
fg-main)
+                                            :weight bold))))
    ;;;; counsel
    `(counsel-active-mode ((,class (:foreground ,magenta-alt-other))))
    `(counsel-application-name ((,class (:foreground ,red-alt-other))))
@@ -2010,14 +2029,20 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(hyperlist-tag ((,class (:foreground ,red))))
    `(hyperlist-toplevel ((,class (:foreground ,fg-main :weight bold))))
    ;;;; icomplete
-   `(icomplete-first-match ((,class (:foreground ,magenta :weight bold))))
+   `(icomplete-first-match ((,class (,@(modus-operandi-theme-completions
+                                        magenta magenta-intense-bg fg-main)
+                                      :weight bold))))
    ;;;; icomplete-vertical
    `(icomplete-vertical-separator ((,class (:foreground ,fg-alt))))
    ;;;; ido-mode
-   `(ido-first-match ((,class (:foreground ,magenta :weight bold))))
+   `(ido-first-match ((,class (,@(modus-operandi-theme-completions
+                                  magenta magenta-subtle-bg fg-main)
+                               :weight bold))))
    `(ido-incomplete-regexp ((,class (:inherit error))))
    `(ido-indicator ((,class (:inherit modus-theme-subtle-yellow))))
-   `(ido-only-match ((,class (:foreground ,magenta-intense :weight bold))))
+   `(ido-only-match ((,class (,@(modus-operandi-theme-completions
+                                 magenta-intense magenta-intense-bg fg-main)
+                              :weight bold))))
    `(ido-subdir ((,class (:foreground ,blue-alt-other))))
    `(ido-virtual ((,class (:foreground ,yellow-alt-other))))
    ;;;; iedit
@@ -2518,10 +2543,18 @@ Also bind `class' to ((class color) (min-colors 89))."
    ;;;; num3-mode
    `(num3-face-even ((,class (:background ,bg-alt :weight bold))))
    ;;;; orderless
-   `(orderless-match-face-0 ((,class (:foreground ,blue-alt :weight bold))))
-   `(orderless-match-face-1 ((,class (:foreground ,magenta-alt :weight bold))))
-   `(orderless-match-face-2 ((,class (:foreground ,green-alt-other :weight 
bold))))
-   `(orderless-match-face-3 ((,class (:foreground ,yellow-alt-other :weight 
bold))))
+   `(orderless-match-face-0 ((,class (,@(modus-operandi-theme-completions
+                                         blue-alt blue-refine-bg 
blue-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-1 ((,class (,@(modus-operandi-theme-completions
+                                         magenta-alt magenta-refine-bg 
magenta-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-2 ((,class (,@(modus-operandi-theme-completions
+                                         green-alt-other green-refine-bg 
green-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-3 ((,class (,@(modus-operandi-theme-completions
+                                         yellow-alt-other yellow-refine-bg 
yellow-refine-fg)
+                                      :weight bold))))
    ;;;; org
    `(org-agenda-calendar-event ((,class (:foreground ,blue-alt))))
    `(org-agenda-calendar-sexp ((,class (:foreground ,cyan-alt))))
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index eae1207..5117efd 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -49,6 +49,7 @@
 ;;     modus-vivendi-theme-distinct-org-blocks
 ;;     modus-vivendi-theme-3d-modeline
 ;;     modus-vivendi-theme-subtle-diffs
+;;     modus-vivendi-theme-intense-standard-completions
 ;;     modus-vivendi-theme-override-colors-alist
 ;;
 ;; The default scale is as follows (it can be customised as well):
@@ -476,6 +477,10 @@ For more on the matter, read the documentation of
   "Use fewer/dim backgrounds in `diff-mode', `ediff',`magit'."
   :type 'boolean)
 
+(defcustom modus-vivendi-theme-intense-standard-completions nil
+  "Use prominent backgrounds for Icomplete, Ido, or similar."
+  :type 'boolean)
+
 ;; Helper functions that are meant to ease the implementation of the
 ;; above customisation options.
 (defun modus-vivendi-theme-heading-foreground (subtle rainbow)
@@ -544,6 +549,17 @@ INTENSE-FG should be one of the dedicated foregrounds for 
diffs"
       (list :background subtle-bg :foreground subtle-fg)
     (list :background intense-bg :foreground intense-fg)))
 
+(defun modus-vivendi-theme-completions (subtle-fg intense-bg intense-fg)
+  "Combinations for `modus-vivendi-theme-intense-standard-completions'.
+
+SUBTLE-FG should be an appropriate accent value.  INTENSE-BG
+should be one of the accented backgrounds.  INTENSE-FG should be
+one of the foreground intended to be combined with the
+aforementioned background."
+  (if modus-vivendi-theme-intense-standard-completions
+      (list :background intense-bg :foreground intense-fg)
+    (list :foreground subtle-fg)))
+
 (defun modus-vivendi-theme-scale (amount)
   "Scale heading by AMOUNT.
 
@@ -1153,8 +1169,11 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(compilation-warning ((,class (:foreground ,yellow :weight 
,modus-theme-bold))))
    ;;;; completions
    `(completions-annotations ((,class (:foreground ,fg-special-cold :slant 
,modus-theme-slant))))
-   `(completions-common-part ((,class (:foreground ,cyan-alt-other))))
-   `(completions-first-difference ((,class (:foreground ,blue-alt-other 
:weight bold))))
+   `(completions-common-part ((,class (,@(modus-vivendi-theme-completions
+                                        cyan-alt-other green-refine-bg 
green-refine-fg)))))
+   `(completions-first-difference ((,class (,@(modus-vivendi-theme-completions
+                                               blue-alt-other blue-intense-bg 
fg-main)
+                                            :weight bold))))
    ;;;; counsel
    `(counsel-active-mode ((,class (:foreground ,magenta-alt-other))))
    `(counsel-application-name ((,class (:foreground ,red-alt-other))))
@@ -2010,14 +2029,20 @@ Also bind `class' to ((class color) (min-colors 89))."
    `(hyperlist-tag ((,class (:foreground ,red))))
    `(hyperlist-toplevel ((,class (:foreground ,fg-main :weight bold))))
    ;;;; icomplete
-   `(icomplete-first-match ((,class (:foreground ,magenta :weight bold))))
+   `(icomplete-first-match ((,class (,@(modus-vivendi-theme-completions
+                                        magenta magenta-intense-bg fg-main)
+                                     :weight bold))))
    ;;;; icomplete-vertical
    `(icomplete-vertical-separator ((,class (:foreground ,fg-alt))))
    ;;;; ido-mode
-   `(ido-first-match ((,class (:foreground ,magenta :weight bold))))
+   `(ido-first-match ((,class (,@(modus-vivendi-theme-completions
+                                  magenta magenta-subtle-bg fg-main)
+                               :weight bold))))
    `(ido-incomplete-regexp ((,class (:inherit error))))
    `(ido-indicator ((,class (:inherit modus-theme-subtle-yellow))))
-   `(ido-only-match ((,class (:foreground ,magenta-intense :weight bold))))
+   `(ido-only-match ((,class (,@(modus-vivendi-theme-completions
+                                 magenta-intense magenta-intense-bg fg-main)
+                              :weight bold))))
    `(ido-subdir ((,class (:foreground ,blue-alt-other))))
    `(ido-virtual ((,class (:foreground ,yellow-alt-other))))
    ;;;; iedit
@@ -2518,10 +2543,18 @@ Also bind `class' to ((class color) (min-colors 89))."
    ;;;; num3-mode
    `(num3-face-even ((,class (:background ,bg-alt :weight bold))))
    ;;;; orderless
-   `(orderless-match-face-0 ((,class (:foreground ,blue-alt :weight bold))))
-   `(orderless-match-face-1 ((,class (:foreground ,magenta-alt :weight bold))))
-   `(orderless-match-face-2 ((,class (:foreground ,green-alt-other :weight 
bold))))
-   `(orderless-match-face-3 ((,class (:foreground ,yellow-alt-other :weight 
bold))))
+   `(orderless-match-face-0 ((,class (,@(modus-vivendi-theme-completions
+                                         blue-alt blue-refine-bg 
blue-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-1 ((,class (,@(modus-vivendi-theme-completions
+                                         magenta-alt magenta-refine-bg 
magenta-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-2 ((,class (,@(modus-vivendi-theme-completions
+                                         green-alt-other green-refine-bg 
green-refine-fg)
+                                      :weight bold))))
+   `(orderless-match-face-3 ((,class (,@(modus-vivendi-theme-completions
+                                         yellow-alt-other yellow-refine-bg 
yellow-refine-fg)
+                                      :weight bold))))
    ;;;; org
    `(org-agenda-calendar-event ((,class (:foreground ,blue-alt))))
    `(org-agenda-calendar-sexp ((,class (:foreground ,cyan-alt))))

Reply via email to