Open jgarte opened 2 years ago
related: https://github.com/conao3/leaf.el/issues/520
Maybe you want this leaf
form
(leaf scheme
:doc "the universe is made of atoms and pairs"
:setq
`((home-sweet-home . ,(getenv "HOME"))
(scheme-program-name . ,(concat home-sweet-home ".guix-profile/bin/guile"))))
but you will get below error.
;;=> Debugger entered--Lisp error: (void-variable home-sweet-home)
;; (concat home-sweet-home ".guix-profile/bin/guile")
cus leaf
(or Elisp) 'know' valiable value at macro expansion phase.
As long as Emacs know the variables during macro expansion, it can evaluate them while expanding the desired S expression.
In other words, you can use setq
before it. Note that if you are want to use byte-compile your config, you need to use eval-when-compile
to tell the Elisp byte compiler about the variables.
(setq home-sweet-home (getenv "HOME"))
(leaf scheme
:doc "the universe is made of atoms and pairs"
:setq
`((scheme-program-name . ,(concat home-sweet-home ".guix-profile/bin/guile"))))
or
(leaf scheme
:doc "the universe is made of atoms and pairs"
:setq
`((scheme-program-name . ,(concat (getenv "HOME") ".guix-profile/bin/guile"))))
@jgarte @conao3 I have observed that Leaf can't handle any list except ones whose car is either "quote" ('()
) or "backquote" ("quasiquote" in Scheme). So my hack is to backquote (or quasiquote) followed by unquote (,
):
(leaf scheme
:doc "the universe is made of atoms and pairs"
:setq
((home-sweet-home . `,(getenv "HOME"))
(scheme-program-name . `,(concat home-sweet-home ".guix-profile/bin/guile"))))
(concat home-sweet-home ".guix-profile/bin/guile")
Are you sure that $HOME
ends with a slash? You ought to use (expand-file-name ".guix-profile/bin/guile" home-sweet-home)
. It would also make it easy to port your config any non-Unix-like (FreeDOS?) operating system.
Hi, I get this error when opening emacs:
I'd like to do something like the following:
This is what macroexpand outputs:
Or
Do you happen to know what is wrong with my code? Why are the values of setq set to nil...? 🦆
What would be the best way to debug this?