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?

vava
  • 24,851
  • 11
  • 64
  • 79

1 Answers1

1

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
  • 43,532
  • 6
  • 101
  • 124
  • 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 May 16 '10 at 02:22