Questions tagged [file-local-variables]

File local variables are set automatically from -*-specifications-*- or "Local Variables:" specifications when visiting a buffer. These specifications are included in the file itself and therefore only affect this file (hence "file local variables").

Filter by
Sorted by
Tagged with
15
votes
2answers
2k views

Key bindings specific to a buffer

Is it possible to set key bindings specific to buffer? I have the following in one of my org files: # Local Variables: # eval: (local-set-key (kbd "<f10>") 'some-custom-defun-specific-to-this-...
9
votes
1answer
216 views

How comment out a variable line in a local variable list

In a python file I have # Local Variables: # python-shell-interpreter: "python3" # python-shell-virtualenv-path: "~/.virtualenvs/datascience" # leo-python-args-to-send: "-f fqanalysis.txt" # End: ...
4
votes
2answers
321 views

File-local variable to force specific shell for shell-script major mode

I'm having the same problem as asked in this question: emacs is dropping into shell-script mode, but for the wrong shell variant. Using a shebang as suggested in that question's answer is ...
11
votes
3answers
1k views

Prevent org-mode from swallowing file-local variables

It is sometimes convenient to define file local variables with comments such as the following, which must be at the end of a file. # Local Variables: # fill-column: 80 # End: However, in org-mode ...
1
vote
1answer
219 views

How to save speck-mode dictionary with file?

What I tried, putting at the end of a file: Local IspellDict: de As local variable: speck-dictionary: de However, neither is interpreted. When I open the file in question, speck-mode always uses en ...
2
votes
1answer
229 views

Mode local variables

I frequently use file-local variables, but after writing some minor modes I find the need to implement mode-based behavior. Let's say I want to define a variable errors-list-regexp that varies ...