Change hook for `acdw/frame-setup'

I found out about `after-make-frame-functions', a special hook that I want to
use instead of `after-focus-change-function'.  I also don't need to remove it
in the function because the hook only fires once after each frame is made.
This commit is contained in:
Case Duckworth 2021-05-21 10:58:30 -05:00
parent a5fe45e8db
commit 19f38149de
1 changed files with 22 additions and 24 deletions

View File

@ -61,30 +61,6 @@
inhibit-x-resources t ; Don't load ~/.Xresources
)
(add-function :after after-focus-change-function
(defun acdw/first-frame-setup ()
;; fonts
(require 'acdw-fonts)
(setq acdw-fonts/monospace (acdw/system
(:home "DejaVu Sans Mono")
(:work "Consolas")
(:other "monospace"))
acdw-fonts/monospace-size 10
acdw-fonts/variable (acdw/system
(:home "DejaVu Sans")
(:work "Calibri")
(:other "sans-serif"))
acdw-fonts/variable-size 12)
(acdw-fonts/set)
(acdw-fonts/setup-emoji-fonts "Segoe UI Emoji"
"Noto Color Emoji"
"Apple Color Emoji"
"Symbola")
;; fringes
(acdw/setup-fringes)
;; only run this once
(remove-function after-focus-change-function
'acdw/first-frame-setup)))
(add-hook 'after-init-hook
(defun after-init@disable-ui-modes ()
(dolist (mode ;; each mode is of the form (MODE . FRAME-ALIST-VAR)
@ -98,6 +74,28 @@
(= 0 setting))
(funcall (car mode) -1))))))
(add-hook 'after-make-frame-functions
(defun acdw/frame-setup (&rest args)
(ignore args)
;; fonts
(require 'acdw-fonts)
(setq acdw-fonts/monospace (acdw/system
(:home "DejaVu Sans Mono")
(:work "Consolas")
(:other "monospace"))
acdw-fonts/monospace-size 10
acdw-fonts/variable (acdw/system
(:home "DejaVu Sans")
(:work "Calibri")
(:other "sans-serif"))
acdw-fonts/variable-size 12)
(acdw-fonts/set)
(acdw-fonts/setup-emoji-fonts "Segoe UI Emoji"
"Noto Color Emoji"
"Apple Color Emoji"
"Symbola")
;; fringes
(acdw/setup-fringes)))
;;; Bootstrap package manager (`straight.el')