Improve logging and add mirror logging to message buffer

This commit is contained in:
syl20bnr 2014-09-25 22:14:57 -04:00
parent 28f9395478
commit c6eaf937cc
2 changed files with 19 additions and 9 deletions

View File

@ -118,8 +118,11 @@ extension.
(package-install pkg))
(setq installed-count (1+ installed-count))
(replace-last-line-of-spacemacs-buf
(format "--> installing %s... [%s/%s]"
pkg installed-count not-installed-count))
(format "--> installing %s:%s... [%s/%s]"
(ht-get spacemacs-all-packages pkg)
pkg
installed-count
not-installed-count) t)
(redisplay))
(append-to-spacemacs-buf "\n")))))
@ -133,7 +136,9 @@ extension.
(init-func (intern (format "%s/init-%s" (symbol-name lsym) pkg))))
(loading-animation)
(if (and (package-installed-p pkg) (fboundp init-func))
(funcall init-func))))
(progn (message "(Spacemacs) Initializing %s:%s..."
(symbol-name lsym) pkg)
(funcall init-func)))))
(defun contribsys/initialize-extensions (ext-list)
"Initialize all the declared extensions in EXT-LIST hash table."
@ -146,6 +151,7 @@ extension.
(init-func (intern (format "%s/init-%s" (symbol-name lsym) ext))))
(add-to-list 'load-path (format "%s%s/" ext-dir ext))
(loading-animation)
(message "(Spacemacs) Initializing %s:%s..." (symbol-name lsym) ext)
(if (fboundp init-func) (funcall init-func))))
(defun contribsys/declare-configuration-layers ()

View File

@ -34,20 +34,24 @@
(let ((buffer-read-only nil))
(insert-file-contents (concat spacemacs-core-directory "banner.txt"))))
(defun append-to-spacemacs-buf (msg)
"Append MSG to spacemacs buffer."
(defun append-to-spacemacs-buf (msg &optional messagebuf)
"Append MSG to spacemacs buffer. If MESSAGEBUF is not nil then MSG is
also written in message buffer."
(with-current-buffer (get-buffer-create "*spacemacs*")
(goto-char (point-max))
(let ((buffer-read-only nil))
(insert (format "%s" msg)))))
(insert msg)
(if messagebuf (message "(Spacemacs) %s" msg)))))
(defun replace-last-line-of-spacemacs-buf (msg)
"Replace the last line of the spacemacs buffer with MSG."
(defun replace-last-line-of-spacemacs-buf (msg &optional messagebuf)
"Replace the last line of the spacemacs buffer with MSG. If MESSAGEBUF is
not nil then MSG is also written in message buffer."
(with-current-buffer (get-buffer-create "*spacemacs*")
(goto-char (point-max))
(let ((buffer-read-only nil))
(delete-region (line-beginning-position) (point-max))
(insert msg))))
(insert msg)
(if messagebuf (message "(Spacemacs) %s" msg)))))
(defun loading-animation ()
"Display LOADING-TITLE with trailing dots of max length