projects
/
~bandali
/
configs
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
emacs: improve init-related messages
[~bandali/configs]
/
.emacs.d
/
init.el
diff --git
a/.emacs.d/init.el
b/.emacs.d/init.el
index
bfc9d28
..
6068a1c
100644
(file)
--- a/
.emacs.d/init.el
+++ b/
.emacs.d/init.el
@@
-39,9
+39,13
@@
(defvar b/before-user-init-time (current-time)
"Value of `current-time' when Emacs begins loading `user-init-file'.")
(defvar b/before-user-init-time (current-time)
"Value of `current-time' when Emacs begins loading `user-init-file'.")
-(message "Loading Emacs...done (%.3fs)"
- (float-time (time-subtract b/before-user-init-time
- before-init-time)))
+(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
;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
;; during startup to reduce garbage collection frequency. clearing
@@
-57,8
+61,10
@@
;; set them back to their defaults once we're done initializing
(defun b/post-init ()
;; set them back to their defaults once we're done initializing
(defun b/post-init ()
- (setq gc-cons-threshold b/gc-cons-threshold
- gc-cons-percentage b/gc-cons-percentage
+ "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))
(add-hook 'after-init-hook #'b/post-init)
file-name-handler-alist b/file-name-handler-alist))
(add-hook 'after-init-hook #'b/post-init)
@@
-152,9
+158,10
@@
(expand-file-name "~/.emacs.d/straight/build/")))
(defun b/reload-init ()
(expand-file-name "~/.emacs.d/straight/build/")))
(defun b/reload-init ()
- "Reload
init.el
."
+ "Reload
`user-init-file'
."
(interactive)
(interactive)
- (setq b/file-name-handler-alist file-name-handler-alist)
+ (setq b/before-user-init-time (current-time)
+ b/file-name-handler-alist file-name-handler-alist)
(load user-init-file nil 'nomessage)
(b/post-init))
(load user-init-file nil 'nomessage)
(b/post-init))