From a5e156581517d93b837f59992de8a8568582f8a9 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 14 Sep 2022 17:53:41 +0200 Subject: [PATCH] Speed up Emacs build by autoloading vc-git-annotate-switches-safe-p * lisp/vc/vc-git.el (vc-git-annotate-switches-safe-p): Put the definition into the loaddefs file. --- lisp/vc/vc-git.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 8d8ea33f8b3..b1025ed7149 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -119,13 +119,17 @@ 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 -(defun vc-git-annotate-switches-safe-p (switches) - "Check if local value of `vc-git-annotate-switches' is safe. +(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")) + ;; 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. -- 2.39.2