How do I set buffer local variable from Eval: in .dir-local.el?
Asked Answered
G

2

3

Why this works

((nil . ((compilation-directory . "/home/vava/code_directory/")
         (compilation-command . "rake"))
))

and this doesn't?

((nil . ((Eval . (setq compilation-directory "/home/vava/code_directory"))
         (compilation-command . "rake"))
))

What I'm doing wrong here?

I have set enable-local-eval in .emacs.

Grose answered 14/5, 2010 at 12:3 Comment(1)
I'm trying to do a similar thing to you...set some variables dynamically when reading a .dir-local.el: its a shame that it doesn't seem to be possible right now.Armory
J
9

Emacs Lisp is case-sensitive: try lower-case "eval":

((nil . ((eval . (setq compilation-directory "/home/vava/code_directory"))
         (compilation-command . "rake"))))

Also, the name of the file for directory-local variables is .dir-locals.el, not .dir-local.el as in the question headline.

Janelljanella answered 6/12, 2010 at 11:22 Comment(0)
B
-3

Obviously you're assuming that "eval" has the same special meaning in directory-local variables that it does in file-local variables; and yet the documentation doesn't seem to confirm this. So my guess is: you simply can't do it.

Bemuse answered 14/5, 2010 at 13:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.