Files can have the same type (the same extension) and still have different kinds of contents for which I have different preferences. For instance, some text files are in English and some in Swedish, and they need to have the Flyspell dictionary set differently. Mostly, I want auto-fill-mode
to be on, but for some files I always want to have manual control over where line breaks happen. For some files I want visual-line-mode
to be on, but for others I want to truncate-files
. Hence, I find myself issuing commands for this and other configurations every time I edit a file for which my preferences differ from my default settings.
What I would like is to have Emacs save these properties (and possibly others that I specify) on a file basis, and set them automatically when I next open the file, a bit similarly to how save-place-mode
saves the position in each file, and goes to that position the next time the file is opened. I don't want to put any magic file variable lines in the files (because I want them “clean” when others look at the files, perhaps not using Emacs).
I'm fine with implementing this myself, but before I do, I'd like to check: is there already something that I can use to accomplish what I want in a simple way that I haven't found or thought of? I've googled for it but haven't found anything.