This is more a curiosity, than a necessity.
I'm playing around with startup times, and to have something to compare with, I wanted to see how fast emacs could start up pure.
Running emacs -Q
, emacs-init-time
reported 0.3~ secs on average.
With a blank config, I installed esup (Emacs Start Up Profiler), and the init.el
file became:
(add-to-list 'load-path "~/.emacs.d/packages/esup-0.7")
(require 'esup)
To test it out, I launched emacs normally, and ran esup
.
Huh, look that. vc-git
is loaded.
Curious on how low the start up time can get, I try to disable it.
And so it begins.
To disable VC entirely, set the customizable variable vc-handled-backends to nil https://www.gnu.org/software/emacs/manual/html_node/emacs/Version-Control.html
I insert (setq-default vc-handled-backends nil)
into init.el
Still being loaded.
Perhaps removing the vc entry it from load-path
does the trick.
So I also add (delete "/usr/share/emacs/27.1/lisp/vc" load-path)
to the config.
Still being loaded. Challenge accepted.
I try to add (add-to-list 'load-path "~/.emacs.d/overwrites")
to the newly supported early-init.el
config file, and add a dummy vc-git.el
file into the folder specified, containing just (provide 'vc-git)
Still being loaded. Same if I move the line from early-init.el
to init.el
.
No effect by adding (setq-default load-suffixes '(".el"))
either.
Seeing no other way to prevent it from loading, I try the nuclear option of moving the offending file /usr/share/emacs/27.1/lisp/vc/vc-git.elc
temporarily.
Finally it does not load.
So it is possible.
Now I'm just wondering if it is possible without going nuclear.
For science (and negible reduced startup time)
after-load-functions
to calldebug
-- or just throw(debug)
intovc-git.el
and re-compile -- and you should learn what's causing it.