forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-frame-hooks.el
25 lines (19 loc) · 942 Bytes
/
init-frame-hooks.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
(defvar after-make-console-frame-hooks '()
"Hooks to run after creating a new TTY frame")
(defvar after-make-window-system-frame-hooks '()
"Hooks to run after creating a new window-system frame")
(defun run-after-make-frame-hooks (frame)
"Run configured hooks in response to the newly-created FRAME.
Selectively runs either `after-make-console-frame-hooks' or
`after-make-window-system-frame-hooks'"
(with-selected-frame frame
(run-hooks (if window-system
'after-make-window-system-frame-hooks
'after-make-console-frame-hooks))))
(add-hook 'after-make-frame-functions 'run-after-make-frame-hooks)
(defconst sanityinc/initial-frame (selected-frame)
"The frame (if any) active during Emacs initialization.")
(add-hook 'after-init-hook
(lambda () (when sanityinc/initial-frame
(run-after-make-frame-hooks sanityinc/initial-frame))))
(provide 'init-frame-hooks)