2013-11-20 05:30:23 +00:00
|
|
|
;; from jwiegley
|
|
|
|
;; https://github.com/jwiegley/dot-emacs/blob/master/init.el
|
|
|
|
(setq message-log-max 16384)
|
|
|
|
(defconst emacs-start-time (current-time))
|
2012-12-18 05:48:12 +00:00
|
|
|
|
2014-09-07 01:36:53 +00:00
|
|
|
(defvar spacemacs-title-length 116)
|
|
|
|
(defvar loading-text "Loading")
|
|
|
|
(defvar loading-done-text "Ready!")
|
|
|
|
(defvar loading-dots-chunk-count 3)
|
|
|
|
(defvar loading-dots-chunk-size 0)
|
|
|
|
(defvar loading-dots-chunk-size-max 0)
|
|
|
|
(defvar loading-dots-count-max
|
|
|
|
(- spacemacs-title-length (length loading-text) (length loading-done-text)))
|
|
|
|
(defun create-spacemacs-buf ()
|
|
|
|
"Create and initialize the spacemacs startup buffer."
|
|
|
|
(switch-to-buffer (get-buffer-create "*spacemacs*"))
|
|
|
|
(insert-file-contents (concat user-emacs-directory "banner.txt"))
|
|
|
|
(goto-char (point-max))
|
|
|
|
(insert loading-text)
|
|
|
|
(redisplay))
|
2014-09-06 08:52:51 +00:00
|
|
|
(defun append-to-spacemacs-buf (msg)
|
2014-09-07 01:36:53 +00:00
|
|
|
"Append MSG to spacemacs buffer."
|
2014-09-06 08:52:51 +00:00
|
|
|
(with-current-buffer (get-buffer-create "*spacemacs*")
|
|
|
|
(goto-char (point-max))
|
|
|
|
(insert (format "%s\n" msg))))
|
|
|
|
(defun replace-last-line-of-spacemacs-buf (msg)
|
2014-09-07 01:36:53 +00:00
|
|
|
"Replace the last line of the spacemacs buffer with MSG."
|
2014-09-06 08:52:51 +00:00
|
|
|
(with-current-buffer (get-buffer-create "*spacemacs*")
|
|
|
|
(goto-char (point-max))
|
|
|
|
(delete-region (line-beginning-position) (point-max))
|
|
|
|
(insert msg)))
|
2014-09-07 01:36:53 +00:00
|
|
|
(defun loading-animation ()
|
|
|
|
"Display LOADING-TITLE with trailing dots of max length
|
|
|
|
SPACEMACS-TITLE-LENGTH. New loading title is displayed by chunk
|
|
|
|
of size LOADING-DOTS-CHUNK-SIZE-MAX."
|
|
|
|
(setq loading-dots-chunk-size (1+ loading-dots-chunk-size))
|
|
|
|
(setq loading-text (concat loading-text "."))
|
|
|
|
(if (>= loading-dots-chunk-size loading-dots-chunk-size-max)
|
|
|
|
(progn
|
|
|
|
(setq loading-dots-chunk-size 0)
|
|
|
|
(replace-last-line-of-spacemacs-buf loading-text)
|
|
|
|
(redisplay))))
|
2014-09-06 08:52:51 +00:00
|
|
|
|
2014-09-02 04:23:43 +00:00
|
|
|
(defconst user-home-directory
|
2012-12-18 05:48:12 +00:00
|
|
|
(expand-file-name (concat user-emacs-directory "../"))
|
2014-09-02 04:23:43 +00:00
|
|
|
"User home directory (~/).")
|
|
|
|
(defconst contrib-config-directory
|
|
|
|
(expand-file-name (concat user-emacs-directory "contrib/"))
|
|
|
|
"Contribution layers base directory.")
|
2014-09-03 06:27:14 +00:00
|
|
|
(defconst user-dropbox-directory
|
2014-08-29 03:59:21 +00:00
|
|
|
(expand-file-name (concat user-home-directory "Dropbox/"))
|
|
|
|
"Dropbox directory.")
|
2014-09-01 16:18:34 +00:00
|
|
|
;; if you have a dropbox, then ~/Dropbox/emacs is added to load path
|
|
|
|
(add-to-list 'load-path (concat user-dropbox-directory "emacs/"))
|
2012-12-21 21:06:22 +00:00
|
|
|
|
2014-09-02 04:23:43 +00:00
|
|
|
;; User configuration file for Spacemacs: ~/.spacemacs
|
|
|
|
(load (concat user-home-directory ".spacemacs"))
|
|
|
|
(dotspacemacs/init)
|
|
|
|
|
2014-09-03 06:27:14 +00:00
|
|
|
(load (concat user-emacs-directory "contribsys.el"))
|
2014-09-05 04:09:03 +00:00
|
|
|
(contribsys/declare-layer 'spacemacs)
|
|
|
|
(contribsys/declare-configuration-layers)
|
|
|
|
(contribsys/load-layers)
|
2013-11-26 14:46:27 +00:00
|
|
|
|
2014-09-02 04:23:43 +00:00
|
|
|
;; Last configuration decisions are given to the user who can defined them
|
|
|
|
;; in ~/.spacemacs
|
|
|
|
(dotspacemacs/config)
|
2013-11-26 05:24:50 +00:00
|
|
|
|
2014-09-07 01:33:55 +00:00
|
|
|
(append-to-spacemacs-buf loading-done-text)
|
|
|
|
|
2014-09-03 06:27:14 +00:00
|
|
|
; from jwiegley
|
2013-11-20 05:30:23 +00:00
|
|
|
;; https://github.com/jwiegley/dot-emacs/blob/master/init.el
|
|
|
|
;; Display load times after init.el and after all buffers has been loaded
|
2014-09-07 01:33:55 +00:00
|
|
|
(let ((elapsed (float-time (time-subtract (current-time)
|
|
|
|
emacs-start-time))))
|
|
|
|
(message "Loading %s...done (%.3fs)" load-file-name elapsed))
|
|
|
|
(add-hook 'after-init-hook
|
|
|
|
`(lambda ()
|
|
|
|
(let ((elapsed (float-time
|
|
|
|
(time-subtract (current-time) emacs-start-time))))
|
|
|
|
(message "Loading %s...done (%.3fs) [after-init]"
|
|
|
|
,load-file-name elapsed))) t)
|