branch: externals/modus-themes
commit 45140369619e8d223f416024e68a6cd73c14146e
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Expand the CRITICAL FIXME for modus-themes-with-colors with the failed 
macro+function test I did
    
    I tried a few variations of that function, but the point is that I
    cannot make the macro work inside of a function that is evaluated at
    startup in a user's init file. The same function works after I go and
    evaluate it manually.
    
    I stumbled across 'define-inline' while looking around in the Emacs
    source code, but I am not sure this is what I need... Will need to
    test further.
---
 modus-themes.el | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/modus-themes.el b/modus-themes.el
index 82ffd5cb83..0d07e1a374 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -7336,6 +7336,30 @@ Consult the manual for details on how to build a theme 
on top of the
 ;;
 ;; - Have a function that does the actual work of binding the palette and 
evaluating BODY.
 ;; - Make the macro simply set up the function to evaluate BODY.
+;;
+;; HOWEVER, doing the following leads to excessive lisp nesting errors
+;; at startup when the `modus-themes-with-colors' is inside of a
+;; function.  If we evaluate the function after the themes are loaded,
+;; then everything works as expected;
+;;
+;;     (defun modus-themes-with-colors-subr (expressions)
+;;       "Do the work of `modus-themes-with-colors' for EXPRESSIONS."
+;;       (when-let* ((theme (modus-themes-get-current-theme))
+;;                   (palette (modus-themes--get-theme-palette-subr theme 
:with-overrides :with-user-palette)))
+;;         (eval
+;;          `(let* ((c '((class color) (min-colors 256)))
+;;                  (palette ',palette)
+;;                  ,@(mapcar
+;;                     (lambda (entry)
+;;                       (let ((name (car entry)))
+;;                         (list name `(modus-themes--retrieve-palette-value 
',name palette))))
+;;                     palette))
+;;             ,@expressions))))
+;;
+;;     (defmacro modus-themes-with-colors (&rest body)
+;;       "Evaluate BODY with colors from current palette bound."
+;;       (declare (indent 0))
+;;       `(modus-themes-with-colors-subr ',body))
 (defmacro modus-themes-with-colors (&rest body)
   "Evaluate BODY with colors from current palette bound."
   (declare (indent 0))

Reply via email to