Questions tagged [directory-local-variables]

Filter by
Sorted by
Tagged with
10
votes
1answer
3k views

Calling functions in .dir-locals in Emacs

I'm trying to activate flycheck-mode by default when opening any file in my project's directory. I'm a bit of an elisp newbie, my .dir-locals.el file looks like this: ((nil . (mode . flycheck-mode)) ...
10
votes
2answers
1k views

How to set major mode for a file in .dir-locals.el?

I would like to set the major mode for a file as you would using file-local variables Local Variables: mode: text End: but in .dir-locals.el in order not to “pollute” the file in question. Is this ...
15
votes
2answers
3k views

How can I set directory local variable in relative to .dir-locals.el file location?

I often find myself in the situation where I'm told to put relative paths as directory local variable. For example cmake-ide's cmake-ide-project-dir and cmake-ide-build-dir. Of course this is not very ...
4
votes
1answer
197 views

How to stop auto backup in some directory in Emacs

In general I want Emacs to save a backup file for me, except in some special directories. I tried to define a Directory Local Variables, and add: ((nil . ((make-backup-files . nil)))) But it seem ...
2
votes
1answer
282 views

How to enable auto-revert-mode for files under a certain directory

I have my org files kept synchronized via rsync with various devices. These buffers are usually open in any running emacs instances due to agenda and capture. I want emacs to re-read these files from ...
0
votes
1answer
187 views

Can't get directory local variables to work - Debugger encountered Lisp error

I've tried adding directory variables in several ways and I keep getting the same error. First, I was editing .dir.locals.el, but when that didn't work, I added each variable individually using M-x ...