commit 3b7d18ca04d5c64d67e475449756c258c968cd21 parent df9336726ed19f8cb073b2d01bf0379a0160983d Author: andsy10 <andsy1016@gmail.com> Date: Sun, 2 Aug 2026 04:37:36 +0800 Speedup startup by disabling file-name-handler Diffstat:
| M | early-init.el | | | 10 | ++++++++++ |
| M | init.el | | | 10 | ++++++++++ |
| M | lisp/init-base.el | | | 5 | +++-- |
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el @@ -4,6 +4,16 @@ ;;; Code: +;; from centaur emacs +(if noninteractive + (setq gc-cons-threshold #x8000000 + gc-cons-percentage 1.0) + (setq gc-cons-threshold most-positive-fixnum)) + +;; from centaur emacs +(defvar my--file-name-handler-alist file-name-handler-alist) +(setq file-name-handler-alist nil) + (setq package-enable-at-startup nil) (setq inhibit-startup-screen t) diff --git a/init.el b/init.el @@ -5,6 +5,16 @@ ;;; Code: +;; from centaur emacs +;; restore file-name-hadler-alist +(unless (or (daemonp) noninteractive init-file-debug) + (add-hook 'emacs-startup-hook + (lambda () + (setq file-name-handler-alist + (delete-dups (append file-name-handler-alist + my--file-name-handler-alist)))) + 101)) + (add-to-list 'load-path (expand-file-name (concat user-emacs-directory "lisp"))) diff --git a/lisp/init-base.el b/lisp/init-base.el @@ -20,11 +20,12 @@ ;; garbage collection (use-package gcmh :delight + :hook + (emacs-startup . gcmh-mode) :init (setq gcmh-idle-delay 'auto gcmh-auto-idle-delay-factor 10 - gcmh-high-cons-threshold #x4000000) - (gcmh-mode)) + gcmh-high-cons-threshold #x4000000)) ;; benchmark (use-package benchmark-init