reddit / emacs

Weird problems with Emacs daemon not immediately loading graphical elements

PhantomSeahorse · 2022-12-04 22:19
PhantomSeahorse · 2022-12-04 22:24
Hi all, I have been consistently having issues with Emacs daemon not working well with graphical elements on dashboard like icons and images right after start. The first image is what I see when opening emacs client the first time after Emacs systemd server start. However, if I resize the Emacs GUI window using my WM (outside of Emacs) without doing anything else, all the icons appear as shown in the second picture. If there any way to make Emacs dashboard look like the second one without having to resize the window first? Any help is appreciated. ``` (use-package dashboard :after all-the-icons :config (dashboard-setup-startup-hook) :custom (dashboard-set-heading-icons t) (dashboard-set-file-icons t) (dashboard-items '((recents . 10) (bookmarks . 5) (projects . 5)))) ```
danderzei · 2022-12-04 22:29
This happens to me occasionally. Pressing g fixes it
PhantomSeahorse · 2022-12-04 22:52
Pressing g does fix it… Do you know how to make this happen automatically? I guess calling revert-buffer on startup?
funk443 · 2022-12-05 01:32
(add-hook 'server-after-make-frame-hook 'revert-buffer) or (add-hook 'server-after-make-frame-hook (lambda () (revert-buffer)))
7890yuiop · 2022-12-05 05:17
*In general* this kind of problem occurs because there is no graphical frame when your init file is evaluated when you start a daemon. Use `after-make-frame-functions` to reliably do things after a frame is created.
PhantomSeahorse · 2022-12-05 17:32
Ty!