Skip to content

Commit

Permalink
spacemacs-buffer: bug fix and improvement
Browse files Browse the repository at this point in the history
- Fixed a bug that when `all-the-icons` is excluded by user, Emacs reports
that using undefined `all-the-icons` functions.
- Changed the `spacemacs-buffer-mode` that now it derives from `special-mode`.
  - Also defined a new command `spacemacs-buffer/return` which binds to `RET`
  key in `spacemacs-buffer-mode`. It opens the button on the current line if
  there's any, or move the cursor to next line.
  • Loading branch information
lebensterben committed Feb 17, 2022
1 parent 3deed8f commit 8262481
Showing 1 changed file with 84 additions and 56 deletions.
140 changes: 84 additions & 56 deletions core/core-spacemacs-buffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.

;;
;;; Commentary:
;;
;;; Code:

(eval-when-compile
(defvar dotspacemacs-distribution)
(defvar dotspacemacs-filepath)
(defvar dotspacemacs-show-startup-list-numbers)
(defvar dotspacemacs-startup-banner)
(defvar dotspacemacs-startup-buffer-show-icons)
(defvar spacemacs-badge-official-png)
(defvar spacemacs-banner-directory)
(defvar spacemacs-banner-official-png)
(defvar spacemacs-cache-directory)
(defvar spacemacs-docs-directory)
(defvar spacemacs-gplv3-official-png)
(defvar spacemacs-info-directory)
(defvar spacemacs-release-notes-directory)
(defvar spacemacs-start-directory)
(defvar spacemacs-version))


(defconst spacemacs-buffer-version-info "0.999"
"Current version used to display addition release information.")

Expand Down Expand Up @@ -71,9 +86,6 @@ Allows to keep track of widgets to delete when removing them.")
"Horizontal position of the home buffer buttons.
Internal use, do not set this variable.")

(defvar spacemacs-buffer-mode-map (make-sparse-keymap)
"Keymap for spacemacs buffer mode.")

(defvar spacemacs-buffer--random-banner nil
"The random banner chosen.")

Expand All @@ -98,8 +110,8 @@ It's cleared when the idle timer runs.")
(defvar spacemacs-buffer--last-width nil
"Previous width of spacemacs-buffer.")

