I have some customization in my .dir-locals.el
. Some of variables set there are unsafe and when I set them and visit some file in dir
for the first time Emacs nicely asks me to save their name-value pairs for future use in the current session.
There is a bit different story when variable is also considered as risky, then Emacs do not offer the choice to safe them for the future use and asks for the permission every time I visit any file in dir
.
I've read that it is actually desirable Emacs behavior but it's a bit impractical to me.
I want to set up some variables for my project, put .dir-locals.el
on git and let others in my team use my customizatins.
Mentioned documentation claims:
Emacs always queries before setting a risky variable, unless the user explicitly allows a value by customizing safe-local-variable-values directly.
What I've tried is:
((clojure-mode
. ((eval . (add-to-list 'safe-local-variable-values
'(projectile-test-suffix-function (lambda (_) ""))))
(projectile-test-suffix-function
. (lambda (_) "")))))
And it has no effect - it still asks for permission every time I visiting a file in dir
.
What I'm doing wrong?
M-x report-emacs-bug
asking to be prompted to save the value as being safe, just like we do for other variables.