Skip to content

Commit

Permalink
core: defer distro insertion in home buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Sep 12, 2015
1 parent 89443ad commit cd50d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/core-configuration-layer.el
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ directory with a name starting with `+'.")
(defun configuration-layer/sync ()
"Synchronize declared layers in dotfile with spacemacs."
(dotspacemacs|call-func dotspacemacs/layers "Calling dotfile layers...")
(spacemacs-buffer//inject-version)
(spacemacs-buffer//inject-version t)
;; layers
(setq configuration-layer--layers (configuration-layer//declare-layers))
(configuration-layer//configure-layers configuration-layer--layers)
Expand Down
9 changes: 6 additions & 3 deletions core/core-spacemacs-buffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,17 @@ If ALL is non-nil then truly all banners can be selected."
(floor (/ (- width (length title)) 2))) ?\ ))
(insert (format "%s\n\n" title)))))

(defun spacemacs-buffer//inject-version ()
(defun spacemacs-buffer//inject-version (&optional insert-distro)
"Inject the current version of spacemacs in the first line of the
buffer, right justified."
(with-current-buffer (get-buffer-create "*spacemacs*")
(save-excursion
(let* ((maxcol spacemacs-buffer--banner-length)
(injected (format "(%s-%s)"
dotspacemacs-distribution spacemacs-version))
(injected (if insert-distro
(format "(%s-%s)"
dotspacemacs-distribution
spacemacs-version)
(format "(%s)" spacemacs-version)))
(pos (- maxcol (length injected)))
(buffer-read-only nil))
;; reset first line
Expand Down

0 comments on commit cd50d9c

Please sign in to comment.