(defun spacemacs-buffer/key-bindings ()
(let ((map spacemacs-buffer-mode-map))
(defvar spacemacs-buffer-mode-map
(let ((map (make-sparse-keymap)))
(when dotspacemacs-show-startup-list-numbers
(define-key map (kbd "0") 'spacemacs-buffer/jump-to-number-startup-list-line)
(define-key map (kbd "1") 'spacemacs-buffer/jump-to-number-startup-list-line)
Expand All @@ -113,7 +125,7 @@ It's cleared when the idle timer runs.")
(define-key map (kbd "9") 'spacemacs-buffer/jump-to-number-startup-list-line))

(define-key map [down-mouse-1] 'widget-button-click)
(define-key map (kbd "RET") 'widget-button-press)
(define-key map (kbd "RET") 'spacemacs-buffer/return)

(define-key map [tab] 'widget-forward)
(define-key map (kbd "J") 'widget-forward)
Expand All @@ -123,26 +135,27 @@ It's cleared when the idle timer runs.")
(define-key map (kbd "K") 'widget-backward)

(define-key map (kbd "C-r") 'spacemacs-buffer/refresh)
(define-key map "q" 'quit-window)))

(add-hook 'emacs-startup-hook 'spacemacs-buffer/key-bindings)
(define-key map "q" 'quit-window)
map)
"Keymap for spacemacs-buffer mode.")

(with-eval-after-load 'evil
(evil-make-overriding-map spacemacs-buffer-mode-map 'motion))
(define-derived-mode spacemacs-buffer-mode special-mode "Spacemacs buffer"
"Spacemacs major mode for startup screen.
(define-derived-mode spacemacs-buffer-mode fundamental-mode "Spacemacs buffer"
"Spacemacs major mode for startup screen."
\\{spacemacs-buffer-mode-map}"
:group 'spacemacs
:syntax-table nil
:abbrev-table nil
(page-break-lines-mode)
(setq buffer-read-only t
truncate-lines t)
;; needed to make tab work correctly in terminal
(evil-define-key 'motion spacemacs-buffer-mode-map
(kbd "C-i") 'widget-forward)
;; motion state since this is a special mode
(evil-set-initial-state 'spacemacs-buffer-mode 'motion))
(buffer-disable-undo)
(page-break-lines-mode +1)
(with-eval-after-load 'evil
(progn
(evil-set-initial-state 'spacemacs-buffer-mode 'motion)
(evil-make-overriding-map spacemacs-buffer-mode-map 'motion)))
(suppress-keymap spacemacs-buffer-mode-map t)
(set-keymap-parent spacemacs-buffer-mode-map nil)
(setq-local buffer-read-only t
truncate-lines t))

(defun spacemacs-buffer//insert-ascii-banner-centered (file)
"Insert the ascii banner contain in file and center it in the window.
Expand Down Expand Up @@ -352,7 +365,8 @@ WIDTH: current external width of the note's frame."
remove the rest of the note, after the variables line number."
(when (and (integerp spacemacs-buffer-note-preview-lines)
(> spacemacs-buffer-note-preview-lines 0))
(goto-line (1+ spacemacs-buffer-note-preview-lines))
(goto-char (point-min))
(forward-line spacemacs-buffer-note-preview-lines)
(let* ((first-removed-line (line-number-at-pos (point)))
(last-removed-line (line-number-at-pos (point-max))))
(setq spacemacs-buffer--note-preview-nr-of-removed-lines
Expand Down Expand Up @@ -591,9 +605,10 @@ ADDITIONAL-WIDGETS: a function for inserting a widget under the frame."
(spacemacs-buffer/toggle-note 'release-note)
;; cursor to beg of first line after preview
(goto-char cursor-pos-before-showing-full-note)
(progn (back-to-indentation)
(previous-line)
(forward-char 3))))
(progn
(back-to-indentation)
(forward-line -1)
(forward-char 3))))
:mouse-face 'highlight
:follow-link "\C-m"))
(spacemacs-buffer//center-line)
Expand Down Expand Up @@ -778,7 +793,7 @@ NO-NEXT-LINE: if nil the cursor is brought under the searched word.
Define a named function: spacemacs-buffer/jump-to-...
for the shortcut. So that a descriptive name is shown,
in for example the view-lossage (C-h l) buffer:
in for example the `view-lossage' (C-h l) buffer:
r ;; spacemacs-buffer/jump-to-recent-files
p ;; spacemacs-buffer/jump-to-projects
instead of:
Expand Down Expand Up @@ -1194,18 +1209,18 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(cl-subseq seq start (and (number-or-marker-p end)
(min len end)))))

(defun spacemacs-buffer//propertize-heading (icon text &optional shortcut-char)
(defun spacemacs-buffer||propertize-heading (icon text shortcut-char)
(concat
(when dotspacemacs-startup-buffer-show-icons
(concat (concat icon " ")))
(when (configuration-layer/package-used-p 'all-the-icons)
(when dotspacemacs-startup-buffer-show-icons
(concat (concat icon " "))))
(propertize text 'face 'font-lock-keyword-face)
(when shortcut-char
(propertize (concat " (" shortcut-char ")")
'face 'font-lock-comment-face))))
(propertize (concat " (" shortcut-char ")")
'face 'font-lock-comment-face)))

(defun spacemacs-buffer//insert-errors ()
(when (spacemacs-buffer//insert-string-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-material "error" :face 'font-lock-keyword-face)
"Errors:" "e")
spacemacs-buffer--errors)
Expand All @@ -1214,7 +1229,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"

(defun spacemacs-buffer//insert-warnings ()
(when (spacemacs-buffer//insert-string-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-material "warning" :face 'font-lock-keyword-face)
"Warnings:" "w")
spacemacs-buffer--warnings)
Expand All @@ -1233,7 +1248,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(setq spacemacs-buffer//recent-files-list
(spacemacs//subseq spacemacs-buffer//recent-files-list 0 list-size))
(when (spacemacs-buffer//insert-file-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "history" :face 'font-lock-keyword-face :v-adjust -0.05)
"Recent Files:" "r")
spacemacs-buffer//recent-files-list)
Expand All @@ -1244,7 +1259,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(unless recentf-mode (recentf-mode))
(unless projectile-mode (projectile-mode))
(when (spacemacs-buffer//insert-files-by-dir-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "rocket" :face 'font-lock-keyword-face :v-adjust -0.05)
"Recent Files by Project:" "R")
(mapcar (lambda (group)
Expand All @@ -1260,7 +1275,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"

(defun spacemacs-buffer//insert-todos (list-size)
(when (spacemacs-buffer//insert-todo-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "check" :face 'font-lock-keyword-face :v-adjust -0.05)
"To-Do:" "d")
(spacemacs//subseq (spacemacs-buffer//todo-list)
Expand All @@ -1270,7 +1285,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"

(defun spacemacs-buffer//insert-agenda (list-size)
(when (spacemacs-buffer//insert-todo-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "calendar" :face 'font-lock-keyword-face :v-adjust -0.05)
"Agenda:" "c")
(spacemacs//subseq (spacemacs-buffer//agenda-list)
Expand All @@ -1283,7 +1298,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(helm-mode))
(require 'bookmark)
(when (spacemacs-buffer//insert-bookmark-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "bookmark" :face 'font-lock-keyword-face :v-adjust -0.05)
"Bookmarks:" "b")
(spacemacs//subseq (bookmark-all-names)
Expand All @@ -1294,7 +1309,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(defun spacemacs-buffer//insert-projects (list-size)
(unless projectile-mode (projectile-mode))
(when (spacemacs-buffer//insert-file-list
(spacemacs-buffer//propertize-heading
(spacemacs-buffer||propertize-heading
(all-the-icons-octicon "rocket" :face 'font-lock-keyword-face :v-adjust -0.05)
"Projects:" "p")
(spacemacs//subseq (projectile-relevant-known-projects)
Expand All @@ -1309,8 +1324,7 @@ SEQ, START and END are the same arguments as for `cl-subseq'"
(setq spacemacs-buffer--startup-list-nr 1)
(let ((dotspacemacs-startup-buffer-show-icons dotspacemacs-startup-buffer-show-icons))
(if (display-graphic-p)
(unless (or (fboundp 'all-the-icons-octicon)
(require 'all-the-icons nil 'noerror))
(unless (configuration-layer/package-used-p 'all-the-icons)
(message "Package `all-the-icons' isn't installed")
(setq dotspacemacs-startup-buffer-show-icons nil))
(setq dotspacemacs-startup-buffer-show-icons nil))
Expand Down Expand Up @@ -1403,25 +1417,23 @@ can be adjusted with the variable:
dotspacemacs-startup-buffer-multi-digit-delay nil
'spacemacs-buffer/stop-waiting-for-additional-numbers))))

(defun spacemacs-buffer//re-line-starts-with-nr-space (nr-string)
(concat "^ +" nr-string "[0-9]* +. "))

(defun spacemacs-buffer/jump-to-line-starting-with-nr-space (nr-string)
"Jump to the line begins with NR-STRING, skipping non-digit prefix."
(let ((prev-point (point)))
(goto-char (window-start))
(if (not (re-search-forward
(spacemacs-buffer//re-line-starts-with-nr-space nr-string)
(concat "^ +" nr-string "[0-9]* +. ")
;; don't search past two lines above the window-end,
;; because they bottom two lines are hidden by the mode line
(save-excursion (goto-char (window-end))
(forward-line -1)
(point))
'noerror))
(progn (goto-char prev-point)
(let (message-log-max) ; only show in minibuffer
(message "Couldn't find startup list number: %s"
spacemacs-buffer--startup-list-number)))
(progn
(goto-char prev-point)
(let (message-log-max) ; only show in minibuffer
(message "Couldn't find startup list number: %s"
spacemacs-buffer--startup-list-number)))
(message "Opening file/dir: %s"
(widget-value (widget-at (point))))
(widget-button-press (point)))))
Expand Down Expand Up @@ -1495,8 +1507,7 @@ If a prefix argument is given, switch to it in an other, possibly new window."
(progn (goto-char (point-min))
(forward-line (1- save-line))
(forward-to-indentation 0))
(spacemacs-buffer/goto-link-line))
(setq-local inhibit-read-only t))
(spacemacs-buffer/goto-link-line)))
(if current-prefix-arg
(switch-to-buffer-other-window spacemacs-buffer-name)
(switch-to-buffer spacemacs-buffer-name))
Expand Down Expand Up @@ -1534,7 +1545,24 @@ If a prefix argument is given, switch to it in an other, possibly new window."
(spacemacs-buffer/goto-buffer t))

(defalias 'spacemacs/home 'spacemacs-buffer/refresh
"Go to home Spacemacs buffer")
"Go to Spacemacs home buffer.")

(defun spacemacs-buffer/return ()
"Open the button or go to next line.
This function is intended to be used in `spacemacs-buffer-mode' only."
(interactive)
(if (get-char-property (point) 'button)
;; point on a button, press it
(widget-button-press (point))
;; point on an entry, press it
(if-let ((button (save-excursion
(beginning-of-line-text)
(re-search-forward "[0-9]* +. " (point-at-eol) 'noerror))))
(widget-button-press button)
;; go to next line
(forward-line)
(beginning-of-line-text))))

(defun spacemacs/home-delete-other-windows ()
"Open home Spacemacs buffer and delete other windows.
Expand Down

21 comments on commit 8262481

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit makes an error.
spacemacs-buffer||propertize-heading: Symbol’s function definition is void: all-the-icons-material

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yssource
What's the value of dotspacemacs-startup-buffer-show-icons, dotspacemacs-base?

And have you added all-the-icons to dotspacemacs-excluded-packages?

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotspacemacs-startup-buffer-show-icons -> Its value is t
dotspacemacs-base -> no such a Describe variable
No, I have not. dotspacemacs-excluded-packages has no value of all-the-icons

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotspacemacs-base -> no such a Describe variable

Sorry, I meant dotspacemacs-distribution.

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its value is ‘spacemacs’

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yssource
In your ~/.emacs.d/elpa/27.2/develop, is there all-the-icons?

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have ./elpa/29.0/develop/all-the-icons-20220117.108

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dotspacemacs-themes '(solarized-light
                         solarized-dark)

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very weird.
Can you set debug-on-error to t and attach the traceback?

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, have you installed all-the-icons fonts. If you haven't, you can do that via M-x all-the-icons-install-fonts.

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message happened while starting the spacemacs, and it stop booting it. I just ctrl-g to cancel the starting process and then use the spacemacs.
Yes, I have installed all-the-icons fonts.
How to debug the problem when starting the spacemacs?

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One way is after you C-g, close the home buffer with SPC b d. Then M-x toggle-debug-on-error, SPC b h.

Another way is emacs --debug-init.

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also note that I'm on Emacs 27 (with no native compilation). So another possibility is native compilation caused this error.

So you can try to delete ~/.emacs.d/core/core-spacemacs-buffer.elc (I assume it's located there but I'm not sure).

If this doesn't work, you may temporarily install Emacs 27 (without removing Emacs 29), and start Emacs as normal.

@yssource
Copy link
Contributor

@yssource yssource commented on 8262481 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, here some of debug logs

(Spacemacs) pcre2el -> post-init (spacemacs-editing)...
(Spacemacs) + Configuring packages...
(Spacemacs) all-the-icons-ivy-rich is disabled.
(Spacemacs) anki-editor is configured in the dotfile.
(Spacemacs) auctex-latexmk is disabled.
(Spacemacs) auto-highlight-symbol -> pre-init (ivy)...
(Spacemacs) sicp is configured in the dotfile.
(Spacemacs) solarized-theme is configured in the dotfile.
(Spacemacs) spaceline-all-the-icons -> pre-init (spacemacs-modeline)...
(Spacemacs) spacemacs-purpose-popwin -> pre-init (spacemacs-purpose)...
(Spacemacs) sqlup-mode is disabled.
(Spacemacs) ssh-agency is configured in the dotfile.
(Spacemacs) stickyfunc-enhance -> pre-init (semantic)...
(Spacemacs) term-cursor is disabled.
(Spacemacs) transient -> pre-init (git)...
(Spacemacs) treemacs-all-the-icons is disabled.
(Spacemacs) unkillable-scratch is disabled.
(Spacemacs) aggressive-indent -> init (spacemacs-editing)...
(Spacemacs) all-the-icons -> init (spacemacs-visual)...
(Spacemacs) anaconda-mode -> init (python)...
(Spacemacs) ansi-colors -> init (spacemacs-visual)...
(Spacemacs) space-doc -> init (spacemacs-org)...
(Spacemacs) spaceline-all-the-icons -> init (spacemacs-modeline)...
(Spacemacs) spacemacs-github -> init (github)...
(Spacemacs) spacemacs-purpose-popwin -> init (spacemacs-purpose)...
(Spacemacs) treemacs-evil -> init (treemacs)...
(Spacemacs) treemacs-icons-dired -> init (treemacs)...
(Spacemacs) treemacs-magit -> init (treemacs)...
(Spacemacs) treemacs-persp -> init (treemacs)...
Direnv succeeded in /home/jimmy/
spacemacs-buffer||propertize-heading: Symbol’s function definition is void: all-the-icons-material
Configuring package bookmark...done
Configuring package recentf...done
Loading /home/jimmy/workspace/git/syl20bnr/spacemacs/.cache/recentf...done
Configuring package highlight-parentheses...done

Thank you all the same. I'm going to looking into the problem by myself.

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try

One way is after you C-g, close the home buffer with SPC b d. Then M-x toggle-debug-on-error, SPC b h.

@lebensterben
Copy link
Collaborator Author

@lebensterben lebensterben commented on 8262481 Feb 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yssource

Well.. Can you try emacs --eval '(setq debug-on-error t)'

P.S. Note that the two screenshot you attached above are identical.
And I cannot see

There are beautiful icons on the home buffer.

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's upload two the same pictures by mistake.

emacs --eval '(setq debug-on-error t)'

(void-function all-the-icons-material)
  (all-the-icons-material "error" :face 'font-lock-keyword-face)
  (spacemacs-buffer||propertize-heading (all-the-icons-material "error" :face 'font-lock-keyword-face) "Errors:" "e")
  (spacemacs-buffer//insert-string-list (spacemacs-buffer||propertize-heading (all-the-icons-material "error" :face 'font-lock-keyword-face) "Errors:" "e") spacemacs-buffer--errors)
  (if (spacemacs-buffer//insert-string-list (spacemacs-buffer||propertize-heading (all-the-icons-material "error" :face 'font-lock-keyword-face) "Errors:" "e") spacemacs-buffer--errors) (progn (define-key spacemacs-buffer-mode-map "e" 'spacemacs-buffer/jump-to-errors) (insert spacemacs-buffer-list-separator)))
  spacemacs-buffer//insert-errors()
  (cond ((eq el 'warnings) (spacemacs-buffer//insert-errors) (spacemacs-buffer//insert-warnings)) ((eq el 'recents) (spacemacs-buffer//insert-recent-files list-size)) ((eq el 'recents-by-project) (spacemacs-buffer//insert-recent-files-by-project list-size)) ((eq el 'todos) (spacemacs-buffer//insert-todos list-size)) ((eq el 'agenda) (spacemacs-buffer//insert-agenda list-size)) ((eq el 'bookmarks) (spacemacs-buffer//insert-bookmarks list-size)) ((and (eq el 'projects) (fboundp 'projectile-mode)) (spacemacs-buffer//insert-projects list-size)))
  (let ((el (or (car-safe els) els)) (list-size (or (cdr-safe els) spacemacs-buffer-startup-lists-length))) (cond ((eq el 'warnings) (spacemacs-buffer//insert-errors) (spacemacs-buffer//insert-warnings)) ((eq el 'recents) (spacemacs-buffer//insert-recent-files list-size)) ((eq el 'recents-by-project) (spacemacs-buffer//insert-recent-files-by-project list-size)) ((eq el 'todos) (spacemacs-buffer//insert-todos list-size)) ((eq el 'agenda) (spacemacs-buffer//insert-agenda list-size)) ((eq el 'bookmarks) (spacemacs-buffer//insert-bookmarks list-size)) ((and (eq el 'projects) (fboundp 'projectile-mode)) (spacemacs-buffer//insert-projects list-size))))
  (while --dolist-tail-- (setq els (car --dolist-tail--)) (let ((el (or (car-safe els) els)) (list-size (or (cdr-safe els) spacemacs-buffer-startup-lists-length))) (cond ((eq el 'warnings) (spacemacs-buffer//insert-errors) (spacemacs-buffer//insert-warnings)) ((eq el 'recents) (spacemacs-buffer//insert-recent-files list-size)) ((eq el 'recents-by-project) (spacemacs-buffer//insert-recent-files-by-project list-size)) ((eq el 'todos) (spacemacs-buffer//insert-todos list-size)) ((eq el 'agenda) (spacemacs-buffer//insert-agenda list-size)) ((eq el 'bookmarks) (spacemacs-buffer//insert-bookmarks list-size)) ((and (eq el 'projects) (fboundp 'projectile-mode)) (spacemacs-buffer//insert-projects list-size)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- (append '(warnings) dotspacemacs-startup-lists)) els) (while --dolist-tail-- (setq els (car --dolist-tail--)) (let ((el (or (car-safe els) els)) (list-size (or (cdr-safe els) spacemacs-buffer-startup-lists-length))) (cond ((eq el 'warnings) (spacemacs-buffer//insert-errors) (spacemacs-buffer//insert-warnings)) ((eq el 'recents) (spacemacs-buffer//insert-recent-files list-size)) ((eq el 'recents-by-project) (spacemacs-buffer//insert-recent-files-by-project list-size)) ((eq el 'todos) (spacemacs-buffer//insert-todos list-size)) ((eq el 'agenda) (spacemacs-buffer//insert-agenda list-size)) ((eq el 'bookmarks) (spacemacs-buffer//insert-bookmarks list-size)) ((and (eq el 'projects) (fboundp 'projectile-mode)) (spacemacs-buffer//insert-projects list-size)))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((dotspacemacs-startup-buffer-show-icons dotspacemacs-startup-buffer-show-icons)) (if (display-graphic-p) (if (configuration-layer/package-used-p 'all-the-icons) nil (message "Package `all-the-icons' isn't installed") (setq dotspacemacs-startup-buffer-show-icons nil)) (setq dotspacemacs-startup-buffer-show-icons nil)) (let ((--dolist-tail-- (append '(warnings) dotspacemacs-startup-lists)) els) (while --dolist-tail-- (setq els (car --dolist-tail--)) (let ((el (or (car-safe els) els)) (list-size (or (cdr-safe els) spacemacs-buffer-startup-lists-length))) (cond ((eq el 'warnings) (spacemacs-buffer//insert-errors) (spacemacs-buffer//insert-warnings)) ((eq el 'recents) (spacemacs-buffer//insert-recent-files list-size)) ((eq el 'recents-by-project) (spacemacs-buffer//insert-recent-files-by-project list-size)) ((eq el 'todos) (spacemacs-buffer//insert-todos list-size)) ((eq el 'agenda) (spacemacs-buffer//insert-agenda list-size)) ((eq el 'bookmarks) (spacemacs-buffer//insert-bookmarks list-size)) ((and (eq el ...) (fboundp ...)) (spacemacs-buffer//insert-projects list-size)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  spacemacs-buffer//do-insert-startupify-lists()
  (save-restriction (narrow-to-region (point) (point)) (spacemacs-buffer//do-insert-startupify-lists) (spacemacs-buffer//center-startup-lists))
  (let ((buffer-read-only nil)) (goto-char (point-max)) (spacemacs-buffer/insert-page-break) (insert "\n") (save-restriction (narrow-to-region (point) (point)) (spacemacs-buffer//do-insert-startupify-lists) (spacemacs-buffer//center-startup-lists)))
  (save-current-buffer (set-buffer (get-buffer spacemacs-buffer-name)) (let ((buffer-read-only nil)) (goto-char (point-max)) (spacemacs-buffer/insert-page-break) (insert "\n") (save-restriction (narrow-to-region (point) (point)) (spacemacs-buffer//do-insert-startupify-lists) (spacemacs-buffer//center-startup-lists))))
  spacemacs-buffer/insert-startup-lists()
  (progn (spacemacs-buffer/insert-startup-lists))
  (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startup-lists)))
  (save-current-buffer (set-buffer (get-buffer spacemacs-buffer-name)) (if dotspacemacs-startup-lists (progn (spacemacs-buffer/insert-startup-lists))) (spacemacs-buffer//insert-footer) (if configuration-layer-error-count (progn (spacemacs-buffer-mode) (face-remap-add-relative 'mode-line '((:background "red") mode-line)) (spacemacs-buffer/set-mode-line (format (concat "%s error(s) at startup! " "Spacemacs may not be able to operate properly.") configuration-layer-error-count) t)) (spacemacs-buffer/set-mode-line spacemacs--default-mode-line) (spacemacs-buffer-mode)) (force-mode-line-update) (spacemacs-buffer/goto-link-line))
  spacemacs-buffer//startup-hook()
  spacemacs/startup-hook()
  run-hooks(emacs-startup-hook term-setup-hook)
  #f(compiled-function () #<bytecode -0xffdd2658cd4ae98>)()
  normal-top-level()

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yssource
Can you add the following ABOVE this line? (And restart emacs with debug-on-error)

(when dotspacemacs-startup-buffer-show-icons (require 'all-the-icons))

@yssource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. It works for me.
(when dotspacemacs-startup-buffer-show-icons (require 'all-the-icons))

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well I'll add that now...

@lebensterben
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yssource
It's pushed on develop now. Thanks for your bug report.

Please sign in to comment.