diff options
author | Alan Pearce | 2017-09-01 20:48:41 +0200 |
---|---|---|
committer | Alan Pearce | 2017-09-01 20:48:41 +0200 |
commit | cce695c698235eb1e7364d73d4e708523c413eba (patch) | |
tree | efefa5a788c97b26e6be415b8a0b382bd3256930 /emacs | |
parent | 3ad99faaddef928e1fcdfa3df6d9e96710142b1b (diff) | |
download | nixfiles-cce695c698235eb1e7364d73d4e708523c413eba.tar.lz nixfiles-cce695c698235eb1e7364d73d4e708523c413eba.tar.zst nixfiles-cce695c698235eb1e7364d73d4e708523c413eba.zip |
Emacs: Improve first-frame-hook
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/main.el | 12 |
1 files 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 |