summary refs log tree commit diff stats
path: root/early-init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-05-21 10:48:05 -0500
committerCase Duckworth2021-05-21 10:57:58 -0500
commita5fe45e8db98f2405b6ec3d325d9d4366434faa7 (patch)
treea10665b4197b1417eb5cc2af865460f3ad025b84 /early-init.el
parentFix `acdw/system' argument parsing (diff)
downloademacs-a5fe45e8db98f2405b6ec3d325d9d4366434faa7.tar.gz
emacs-a5fe45e8db98f2405b6ec3d325d9d4366434faa7.zip
Comment out `hook-defun'
The only plus `hook-defun' has over (add-hook 'hook (defun name ... )) is the
ability to add the same function to multiple hooks at once.  My init files
don't use that functionality, so I've retired this macro for now.

I'm thinking, honestly, that if a function is used in more than one hook, it
should be defined separately and added to each hook in turn ... you know, like
Emacs does it by default.
Diffstat (limited to 'early-init.el')
-rw-r--r--early-init.el36
1 files changed, 19 insertions, 17 deletions
diff --git a/early-init.el b/early-init.el index 622d220..bb717d6 100644 --- a/early-init.el +++ b/early-init.el
@@ -34,11 +34,12 @@
34 inhibit-x-resources t) 34 inhibit-x-resources t)
35(acdw/gc-disable) 35(acdw/gc-disable)
36 36
37(hook-defun post-init-reset after-init-hook 37(add-hook 'after-init-hook
38 (acdw/gc-enable) 38 (defun after-init@reset ()
39 (dolist (handler file-name-handler-alist) 39 (acdw/gc-enable)
40 (add-to-list 'orig-file-name-handler-alist handler)) 40 (dolist (handler file-name-handler-alist)
41 (setq file-name-handler-alist orig-file-name-handler-alist)) 41 (add-to-list 'orig-file-name-handler-alist handler))
42 (setq file-name-handler-alist orig-file-name-handler-alist)))
42 43
43;;; Frame settings 44;;; Frame settings
44(setq default-frame-alist ; Remove most UI 45(setq default-frame-alist ; Remove most UI
@@ -60,18 +61,6 @@
60 inhibit-x-resources t ; Don't load ~/.Xresources 61 inhibit-x-resources t ; Don't load ~/.Xresources
61 ) 62 )
62 63
63(hook-defun disable-ui-modes after-init-hook
64 (dolist (mode ;; each mode is of the form (MODE . FRAME-ALIST-VAR)
65 '((tool-bar-mode . tool-bar-lines)
66 (menu-bar-mode . menu-bar-lines)
67 (scroll-bar-mode . vertical-scroll-bars)
68 (horizontal-scroll-bar-mode . horizontal-scroll-bars)
69 ))
70 (let ((setting (alist-get (cdr mode) default-frame-alist)))
71 (when (or (not setting)
72 (= 0 setting))
73 (funcall (car mode) -1)))))
74
75(add-function :after after-focus-change-function 64(add-function :after after-focus-change-function
76 (defun acdw/first-frame-setup () 65 (defun acdw/first-frame-setup ()
77 ;; fonts 66 ;; fonts
@@ -96,6 +85,19 @@
96 ;; only run this once 85 ;; only run this once
97 (remove-function after-focus-change-function 86 (remove-function after-focus-change-function
98 'acdw/first-frame-setup))) 87 'acdw/first-frame-setup)))
88(add-hook 'after-init-hook
89 (defun after-init@disable-ui-modes ()
90 (dolist (mode ;; each mode is of the form (MODE . FRAME-ALIST-VAR)
91 '((tool-bar-mode . tool-bar-lines)
92 (menu-bar-mode . menu-bar-lines)
93 (scroll-bar-mode . vertical-scroll-bars)
94 (horizontal-scroll-bar-mode . horizontal-scroll-bars)
95 ))
96 (let ((setting (alist-get (cdr mode) default-frame-alist)))
97 (when (or (not setting)
98 (= 0 setting))
99 (funcall (car mode) -1))))))
100
99 101
100 102
101;;; Bootstrap package manager (`straight.el') 103;;; Bootstrap package manager (`straight.el')