-;;; Emacs initialization
-
-(defvar b/before-user-init-time (current-time)
- "Value of `current-time' when Emacs begins loading `user-init-file'.")
-(defvar b/emacs-initialized nil
- "Whether Emacs has been initialized.")
-
-(when (not (bound-and-true-p b/emacs-initialized))
- (message "Loading Emacs...done (%.3fs)"
- (float-time (time-subtract b/before-user-init-time
- before-init-time))))
-
-;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
-;; during startup to reduce garbage collection frequency. clearing
-;; `file-name-handler-alist' seems to help reduce startup time too.
-(defvar b/gc-cons-threshold gc-cons-threshold)
-(defvar b/gc-cons-percentage gc-cons-percentage)
-(defvar b/file-name-handler-alist file-name-handler-alist)
-(setq gc-cons-threshold (* 30 1024 1024) ; 30 MiB
- gc-cons-percentage 0.6
- file-name-handler-alist nil
- ;; sidesteps a bug when profiling with esup
- esup-child-profile-require-level 0)
-
-;; set them back to their defaults once we're done initializing
-(defun b/post-init ()
- "My post-initialize function, run after loading `user-init-file'."
- (setq b/emacs-initialized t
- gc-cons-threshold b/gc-cons-threshold
- gc-cons-percentage b/gc-cons-percentage
- file-name-handler-alist b/file-name-handler-alist)
- (when (featurep 'exwm-workspace)
- (with-eval-after-load 'exwm-workspace
- (setq-default
- mode-line-format
- (append
- mode-line-format
- '((:eval
- (format
- "[%s]" (number-to-string
- exwm-workspace-current-index))))))))
- (when (version< emacs-version "28")
- ;; manually make some mode-line spaces smaller
- ;; (version<= "28" emacs-version) can do an awesome job at this
- ;; out of the box if `mode-line-compact' is set to t (see below)
- (setq-default
- mode-line-format
- (mapcar
- (lambda (x)
- (if (and (stringp x)
- (or (string= x " ")
- (string= x " ")))
- " "
- x))
- mode-line-format)
- mode-line-buffer-identification
- (propertized-buffer-identification "%10b"))))
-(add-hook 'after-init-hook #'b/post-init)
-
-;; increase number of lines kept in *Messages* log
-(setq message-log-max 20000)
-
-\f
-;;; whoami
-