From 7be7ad279e96f90cc70e384a350331de8e1607df Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 16 Sep 2022 12:36:15 +0200 Subject: 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. --- lisp/vc/vc-git.el | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'lisp/vc/vc-git.el') diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b1025ed7149..a5d12f03bcf 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -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." -- cgit v1.2.3