Questions tagged [directory-local-variables]

Filter by
Sorted by
Tagged with
7
votes
2answers
978 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 ...
6
votes
1answer
2k 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)) ...
14
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
129 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 ...
0
votes
1answer
128 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 ...