Don't use autoloaded functions for safe-local-variable
* doc/lispref/symbols.texi (Standard Properties): Clarify how safe-local-variable should look. * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words) (checkdoc-symbol-words): Use list-of-strings-p. (checkdoc-list-of-strings-p): Obsolete. * lisp/vc/vc-git.el (vc-git-annotate-switches): Remove. (vc-git-annotate-switches): Open-code the check.
This commit is contained in:
parent
7d39453fd6
commit
7be7ad279e
3 changed files with 13 additions and 17 deletions
|
@ -613,7 +613,10 @@ file-local evaluation forms. @xref{File Local Variables}.
|
|||
|
||||
@item safe-local-variable
|
||||
The value specifies a function for determining safe file-local values
|
||||
for the named variable. @xref{File Local Variables}.
|
||||
for the named variable. @xref{File Local Variables}. Since this
|
||||
value is consulted when loading files, the function should be
|
||||
efficient and should ideally not lead to loading any libraries to
|
||||
determine the safeness (e.g., it should not be an autoloaded function).
|
||||
|
||||
@item side-effect-free
|
||||
@cindex @code{side-effect-free} property
|
||||
|
|
|
@ -250,7 +250,7 @@ with these words enabled."
|
|||
(defvar checkdoc-ispell-lisp-words
|
||||
'("alist" "emacs" "etags" "keymap" "paren" "regexp" "sexp")
|
||||
"List of words that are correct when spell-checking Lisp documentation.")
|
||||
;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'checkdoc-list-of-strings-p)
|
||||
;;;###autoload(put 'checkdoc-ispell-list-words 'safe-local-variable #'list-of-strings-p)
|
||||
|
||||
(defcustom checkdoc-max-keyref-before-warn nil
|
||||
"If non-nil, number of \\\\=[command-to-keystroke] tokens allowed in a doc string.
|
||||
|
@ -320,7 +320,7 @@ These words are ignored when unquoted symbols are searched for.
|
|||
This should be set in an Emacs Lisp file's local variables."
|
||||
:type '(repeat (string :tag "Word"))
|
||||
:version "28.1")
|
||||
;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'checkdoc-list-of-strings-p)
|
||||
;;;###autoload(put 'checkdoc-symbol-words 'safe-local-variable #'list-of-strings-p)
|
||||
|
||||
(defcustom checkdoc-column-zero-backslash-before-paren t
|
||||
"Non-nil means to warn if there is no \"\\\" before \"(\" in column zero.
|
||||
|
@ -360,9 +360,9 @@ large number of libraries means it is impractical to fix all
|
|||
of these warnings masse. In almost any other case, setting
|
||||
this to anything but t is likely to be counter-productive.")
|
||||
|
||||
;;;###autoload
|
||||
(defun checkdoc-list-of-strings-p (obj)
|
||||
"Return t when OBJ is a list of strings."
|
||||
(declare (obsolete list-of-strings-p "29.1"))
|
||||
;; this is a function so it might be shared by checkdoc-proper-noun-list
|
||||
;; and/or checkdoc-ispell-lisp-words in the future
|
||||
(and (listp obj)
|
||||
|
|
|
@ -119,18 +119,6 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
|
|||
(repeat :tag "Argument List" :value ("") string))
|
||||
:version "23.1")
|
||||
|
||||
;; We put the entire function into the autoload file so that we don't
|
||||
;; have to load a whole bunch of vc.*el files just to see whether the
|
||||
;; file-local variable is safe.
|
||||
;;;###autoload
|
||||
(progn
|
||||
(defun vc-git-annotate-switches-safe-p (switches)
|
||||
"Check if local value of `vc-git-annotate-switches' is safe.
|
||||
Currently only \"-w\" (ignore whitespace) is considered safe, but
|
||||
this list might be extended in the future."
|
||||
;; TODO: Probably most options are perfectly safe.
|
||||
(equal switches "-w")))
|
||||
|
||||
(defcustom vc-git-annotate-switches nil
|
||||
"String or list of strings specifying switches for Git blame under VC.
|
||||
If nil, use the value of `vc-annotate-switches'. If t, use no switches."
|
||||
|
@ -139,7 +127,12 @@ If nil, use the value of `vc-annotate-switches'. If t, use no switches."
|
|||
(string :tag "Argument String")
|
||||
(repeat :tag "Argument List" :value ("") string))
|
||||
:version "25.1")
|
||||
;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable #'vc-git-annotate-switches-safe-p)
|
||||
|
||||
;; Check if local value of `vc-git-annotate-switches' is safe.
|
||||
;; Currently only "-w" (ignore whitespace) is considered safe, but
|
||||
;; this list might be extended in the future (probably most options
|
||||
;; are perfectly safe.)
|
||||
;;;###autoload(put 'vc-git-annotate-switches 'safe-local-variable (lambda (switches) (equal switches "-w")))
|
||||
|
||||
(defcustom vc-git-log-switches nil
|
||||
"String or list of strings specifying switches for Git log under VC."
|
||||
|
|
Loading…
Add table
Reference in a new issue