[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/autothemer 9e27fbeae5 17/21: Find unused palette entries i
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/autothemer 9e27fbeae5 17/21: Find unused palette entries in generated themes, and fix the FIXME (#12) |
Date: |
Thu, 6 Jan 2022 02:58:10 -0500 (EST) |
branch: elpa/autothemer
commit 9e27fbeae525249aafe2cd8a37aaedf65d3bfde1
Author: Török Edwin <edwintorok@users.noreply.github.com>
Commit: Jason Milkins <jasonm23@users.noreply.github.com>
Find unused palette entries in generated themes, and fix the FIXME (#12)
* Fix warning about use of free variable 'defined-colors-as-structs`
If a theme uses lexical binding then there would be a warning that
`defined-colors-as-structs` is a free variable.
Suppress it the same way the other temporary symbols are suppressed.
Signed-off-by: Edwin Török <edwin@etorok.net>
* Find unused palette entries in generated themes
Emit `autothemer--current-theme` code only once when n=0 and not
byte-compiled.
On a theme using lexical scope this raises byte compiler warnings
when `palette` entries are defined, but not used in either `reserved-specs`
or `body`.
This breaks `autothemer-generate-templates` when loading a byte-compiled
theme, however the default with `load-theme` is to load the `.el` file
even if `.elc` is present, so this won't affect the majority of users.
Because we emit `body` only when `n=0` emit an `ignore` when `n>0` to
avoid spurious warnings.
This commit is best reviewed by ignoring whitespace changes.
Signed-off-by: Edwin Török <edwin@etorok.net>
---
autothemer.el | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/autothemer.el b/autothemer.el
index 9c359096c5..c15fb960f3 100644
--- a/autothemer.el
+++ b/autothemer.el
@@ -65,6 +65,7 @@ bindings within both the REDUCED-SPECS and the BODY."
(temp-colorname (make-symbol "colorname")))
(setq face-customizer
`(let ((,face-specs)
+ (,temp-color-structs)
(,temp-defined-colors))
(deftheme ,name ,description)
,@(cl-loop for n from 0 to (1- n-displays)
@@ -72,22 +73,21 @@ bindings within both the REDUCED-SPECS and the BODY."
`(let* ,(autothemer--extract-let-block full-palette n)
,@(when (and body (eq n 0))
body)
- ;; FIXME: instead of emitting this code for all n,
- ;; and including a runtime check for n = 0, the when
- ;; clause below should only be emitted for n = 0 in
- ;; the first place
- (when ,(eq n 0)
- (setq ,temp-defined-colors
- (list ,@(--map (list 'list `',it it)
color-names)))
- (setq ,temp-color-structs
- (cl-loop for (,temp-colorname ,temp-color)
- in ,temp-defined-colors
- collect (make-autothemer--color
:name ,temp-colorname
-
:value ,temp-color)))
- (setq autothemer--current-theme
- (make-autothemer--theme
- :colors ,temp-color-structs
- :defined-faces ',face-names)))
+ ,(when (> n 0)
+ `(ignore ,@color-names))
+ ,(when (and (eq n 0) (not (bound-and-true-p
byte-compile-current-file)))
+ `(progn
+ (setq ,temp-defined-colors
+ (list ,@(--map (list 'list `',it it)
color-names)))
+ (setq ,temp-color-structs
+ (cl-loop for (,temp-colorname
,temp-color)
+ in ,temp-defined-colors
+ collect
(make-autothemer--color :name ,temp-colorname
+
:value ,temp-color)))
+ (setq autothemer--current-theme
+ (make-autothemer--theme
+ :colors ,temp-color-structs
+ :defined-faces ',face-names))))
(setq ,face-specs
(autothemer--append-column
,face-specs
- [nongnu] elpa/autothemer 13d1eafc04 14/21: Bump package version to 0.2.2, (continued)
- [nongnu] elpa/autothemer 13d1eafc04 14/21: Bump package version to 0.2.2, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer d2f0fa1d92 16/21: Rework and flesh-out the README documentation (#9), ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 69488c71df 18/21: Do not require autothemer or dash at runtime. (#13), ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 36f1f4f0c7 21/21: Bump version to 0.2.3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 8b865c39a2 08/21: Add readme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 0fdabd22e0 11/21: Fix bug in autothemer-generate-templates, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 8ec0c27a73 19/21: Add color palette export/re-use example, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer b318488f1e 02/21: Allow different face specs for different terminals, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 523a0994e5 07/21: Rename defautotheme to deftheme, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 8c467f5757 15/21: Merge pull request #8 from jasonm23/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 9e27fbeae5 17/21: Find unused palette entries in generated themes, and fix the FIXME (#12),
ELPA Syncer <=
- [nongnu] elpa/autothemer 2e96759b13 20/21: Add license header with GPLv3, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer f1ca2b43a7 06/21: Add brief description, ELPA Syncer, 2022/01/06
- [nongnu] elpa/autothemer 4f3ce16225 12/21: Create LICENSE, ELPA Syncer, 2022/01/06