I have a specific file which I want to always open with visual-line-mode activated. This file cannot be distinguished from others for which I want visual-line-mode deactivated, either by file name/extension or by its contents. For example, running file(1)
on the file in question will give the same result as it would on lots of my other files.
At the moment, I am using # -*- eval: (visual-line-mode t); -*-
in the first line of the file. This is less than ideal because every time I open the file I need to confirm I want to eval this code. The file should just open in visual-line-mode without asking for
confirmation. What is the best way to achieve this?
A perfect answer would not require me to add anything to my .emacs
and would be applicable to other modes besides visual-line.
!
? Isn't that the solution you are looking for? You would only have to do this once for every new variable(-list) you are setting. You could also set thesafe-local-variable-values
directly, as explained in the 'Safety of File Variables' section of the Emacs manual.(visual-line-mode t)
should have thesafe-function
property. If it has this property no confirmation is needed before evaluation. Report this and maybe they add this property in the next Emacs version.eval
isn't necessary.# -*- visual-line-mode: t -*-
should be sufficient.