projects
/
~bandali
/
configs
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
205870c
)
emacs: improve init-related messages
author
Amin Bandali
<bandali@gnu.org>
Tue, 3 Sep 2019 16:28:47 +0000
(12:28 -0400)
committer
Amin Bandali
<bandali@gnu.org>
Tue, 3 Sep 2019 16:28:47 +0000
(12:28 -0400)
.emacs.d/init.el
patch
|
blob
|
blame
|
history
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))