summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2022-01-02 23:33:00 -0600
committerCase Duckworth2022-01-02 23:33:00 -0600
commit30ca7beb8f0101dffffc22858bcfcd8e0d604a56 (patch)
tree89b533b95570283d413f6bc0d44a67edaf4314a5 /lisp
parentDisable indicate-empty-lines (diff)
downloademacs-30ca7beb8f0101dffffc22858bcfcd8e0d604a56.tar.gz
emacs-30ca7beb8f0101dffffc22858bcfcd8e0d604a56.zip
Add function: +ensure-after-init
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el8
1 files changed, 8 insertions, 0 deletions
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.
80If 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