tags:

views:

57

answers:

1

According to the Emacs documentation, Directory Variables apply to all files below a directory that contains an .dir-locals.el file.

How can I, in that file, set a variable to the full path that contains the file? For example:

((nil . ((indent-tabs-mode . t)
          (my-project-path **THIS_DIRECTORY**))))
A: 

I think (file-name-directory (or load-file-name buffer-file-name)) should give you the directory path.

See http://xahlee.org/emacs/elisp_idioms_batch.html

slu
Yeah, but ... as far as I know, emacs doesn't actually evaluate the forms in .dir-locals; instead, it merely reads them, and assigns values to the named variables ... and the values have to be constants. I hope I'm wrong, but I suspect there's no way to do i.
offby1