From 19f38149de0622c26f2aee8455b15f8a6c7365c6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 21 May 2021 10:58:30 -0500 Subject: [PATCH] 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. --- early-init.el | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/early-init.el b/early-init.el index bb717d6..d3d9a29 100644 --- a/early-init.el +++ b/early-init.el @@ -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')