branch: externals/modus-themes
commit 1b663444fed07f0c622f67c1bdcde2804bc06c1e
Author: Stefan Monnier <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Make modus-themes-with-colors evaluate body as a function
See the discussion on the emacs-devel mailing list:
<https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00114.html>.
---
modus-themes.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modus-themes.el b/modus-themes.el
index 4e71d39191..951116472c 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -7316,21 +7316,21 @@ whose value is another symbol, which ultimately
resolves to a string or
(eq (car elt1) (car elt2))))))
(append '((unspecified 'unspecified)) sorted))))
-(defun modus-themes-with-colors-subr (expressions)
- "Do the work of `modus-themes-with-colors' for EXPRESSIONS."
+(defun modus-themes-with-colors-subr (body-function)
+ "Do the work of `modus-themes-with-colors' for BODY-FUNCTION."
(condition-case data
(when-let* ((theme (modus-themes-get-current-theme)))
(eval
`(let* (,@(modus-themes--with-colors-resolve-palette-sort
(modus-themes--get-theme-palette-subr theme
:with-overrides :with-user-palette)))
- ,@expressions)
+ (funcall ,body-function))
: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 ',body))
+ `(modus-themes-with-colors-subr (lambda () ,@body)))
;;;; Declare all the Modus themes