[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/modus-vivendi-theme 5b9300f 51/73: Internal: use 'pcase
From: |
Stefan Monnier |
Subject: |
[elpa] externals/modus-vivendi-theme 5b9300f 51/73: Internal: use 'pcase' instead of 'cond' |
Date: |
Wed, 26 Aug 2020 09:21:01 -0400 (EDT) |
branch: externals/modus-vivendi-theme
commit 5b9300f4b4e1011b57c7959cbd0ab651d8b7a5b5
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Internal: use 'pcase' instead of 'cond'
---
modus-operandi-theme.el | 61 ++++++++++++++++++-------------------------------
modus-vivendi-theme.el | 61 ++++++++++++++++++-------------------------------
2 files changed, 44 insertions(+), 78 deletions(-)
diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 0c63981..57a78be 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -645,13 +645,10 @@ effect than the former."
"Conditional use of background colours for fringes.
SUBTLEBG should be a subtle greyscale value. INTENSEBG must be a
more pronounced greyscale colour."
- (cond
- ((eq modus-operandi-theme-fringes 'intense)
- (list :background intensebg))
- ((eq modus-operandi-theme-fringes 'subtle)
- (list :background subtlebg))
- (t
- (list :background nil))))
+ (pcase modus-operandi-theme-fringes
+ ('intense (list :background intensebg))
+ ('subtle (list :background subtlebg))
+ (_ (list :background nil))))
(defun modus-operandi-theme-prompt (mainfg subtlebg subtlefg intensebg
intensefg)
"Conditional use of background colours for prompts.
@@ -659,13 +656,10 @@ MAINFG is the prompt's standard foreground. SUBTLEBG
should be a
subtle accented background that works with SUBTLEFG. INTENSEBG
must be a more pronounced accented colour that should be
combinable with INTENSEFG."
- (cond
- ((eq modus-operandi-theme-prompts 'intense)
- (list :background intensebg :foreground intensefg))
- ((eq modus-operandi-theme-prompts 'subtle)
- (list :background subtlebg :foreground subtlefg))
- (t
- (list :background nil :foreground mainfg))))
+ (pcase modus-operandi-theme-prompts
+ ('intense (list :background intensebg :foreground intensefg))
+ ('subtle (list :background subtlebg :foreground subtlefg))
+ (_ (list :background nil :foreground mainfg))))
(defun modus-operandi-theme-paren (normalbg intensebg)
"Conditional use of intense colours for matching parentheses.
@@ -737,15 +731,11 @@ to `greyscale'.
The latter pair should be more subtle than the background of the
block, as it is used when `modus-operandi-theme-org-blocks' is
set to `rainbow'."
- (cond
- ((eq modus-operandi-theme-org-blocks 'greyscale)
- (append
- (and (>= emacs-major-version 27) '(:extend t))
- (list :background bg :foreground fg)))
- ((eq modus-operandi-theme-org-blocks 'rainbow)
- (list :background bgaccent :foreground fgaccent))
- (t
- (list :background bg :foreground fg))))
+ (pcase modus-operandi-theme-org-blocks
+ ('greyscale (append (and (>= emacs-major-version 27) '(:extend t))
+ (list :background bg :foreground fg)))
+ ('rainbow (list :background bgaccent :foreground fgaccent))
+ (_ (list :background bg :foreground fg))))
(defun modus-operandi-theme-modeline-box (col3d col &optional btn int)
"Control the box properties of the mode line.
@@ -787,13 +777,10 @@ MAINFG is an accented foreground value. SUBTLEBG is an
accented
background value that can be combined with MAINFG. INTENSEBG and
INTENSEFG are accented colours that are designed to be used in
tandem."
- (cond
- ((eq modus-operandi-theme-completions 'opinionated)
- (list :background intensebg :foreground intensefg))
- ((eq modus-operandi-theme-completions 'moderate)
- (list :background subtlebg :foreground mainfg))
- (t
- (list :foreground mainfg))))
+ (pcase modus-operandi-theme-completions
+ ('opinionated (list :background intensebg :foreground intensefg))
+ ('moderate (list :background subtlebg :foreground mainfg))
+ (_ (list :foreground mainfg))))
(defun modus-operandi-theme-extra-completions (subtleface intenseface altface
&optional altfg bold)
"Combinations for `modus-operandi-theme-completions'.
@@ -808,15 +795,11 @@ from the UI's default aesthetics. Optional ALTFG is
meant to be
used in tandem with it.
Optional BOLD will apply a heavier weight to the text."
- (cond
- ((eq modus-operandi-theme-completions 'opinionated)
- (list :inherit (list altface bold) :foreground (if altfg
- altfg
- 'unspecified)))
- ((eq modus-operandi-theme-completions 'moderate)
- (list :inherit (list subtleface bold)))
- (t
- (list :inherit (list intenseface bold)))))
+ (pcase modus-operandi-theme-completions
+ ('opinionated (list :inherit (list altface bold)
+ :foreground (if altfg altfg 'unspecified)))
+ ('moderate (list :inherit (list subtleface bold)))
+ (_ (list :inherit (list intenseface bold)))))
(defun modus-operandi-theme-scale (amount)
"Scale heading by AMOUNT.
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index feee9c9..af077f3 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -645,13 +645,10 @@ effect than the former."
"Conditional use of background colours for fringes.
SUBTLEBG should be a subtle greyscale value. INTENSEBG must be a
more pronounced greyscale colour."
- (cond
- ((eq modus-vivendi-theme-fringes 'intense)
- (list :background intensebg))
- ((eq modus-vivendi-theme-fringes 'subtle)
- (list :background subtlebg))
- (t
- (list :background nil))))
+ (pcase modus-vivendi-theme-fringes
+ ('intense (list :background intensebg))
+ ('subtle (list :background subtlebg))
+ (_ (list :background nil))))
(defun modus-vivendi-theme-prompt (mainfg subtlebg subtlefg intensebg
intensefg)
"Conditional use of background colours for prompts.
@@ -659,13 +656,10 @@ MAINFG is the prompt's standard foreground. SUBTLEBG
should be a
subtle accented background that works with SUBTLEFG. INTENSEBG
must be a more pronounced accented colour that should be
combinable with INTENSEFG."
- (cond
- ((eq modus-vivendi-theme-prompts 'intense)
- (list :background intensebg :foreground intensefg))
- ((eq modus-vivendi-theme-prompts 'subtle)
- (list :background subtlebg :foreground subtlefg))
- (t
- (list :background nil :foreground mainfg))))
+ (pcase modus-vivendi-theme-prompts
+ ('intense (list :background intensebg :foreground intensefg))
+ ('subtle (list :background subtlebg :foreground subtlefg))
+ (_ (list :background nil :foreground mainfg))))
(defun modus-vivendi-theme-paren (normalbg intensebg)
"Conditional use of intense colours for matching parentheses.
@@ -737,15 +731,11 @@ to `greyscale'.
The latter pair should be more subtle than the background of the
block, as it is used when `modus-vivendi-theme-org-blocks' is
set to `rainbow'."
- (cond
- ((eq modus-vivendi-theme-org-blocks 'greyscale)
- (append
- (and (>= emacs-major-version 27) '(:extend t))
- (list :background bg :foreground fg)))
- ((eq modus-vivendi-theme-org-blocks 'rainbow)
- (list :background bgaccent :foreground fgaccent))
- (t
- (list :background bg :foreground fg))))
+ (pcase modus-vivendi-theme-org-blocks
+ ('greyscale (append (and (>= emacs-major-version 27) '(:extend t))
+ (list :background bg :foreground fg)))
+ ('rainbow (list :background bgaccent :foreground fgaccent))
+ (_ (list :background bg :foreground fg))))
(defun modus-vivendi-theme-modeline-box (col3d col &optional btn int)
"Control the box properties of the mode line.
@@ -787,13 +777,10 @@ MAINFG is an accented foreground value. SUBTLEBG is an
accented
background value that can be combined with MAINFG. INTENSEBG and
INTENSEFG are accented colours that are designed to be used in
tandem."
- (cond
- ((eq modus-vivendi-theme-completions 'opinionated)
- (list :background intensebg :foreground intensefg))
- ((eq modus-vivendi-theme-completions 'moderate)
- (list :background subtlebg :foreground mainfg))
- (t
- (list :foreground mainfg))))
+ (pcase modus-vivendi-theme-completions
+ ('opinionated (list :background intensebg :foreground intensefg))
+ ('moderate (list :background subtlebg :foreground mainfg))
+ (_ (list :foreground mainfg))))
(defun modus-vivendi-theme-extra-completions (subtleface intenseface altface
&optional altfg bold)
"Combinations for `modus-vivendi-theme-completions'.
@@ -808,15 +795,11 @@ from the UI's default aesthetics. Optional ALTFG is
meant to be
used in tandem with it.
Optional BOLD will apply a heavier weight to the text."
- (cond
- ((eq modus-vivendi-theme-completions 'opinionated)
- (list :inherit (list altface bold) :foreground (if altfg
- altfg
- 'unspecified)))
- ((eq modus-vivendi-theme-completions 'moderate)
- (list :inherit (list subtleface bold)))
- (t
- (list :inherit (list intenseface bold)))))
+ (pcase modus-vivendi-theme-completions
+ ('opinionated (list :inherit (list altface bold)
+ :foreground (if altfg altfg 'unspecified)))
+ ('moderate (list :inherit (list subtleface bold)))
+ (_ (list :inherit (list intenseface bold)))))
(defun modus-vivendi-theme-scale (amount)
"Scale heading by AMOUNT.
- [elpa] externals/modus-vivendi-theme 1024408 50/73: Refine 'symbol-overlay-default-face', (continued)
- [elpa] externals/modus-vivendi-theme 1024408 50/73: Refine 'symbol-overlay-default-face', Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 6163afe 55/73: Internal: minor documentation update, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme b60deb5 60/73: Tweak magit-section-heading face, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 7ce15e4 65/73: Fix README link to contact page, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 4021bd5 68/73: Improves the note in readme re powerline & spaceline, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 67554a6 72/73: Prepare version 0.12.0, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme d6359d3 49/73: Customise 'rectangle-preview' and reposition faces, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 4561a7e 54/73: Refine mu4e header and replied faces, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 976b05e 52/73: Stop scaling Latex sectioning faces, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 56e53d3 67/73: Reformat CHANGELOG, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 5b9300f 51/73: Internal: use 'pcase' instead of 'cond',
Stefan Monnier <=
- [elpa] externals/modus-vivendi-theme 2cbb287 48/73: Internal: M-x untabify and fix indentation, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 092a999 46/73: Minor correction in the README, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme a2dfc18 56/73: Make org-formula inherit from 'fixed-pitch', Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 1df9e3e 57/73: Adds a note to the readme regarding powerline and spaceline, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 5400cd9 62/73: Refine magit signature faces, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 9ffc67b 63/73: Add link to README HTML version (and minor tweaks), Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme 6a46c56 69/73: Merge branch 'master' into 'master', Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme d39046f 64/73: Fix missing links from commit 9ffc67b8c, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme f94237b 70/73: Minor formatting tweaks in the CHANGELOG, Stefan Monnier, 2020/08/26
- [elpa] externals/modus-vivendi-theme aa11c8b 71/73: Add changelog entry for version 0.12.0, Stefan Monnier, 2020/08/26