all repos — nixfiles @ cce695c698235eb1e7364d73d4e708523c413eba

System and user configuration, managed by nix and home-manager

Emacs: Improve first-frame-hook

Alan Pearce
commit

cce695c698235eb1e7364d73d4e708523c413eba

parent

3ad99faaddef928e1fcdfa3df6d9e96710142b1b

1 file changed, 7 insertions(+), 5 deletions(-)

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -1560,14 +1560,16 @@ (add-hook 'kill-emacs-hook 'pinentry-stop))
(add-to-list 'load-suffixes ".el.gpg") (load-gpg (expand-file-name (system-name) user-emacs-directory))))) -(defun first-frame-hook () +(defun first-frame-hook (frame) "Hook run only after first frame is created." (remove-hook 'after-make-frame-functions #'first-frame-hook) - (run-at-time nil nil 'load-private-data)) + (run-at-time nil nil #'load-private-data) + (run-at-time nil nil #'ap/set-fonts-according-to-system)) -(if (eq 1 (length (frame-list))) - (add-hook 'after-init-hook #'load-private-data) - (add-hook 'after-make-frame-functions #'first-frame-hook)) +(if (or (daemonp) + (not (eq 1 (length (frame-list))))) + (add-hook 'after-make-frame-functions #'first-frame-hook) + (add-hook 'after-init-hook #'load-private-data)) ;; #+END_SRC ;; ** Minibuffer