emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a5e1565815 1/2: Speed up Emacs build by autoloading vc-git-annota


From: Lars Ingebrigtsen
Subject: master a5e1565815 1/2: Speed up Emacs build by autoloading vc-git-annotate-switches-safe-p
Date: Wed, 14 Sep 2022 11:54:20 -0400 (EDT)

branch: master
commit a5e156581517d93b837f59992de8a8568582f8a9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 8d8ea33f8b..b1025ed714 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]