From 06f49cf6dbc6882b1c95b1473b5fbb85f55ff8fd Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:18:04 -0400 Subject: [PATCH] Defer toolbar setup --- early-init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/early-init.el b/early-init.el index 471d5c0..bc054f0 100644 --- a/early-init.el +++ b/early-init.el @@ -235,6 +235,14 @@ (unless (memq window-system '(mac ns)) (setq menu-bar-mode nil))) +(unless noninteractive + ;; Temporarily override the tool-bar-setup function to prevent it from + ;; running during the initial stages of startup + (advice-add #'tool-bar-setup :override #'ignore) + (define-advice startup--load-user-init-file + (:before (&rest _) minimal-emacs-setup-toolbar) + (advice-remove #'tool-bar-setup #'ignore) + (tool-bar-setup))) (when minimal-emacs-disable-tool-bar (push '(tool-bar-lines . 0) default-frame-alist) (setq tool-bar-mode nil))