Concatenating strings in muse-project-alist
I want to make my muse directory more flexible, so I save the muse base directory path in a variable, like this:
(setq my-muse-base-dir "d:/project/notes")
(setq muse-project-alist
`(
("Home"
((concat my-muse-base-dir "/muse/home")
;; ("d:/project/notes/muse/home"
:default "index开发者_如何学Python")
(:base "html" :path (concat my-muse-base-dir "/html/home")))
;; (:base "html" :path "d:/project/notes/html/home"))
))
But when I enter muse mode, it reports error as
let: Wrong type argument: stringp, (concat my-muse-base-dir "/muse/home")
And after I change the directory setting to the full paths, as shown by commented lines, the error is gone. So I'd like to know how to set directory of muse project as concatenating of two strings?
You're missing a ,
in your backquote expression:
(setq muse-project-alist
`(
("Home"
(,(concat my-muse-base-dir "/muse/home")
:default "index")
(:base "html" :path ,(concat my-muse-base-dir "/html/home")))
))
See the ,
s right before the calls to concat
.
The comma tells backquote to evaluate the following expression. Read the backquote info page for more details.
精彩评论