0

I'm using org-crypt, and I wanted to automatically disable autosave for that particular buffer. Following the suggestion in the documentation, I put the following line at the top of my org file:

# -*- buffer-auto-save-file-name: nil; -*-

And it works. But now I'm being prompted to confirm that I want to apply the local variable, with a warning that the local variable is risky.

Is there any way I can "advise" or "override" this for this particular variable (preferably for just this file)?

1 Answer 1

0

Took me a while to figure it out, but you can mark particular values for a variable as safe.

You can set the option using the handy menu (Options->Customize Emacs->Specific-Option and search for safe-local-variable-values) and use the handy dialog to do it.

Or you can add something like this to your emacs initialization file:

(add-to-list 'safe-local-variable-values
             'buffer-auto-safe-file-name))
3
  • ... or you can answer ! when it prompts you.
    – NickD
    Sep 29, 2022 at 15:53
  • Pretty sure I tried that and it told me "wrong answer"
    – Jacob Lee
    Oct 1, 2022 at 0:07
  • It's always worked for me - try again perhaps?
    – NickD
    Oct 1, 2022 at 1:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.