diff --git a/early-init.el b/early-init.el index 5f50d24..033ea69 100644 --- a/early-init.el +++ b/early-init.el @@ -257,13 +257,14 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (unless (daemonp) (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 (fboundp 'tool-bar-setup) + ;; 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))))) (unless (memq 'tool-bar minimal-emacs-ui-features) (push '(tool-bar-lines . 0) default-frame-alist) (setq tool-bar-mode nil))