summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-09-01 20:48:41 +0200
committerAlan Pearce2017-09-01 20:48:41 +0200
commitcce695c698235eb1e7364d73d4e708523c413eba (patch)
treeefefa5a788c97b26e6be415b8a0b382bd3256930 /emacs
parent3ad99faaddef928e1fcdfa3df6d9e96710142b1b (diff)
downloaddotfiles-cce695c698235eb1e7364d73d4e708523c413eba.tar.lz
dotfiles-cce695c698235eb1e7364d73d4e708523c413eba.tar.zst
dotfiles-cce695c698235eb1e7364d73d4e708523c413eba.zip
Emacs: Improve first-frame-hook
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 226cc2f..edd7507 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