tags:

views:

58

answers:

1

I'm trying to move all my compilation config (compilation-command and compilation-directory to be exact) to .dir-locals.el file at the top of my project. It is working fine except that I can't find the way to use expand-file-name there and without it I have to use absolute path, which is not really convenient.

So, is there a way (or a dirty hack) to make local directory variables to evaluate values before assigning?

A: 

You can use the eval "variable" to evaluate an arbitrary elisp expression. You will probably want to customize enable-local-eval and/or safe-local-eval-forms so you don't get asked each time.

Nicholas Riley
I've tried to set `compilation-directory` through `Eval:` but it just does not work for some reason. http://stackoverflow.com/questions/2833928/how-do-i-set-buffer-local-variable-from-eval-in-dir-local-el
vava