Subject: bug#57994: 29.0.50; .dir-locals.el

From: Eli Zaretskii <[email-masked]>
Date: Thu, 22 Sep 2022 08:17:32 +0300

tags 57994 notabug
thanks

> From: Richard Stallman <[email-masked]>
> Date: Wed, 21 Sep 2022 23:12:27 -0400
> 
> When I open in Emacs any file in Master, such as `BUGS', `.dir-locals'
> itself, `COPYING', or `src/emacs.c', it asks me to approve the list of local
> variables specified in `.dir-locals'.
> 
> It says that `vc-git-annotate-switches' and
> `diff-add-log-use-relative-names' are unsafe.
> 
> ((nil . ((tab-width . 8)
>          (sentence-end-double-space . t)
>          (fill-column . 70)
> 	 (emacs-lisp-docstring-fill-column . 65)
>          (vc-git-annotate-switches . "-w")
>          (bug-reference-url-format . "https://debbugs.gnu.org/%s")
> 	 (diff-add-log-use-relative-names . t)))

This is not a bug.  These variables were recently added to our
.dir-locals.el, and they have appropriate safe-variable properties
that prevent the prompt -- but only as long as you use a recent enough
build of Emacs.  If you update from Git, but don't rebuild Emacs after
the update, or if you use an older version of Emacs produced not from
the master branch, you will see those prompts.  For those cases where
you don't use a recent-enough build of Emacs, if you don't want to see
these prompts each time you visit some file in the repository, you can
add this to your ~/.emacs init file:

  (put 'diff-add-log-use-relative-names 'safe-local-variable 'booleanp)
  (put 'vc-git-annotate-switches 'safe-local-variable 'stringp)