branch: externals/modus-themes
commit edd5b668331f4e00dd44bc82e747a8739f2b3b60
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Revert 1b66344 and tweak how modus-themes-with-colors binds display spec
and 'unspecified'
For some reason the macro was no longer working with commit 1b66344
after I restarted Emacs. Will investigate further. This should
nevertheless be the final commit that fixes all known issues with
modus-themes-with-colors.
---
modus-themes.el | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/modus-themes.el b/modus-themes.el
index 131256db74..a1087dd3aa 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -7314,27 +7314,28 @@ whose value is another symbol, which ultimately
resolves to a string or
(if (stringp (cadr color))
(push color named)
(push color semantic)))
- (let ((sorted (seq-uniq
- (nconc (nreverse named) (nreverse semantic))
- (lambda (elt1 elt2)
- (eq (car elt1) (car elt2))))))
- (append '((unspecified 'unspecified)) sorted))))
-
-(defun modus-themes-with-colors-subr (body-function)
- "Do the work of `modus-themes-with-colors' for BODY-FUNCTION."
+ (seq-uniq
+ (nconc (nreverse named) (nreverse semantic))
+ (lambda (elt1 elt2)
+ (eq (car elt1) (car elt2))))))
+
+(defun modus-themes-with-colors-subr (expressions)
+ "Do the work of `modus-themes-with-colors' for EXPRESSIONS."
(condition-case data
- (when-let* ((theme (modus-themes-get-current-theme :no-enable)))
+ (when-let* ((theme (modus-themes-get-current-theme)))
(eval
- `(let* (,@(modus-themes--with-colors-resolve-palette-sort
+ `(let* ((c '((class color) (min-colors 256)))
+ (unspecified 'unspecified)
+ ,@(modus-themes--with-colors-resolve-palette-sort
(modus-themes--get-theme-palette-subr theme
:with-overrides :with-user-palette)))
- (funcall ,body-function))
+ ,@expressions)
:lexical))
(error (message "Error in `modus-themes-with-colors': %s" data))))
(defmacro modus-themes-with-colors (&rest body)
"Evaluate BODY with colors from current palette bound."
(declare (indent 0))
- `(modus-themes-with-colors-subr (lambda () ,@body)))
+ `(modus-themes-with-colors-subr ',body))
;;;; Declare all the Modus themes