I am working on a project that includes some configuration in .dir-locals.el:

  . ((compile-command . "cd ../../\; ./build.sh"))))

This gets picked up just fine for me and sets the compile command. A teammate's emacs doesn't seem to recognize the file. .dir-locals.el is present, but doesn't set the compile command (still defaults to make -k).

Evaluating (dir-locals-find-file "Foo.h") in *scratch* returns .../project/src on my system (which is the folder where .dir-locals.el is located), but returns nil for the teammate.

How do I troubleshoot this? Everything I can find in the documentation seems to assume that .dir-locals.el will get picked up if it's present.

  • 1
    Is your teammate using Tramp to edit the code on a remote machine? That's the only case I can think of where .dir-locals.el isn't picked up... Also, are you both running the same Emacs version? – legoscia Mar 6 '15 at 18:51
  • @legoscia: Not familiar with the details of .dir-locals.el functionality, but couldn't access permission of the file come into play? – Meaningful Username Mar 6 '15 at 19:03
  • 1
    .dir-locals.el is part of a svn repository that is checked out on to his machine, so he has local read access to the file – jake Mar 6 '15 at 19:15
  • 1
    He'll need to start with emacs -Q and figure out what's breaking. – Malabarba Mar 7 '15 at 7:55
  • If it doesn't work with -Q, another thing to check is that he's running a sufficiently new version of Emacs. – Tom Tromey Mar 9 '15 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.