From: Eli Zaretskii Date: Sun, 18 Jul 2021 18:53:22 +0000 (+0300) Subject: Fix documentation of a recent changeset (bug#5003) X-Git-Tag: emacs-28.0.90~1814 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bbce22337c5334544da5d0cee0abad954e42a08c;p=emacs.git Fix documentation of a recent changeset (bug#5003) * lisp/files.el (safe-local-variable-values) (ignored-local-variable-values): Doc fix. (ignored-local-variable-values): Add :version tag. * doc/emacs/custom.texi (Safe File Variables): Mention 'ignored-local-variable-values'. * doc/lispref/variables.texi (File Local Variables): Fix wording. * etc/NEWS: Improve wording of the 'ignored-local-variable-values' entry. --- diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index bd505d27eca..0a417f15d77 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -623,7 +623,7 @@ button. the theme file and asks if you really want to load it. Because loading a Custom theme can execute arbitrary Lisp code, you should only say yes if you know that the theme is safe; in that case, Emacs -offers to remember in the future that the theme is safe (this is done +offers to remember in the future that the theme is safe(this is done by saving the theme file's SHA-256 hash to the variable @code{custom-safe-themes}; if you want to treat all themes as safe, change its value to @code{t}). Themes that come with Emacs (in the @@ -1271,7 +1271,13 @@ confirmation prompt. When Emacs encounters these variable/value pairs subsequently, in the same file or others, it will assume they are safe. + You can also tell Emacs to permanently ignore all the variable/value +pairs in the file, by typing @kbd{i} at the confirmation prompt -- +these pairs will thereafter ignored in this file and in all other +files. + @vindex safe-local-variable-values +@vindex ignored-local-variable-values @cindex risky variable Some variables, such as @code{load-path}, are considered particularly @dfn{risky}: there is seldom any reason to specify them @@ -1283,6 +1289,8 @@ can enter @kbd{!} at the prompt. It applies all the variables, but only marks the non-risky ones as safe for the future. If you really want to record safe values for risky variables, do it directly by customizing @samp{safe-local-variable-values} (@pxref{Easy Customization}). +Similarly, if you want to record values of risky variables that should +be permanently ignored, customize @code{ignored-local-variable-values}. @vindex enable-local-variables The variable @code{enable-local-variables} allows you to change the diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 541b53fd357..f2307c8aa72 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1996,13 +1996,16 @@ file. @end defopt @defopt ignored-local-variable-values -If there are some local variables that you always want to always -ignore, this variable can be used. It uses the same syntax as -@code{safe-local-variable-values}, but the variable/value pairs here -will always be ignored when handling local variables. As with that -variable, when Emacs queries the user about whether to obey a -file-local variable, the user can choose to ignore them permanently, -and that will alter this variable and save it to the user's custom file. +If there are some values of particular local variables that you always +want to ignore completely, you can this variable. Its value has the +same form as @code{safe-local-variable-values}; a file-local variable +setting to the value that appears in the list will always be ignored +when processing the local variables specified by the file. As with +that variable, when Emacs queries the user about whether to obey a +file-local variable, you can choose to ignore their particular values +permanently, and that will alter this variable and save it to the +user's custom file. Variable-value pairs that appear in this variable +take precedence over the same pairs in @code{safe-local-variable-values}. @end defopt @defun safe-local-variable-p sym val diff --git a/etc/NEWS b/etc/NEWS index 611df3ae397..29568e7fd5c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2225,8 +2225,8 @@ This command, called interactively, toggles the local value of +++ *** New user option 'ignored-local-variable-values'. This is the opposite of 'safe-local-variable-values' -- it's an alist -of local variables (and accompanying values) that are to be ignored -when reading a local variable section from a file. +of variable-value pairs that are to be ignored when reading a +local-variables section of a file. --- *** 'indent-tabs-mode' is now a global minor mode instead of just a variable. diff --git a/lisp/files.el b/lisp/files.el index ce4521b8e6f..59077cd266a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3435,7 +3435,7 @@ Major modes can use this to examine user-specified local variables in order to initialize other data structure based on them.") (defcustom safe-local-variable-values nil - "List variable-value pairs that are considered safe. + "List of variable-value pairs that are considered safe. Each element is a cons cell (VAR . VAL), where VAR is a variable symbol and VAL is a value that is considered safe. @@ -3445,14 +3445,16 @@ Also see `ignored-local-variable-values'." :type 'alist) (defcustom ignored-local-variable-values nil - "List variable-value pairs that will be ignored. + "List of variable-value pairs that should always be ignored. Each element is a cons cell (VAR . VAL), where VAR is a variable -symbol and VAL is a value that will be ignored. +symbol and VAL is its value; if VAR is set to VAL by a file-local +variables section, that setting should be ignored. Also see `safe-local-variable-values'." :risky t :group 'find-file - :type 'alist) + :type 'alist + :version "28.1") (defcustom safe-local-eval-forms ;; This should be here at least as long as Emacs supports write-file-hooks.