summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2016-11-21 16:33:58 -0800
committerFranck Cuny <franck.cuny@gmail.com>2016-11-21 16:33:58 -0800
commitecd3f7acb81d0f87496bdfa20830b7ec29ce99d7 (patch)
tree3bf7476bb6c87fab2c64c44673e20d9eeb9ed9f0
parent[Emacs] Don't hard code string. (diff)
downloademacs.d-ecd3f7acb81d0f87496bdfa20830b7ec29ce99d7.tar.gz
[Emacs] Display how long it takes to load the configuration
Instead of writing a custom function, use the emacs-startup-hook for that.
-rw-r--r--emacs.d/init.el6
-rw-r--r--emacs.d/lib/funcs.el9
2 files changed, 3 insertions, 12 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index 6f6d739..a17df3a 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -1,6 +1,3 @@
-;; when did we start this session ?
-(defconst emacs-start-time (current-time))
-
;; setup packages
(require 'package)
(setq package-user-dir (expand-file-name "var/elpa" user-emacs-directory)
@@ -586,5 +583,4 @@
:mode ("\\.ya?ml\\'" . yaml-mode))
-(fc/load-time emacs-start-time)
-(fc/emacs-is-ready)
+(add-hook 'emacs-startup-hook #'fc/load-time)
diff --git a/emacs.d/lib/funcs.el b/emacs.d/lib/funcs.el
index 18899f6..0714888 100644
--- a/emacs.d/lib/funcs.el
+++ b/emacs.d/lib/funcs.el
@@ -1,9 +1,8 @@
;;; funcs.el --- functions for my own usage
-(defun fc/load-time (emacs-start-time)
+(defun fc/load-time ()
"How long did it take to load the configuration."
- (let ((load-time (float-time (time-subtract (current-time) emacs-start-time))))
- (message (format "Emacs loaded in %.3fs" load-time))))
+ (message "Emacs init time %s" (emacs-init-time)))
(defun fc/system-info ()
"Display system informations"
@@ -14,10 +13,6 @@
system-type
emacs-version))
-(defun fc/emacs-is-ready ()
- "Emacs is ready"
- (message "Emacs is ready."))
-
;; font manipulation
(defun fc/scale-up-or-down-font-size (direction)
"Scale the font. If DIRECTION is positive or zero the font is scaled up,