From cce695c698235eb1e7364d73d4e708523c413eba Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 1 Sep 2017 20:48:41 +0200 Subject: Emacs: Improve first-frame-hook --- emacs/.emacs.d/main.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el index 226cc2fb..edd75073 100644 --- a/emacs/.emacs.d/main.el +++ b/emacs/.emacs.d/main.el @@ -1560,14 +1560,16 @@ With prefix TO-CURRENT-BUFFER, insert command output into buffer." (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 -- cgit 1.4.1