emacs/early-init.el

67 lines
2.2 KiB
EmacsLisp

;;; Early-init --- do all these things early in the init process
;;; Commentary:
;; do the first initial beginning things
;;; Code:
;; blame @chke@emacs.ch if this no worky
(defvar mir/default-gc-thresh gc-cons-threshold)
(defun max-gc-thresh ()
(setq gc-cons-threshold (/ most-positive-fixnum 1000000)))
(max-gc-thresh)
(defun restore-gc-thresh ()
(setq gc-cons-threshold mir/default-gc-thresh))
;(add-hook 'minibuffer-setup-hook #'max-gc-thresh)
;(add-hook 'minibuffer-exit-hook #'restore-gc-thresh)
;(add-hook 'elpaca-after-init-hook #'restore-gc-thresh)
(add-hook 'after-init-hook #'restore-gc-thresh)
;;; (setq gc-cons-percentage 0.5)
;; (run-with-idle-timer 5 t #'garbage-collect)
;(setq garbage-collection-messages t)
;; doesn't quite work
(defun mir/dont-make-obsolete (orig &rest args)
"only run ORIG when its not linum."
;; (message "obsoleting: %s" args)
(if (or (member 'global-linum-mode args)
(member 'linum-mode args))
(message "linum is deprecated but i dont care")
;; (let ((inhibit-message t))
;; (apply orig args))
(apply orig args)))
(advice-add #'make-obsolete :around #'mir/dont-make-obsolete)
(defun display-startup-echo-area-message ()
"A re-definition of the function.
Tell the Emacs startup time and number of garbage-collections
instead of the banal
\"For information about GNU Emacs and the GNU system, type \\[about-emacs].\""
(message "%s, gc ran %s times" (emacs-init-time) gcs-done))
(setq initial-scratch-message (purecopy "\
;; Write some lisp in this buffer and it can be executed, either with
;; \\[eval-last-sexp] locally or \\[eval-buffer] globally.
"))
;; Disable package.el so we can use straight
(setq package-enable-at-startup nil)
(defvar use-package-verbose nil)
(defvar straight-fix-flycheck t)
;; Hide default dashboard
(defvar inhibit-startup-messages t)
(setq inhibit-startup-screen t)
;; Don't pop up error window on native-comp emacs
(defvar native-comp-async-report-warnings-errors 'silent)
;; disable TRAMP because no
(defvar tramp-mode nil)
;; Run stuff after opening a new frame
;; (setq server-after-make-frame-hook (mitch/graphical-setup))
;; (setq before-make-frame-hook (mitch/graphical-setup))
;;; early-init.el ends here