all repos — nixfiles @ 9e2bdbdb55b5311308250327f812d15c75ffe50c

System and user configuration, managed by nix and home-manager

Emacs: optimise file loading at startup
Alan Pearce alan@alanpearce.eu
Mon, 02 Mar 2020 15:45:13 +0100
commit

9e2bdbdb55b5311308250327f812d15c75ffe50c

parent

a6c3b48a7bac0b52778a39d95f04a5f6d3ac84ba

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M user/emacs/.emacs.d/init.eluser/emacs/.emacs.d/init.el
@@ -7,11 +7,14 @@ package-enable-at-startup nil       evil-want-keybinding nil
       frame-inhibit-implied-resize t)
 
-(let ((default-gc-cons-threshold (* 16 1024 1024)))
+(let ((default-gc-cons-threshold (* 16 1024 1024))
+      (default-file-name-handler-alist file-name-handler-alist))
   (setq gc-cons-threshold most-positive-fixnum
-        gc-cons-percentage 0.6)
+        gc-cons-percentage 0.6
+        file-name-handler-alist nil)
   (add-hook 'minibuffer-setup-hook (lambda () (setq gc-cons-threshold most-positive-fixnum)))
   (add-hook 'minibuffer-exit-hook (lambda () (setq gc-cons-threshold default-gc-cons-threshold)))
+  (add-hook 'emacs-startup-hook (lambda () (setq file-name-handler-alist default-file-name-handler-alist)))
   (add-hook 'after-init-hook (lambda ()
                                (setq gc-cons-threshold default-gc-cons-threshold
                                      gc-cons-percentage 0.1))))