diff options
author | Case Duckworth | 2022-01-02 23:33:00 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-02 23:33:00 -0600 |
commit | 30ca7beb8f0101dffffc22858bcfcd8e0d604a56 (patch) | |
tree | 89b533b95570283d413f6bc0d44a67edaf4314a5 | |
parent | Disable indicate-empty-lines (diff) | |
download | emacs-30ca7beb8f0101dffffc22858bcfcd8e0d604a56.tar.gz emacs-30ca7beb8f0101dffffc22858bcfcd8e0d604a56.zip |
Add function: +ensure-after-init
-rw-r--r-- | init.el | 5 | ||||
-rw-r--r-- | lisp/acdw.el | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/init.el b/init.el index 0866f17..5d5c02f 100644 --- a/init.el +++ b/init.el | |||
@@ -51,7 +51,7 @@ | |||
51 | (:hook #'+init-add-setup-to-imenu)) | 51 | (:hook #'+init-add-setup-to-imenu)) |
52 | 52 | ||
53 | (setup (:require +key) | 53 | (setup (:require +key) |
54 | (+key-setup)) | 54 | (+ensure-after-init #'+key-global-mode)) |
55 | 55 | ||
56 | (setup (:require auth-source) | 56 | (setup (:require auth-source) |
57 | (:option auth-sources (list (private/ "authinfo") | 57 | (:option auth-sources (list (private/ "authinfo") |
@@ -175,8 +175,7 @@ | |||
175 | custom-variable-default-form 'lisp | 175 | custom-variable-default-form 'lisp |
176 | +custom-variable-allowlist '(safe-local-variable-values | 176 | +custom-variable-allowlist '(safe-local-variable-values |
177 | warning-suppress-types)) | 177 | warning-suppress-types)) |
178 | (when (file-exists-p custom-file) | 178 | (+ensure-after-init #'+custom-load-ignoring-most-customizations) |
179 | (+custom-load-ignoring-most-customizations t)) | ||
180 | (advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets) | 179 | (advice-add #'custom-buffer-create-internal :after #'+cus-edit-expand-widgets) |
181 | (:with-mode Custom-mode | 180 | (:with-mode Custom-mode |
182 | (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression))) | 181 | (:local-set imenu-generic-expression +cus-edit-imenu-generic-expression))) |
diff --git a/lisp/acdw.el b/lisp/acdw.el index 95e1147..43cb5c7 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -75,5 +75,13 @@ ARGS." | |||
75 | (run-at-time sunset-time (* 60 60 24) sunset-command) | 75 | (run-at-time sunset-time (* 60 60 24) sunset-command) |
76 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) | 76 | (run-at-time "12:00am" (* 60 60 24) sunset-command))) |
77 | 77 | ||
78 | (defun +ensure-after-init (function) | ||
79 | "Ensure FUNCTION runs after init, or now if already initialized. | ||
80 | If Emacs is already started, run FUNCTION. Otherwise, add it to | ||
81 | `after-init-hook'. FUNCTION is called with no arguments." | ||
82 | (if after-init-time | ||
83 | (funcall function) | ||
84 | (add-hook 'after-init-hook function))) | ||
85 | |||
78 | (provide 'acdw) | 86 | (provide 'acdw) |
79 | ;;; acdw.el ends here | 87 | ;;; acdw.el ends here |