[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/alect-themes b511c45 119/269: Add support for ignoring fac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/alect-themes b511c45 119/269: Add support for ignoring faces and variables |
Date: |
Thu, 21 Oct 2021 17:59:02 -0400 (EDT) |
branch: elpa/alect-themes
commit b511c45831220ed20ec2eeff3e24aaae21bdbf44
Author: Alex Kost <alezost@gmail.com>
Commit: Alex Kost <alezost@gmail.com>
Add support for ignoring faces and variables
---
alect-themes.el | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 50 insertions(+), 2 deletions(-)
diff --git a/alect-themes.el b/alect-themes.el
index 3e5409a..ab1df0b 100644
--- a/alect-themes.el
+++ b/alect-themes.el
@@ -1484,6 +1484,52 @@ This function is destructive: ORIGINAL list may not stay
the same."
overriding)
original)
+(defcustom alect-ignored-faces nil
+ "List of faces that will not be themed.
+
+If nil, an alect theme will change all faces it can.
+
+See Info node `(elisp) Custom Themes' for information about how a
+theme customizes faces and variables."
+ :type '(choice
+ (const :tag "Theme (change) all intended faces" nil)
+ (repeat :tag "Choose ignored faces" face))
+ :group 'alect)
+
+(defcustom alect-ignored-variables nil
+ "List of variables that will not be themed.
+
+If nil, an alect theme will change some variables.
+If t, none of the variables will be modified, only faces are
+themed.
+
+See Info node `(elisp) Custom Themes' for information about how a
+theme customizes faces and variables."
+ :type `(choice
+ (const :tag "Theme (change) all intended variables" nil)
+ (const :tag "Ignore all (do not change any variable)" t)
+ (repeat :tag "Choose ignored variables"
+ (radio
+ ,@(mapcar (lambda (var-def)
+ (list 'variable-item (car var-def)))
+ (cdr (alect-get-customization nil))))))
+ :group 'alect)
+
+(defun alect-delete-objects (original ignored)
+ "Delete IGNORED objects from ORIGINAL list.
+
+Delete all objects from ORIGINAL list whose car is an object from
+IGNORED list and return result.
+
+If IGNORED is nil, return ORIGINAL. If IGNORED is t, return nil.
+
+This function is destructive to ORIGINAL."
+ (cond
+ ((null ignored) original)
+ ((eq t ignored) nil)
+ (t (cl-delete-if (lambda (elt) (memq (car elt) ignored))
+ original))))
+
(defmacro alect-create-theme (theme &optional invert)
"Define and provide a color theme THEME.
For INVERT, see `alect-get-color'."
@@ -1492,10 +1538,12 @@ For INVERT, see `alect-get-color'."
(and invert "-alt"))))
(theme-vals (alect-get-customization theme invert))
(theme-faces (alect-override-faces
- (car theme-vals)
+ (alect-delete-objects
+ (car theme-vals) alect-ignored-faces)
(alect-substitute-colors-in-faces
theme (copy-tree alect-overriding-faces))))
- (theme-vars (cdr theme-vals)))
+ (theme-vars (alect-delete-objects
+ (cdr theme-vals) alect-ignored-variables)))
`(progn
(deftheme ,theme-name ,(format "The %s color theme."
- [nongnu] elpa/alect-themes 9cdda58 059/269: Add support for gnus startup logo, (continued)
- [nongnu] elpa/alect-themes 9cdda58 059/269: Add support for gnus startup logo, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 4c47192 080/269: Add new (process) faces for magit, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 10c35b7 081/269: Improve defcustom of `alect-colors', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 2585c5a 091/269: Modify some cyan colors for the light theme, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes fa08b7c 089/269: Add sauron faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 0528a13 093/269: Ignore "temp" directory, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes d63a03d 094/269: Add support for class of terminals, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 2963de4 110/269: Update version (0.5) and package description, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 3c0f552 125/269: Add faces for company-mode, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 739e258 122/269: Add `google-translate-suggestion-label-face', ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes b511c45 119/269: Add support for ignoring faces and variables,
ELPA Syncer <=
- [nongnu] elpa/alect-themes 2cfa632 129/269: Add `error' face, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 2c18173 155/269: Add auxiliary faces for header-line tabs, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes b9e9da3 159/269: Fix 'gnus-header-from' face, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 6ac9f6a 151/269: Add geiser faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 1b5de07 157/269: Improve guix faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 8812116 156/269: Add support for tabbar-mode, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 5f96e30 142/269: Improve faces for whitespace-mode, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 763c879 161/269: Add 'guix-package-info-heading' face, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes de000ba 150/269: Add some ediff faces, ELPA Syncer, 2021/10/21
- [nongnu] elpa/alect-themes 4c25d22 160/269: Update README for Emacs 24.4, ELPA Syncer, 2021/10/21