Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 285
vava Avatar asked Mar 08 '26 10:03

vava


1 Answers

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.

like image 50
Thomas Avatar answered Mar 11 '26 01:03

Thomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!