[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/alect-themes 3e51c3e 046/269: Add support for configuring
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/alect-themes 3e51c3e 046/269: Add support for configuring faces |
Date: |
Thu, 21 Oct 2021 17:58:46 -0400 (EDT) |
branch: elpa/alect-themes
commit 3e51c3eca4c25d26ae43c2fbdb258ec5a0339b86
Author: Alex Kost <alezost@gmail.com>
Commit: Alex Kost <alezost@gmail.com>
Add support for configuring faces
---
alect-themes.el | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/alect-themes.el b/alect-themes.el
index 7a73413..71751a7 100644
--- a/alect-themes.el
+++ b/alect-themes.el
@@ -86,6 +86,15 @@ values should be in matching order)."
"Options for alect color themes."
:group 'faces)
+(defcustom alect-overriding-faces nil
+ "List of faces that override original themed faces.
+The faces should be in a form accepted by `custom-theme-set-faces'.
+
+Use this variable if you want alect-themes to use non-default
+specifications of faces."
+ :type 'sexp
+ :group 'alect)
+
(defcustom alect-colors
(alect-generate-colors
'(light dark)
@@ -1199,6 +1208,25 @@ static char *gnus-pointer[] = {
(vc-annotate-background ,(gc 'bg-2))
))))
+(defun alect-override-faces (original overriding)
+ "Override faces from ORIGINAL list with faces from OVERRIDING list.
+
+Both ORIGINAL and OVERRIDING are lists of face specifications
+accepted by `custom-theme-set-faces'.
+
+Replace face specifications from ORIGINAL list with the ones from
+OVERRIDING list, add new faces from OVERRIDING list, and return the
+resulting list.
+
+This function is destructive: ORIGINAL list may not stay the same."
+ (mapc (lambda (face)
+ (let ((orig-face (assoc (car face) original)))
+ (and orig-face
+ (setq original (delete orig-face original)))
+ (add-to-list 'original face)))
+ overriding)
+ original)
+
(defmacro alect-create-theme (theme &optional invert)
"Define and provide a color theme THEME.
For INVERT, see `alect-get-color'."
@@ -1206,7 +1234,9 @@ For INVERT, see `alect-get-color'."
(symbol-name theme)
(and invert "-alt"))))
(theme-vals (alect-get-customization theme invert))
- (theme-faces (car theme-vals))
+ (theme-faces (alect-override-faces
+ (car theme-vals)
+ alect-overriding-faces))
(theme-vars (cdr theme-vals)))
;; FIXME is there a way to avoid this?: variables are not set with
;; `custom-theme-set-variables' if they have not been defined yet
- [nongnu] elpa/alect-themes 7b4397a 064/269: Modify `font-lock-warning-face', (continued)
- [nongnu] elpa/alect-themes 7b4397a 064/269: Modify `font-lock-warning-face', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes fa8f779 071/269: Modify `alect-color-level-9' face, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 3677326 049/269: Add support for 2 variants of face specification, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 0a8e941 050/269: Remove redundant parentheses in faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes b0d7687 052/269: Improve the docstring of `alect-overriding-faces', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 6187e8b 058/269: Modify colors for gnus and emms mode-line icons, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 38a5b63 068/269: Add faces for dictem-mode, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes a858dea 061/269: Add description of emacs bug in theming variables, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes ac6c00e 073/269: Add a mention of `utl-load-theme', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes fa7b2e7 084/269: Modify `font-lock-negation-char-face', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 3e51c3e 046/269: Add support for configuring faces,
ELPA Syncer <=
- [nongnu] elpa/alect-themes 38622f2 066/269: Update version (0.3.3), ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 8468caa 069/269: Update version (0.3.4), ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes b1f4696 072/269: Add faces for Info-mode, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes df91f7a 078/269: Add description of height variables, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 3e90d79 076/269: Fix inheritance of `markdown-header-face', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 27f9cb1 082/269: Change type of `alect-inverted-color-regexp', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes d8dd82f 090/269: Update version (0.3.8), ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 411f50d 101/269: Add apropos faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 038f121 102/269: Modify `custom-group-subtitle' face, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes daaf2f4 112/269: Add `mode-line-highlight' face, ELPA Syncer, 2021/10/21