summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2019-09-03 12:28:47 -0400
committerAmin Bandali <bandali@gnu.org>2019-09-03 12:28:47 -0400
commit83364e5b9720d28270760dbbe9e69a1a5b24077f (patch)
tree2dfffcafcf514083bb41566e2e543e30f08a3591
parent205870c761859bd71af5cc46fc55f5c3407b57d6 (diff)
downloadconfigs-83364e5b9720d28270760dbbe9e69a1a5b24077f.tar.gz
configs-83364e5b9720d28270760dbbe9e69a1a5b24077f.tar.xz
configs-83364e5b9720d28270760dbbe9e69a1a5b24077f.zip
emacs: improve init-related messages
-rw-r--r--.emacs.d/init.el21
1 files changed, 14 insertions, 7 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index bfc9d28..6068a1c 100644
--- 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'.")
-(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
@@ -57,8 +61,10 @@
;; 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)
@@ -152,9 +158,10 @@
(expand-file-name "~/.emacs.d/straight/build/")))
(defun b/reload-init ()
- "Reload init.el."
+ "Reload `user-init-file'."
(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))