diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-16 10:45:21 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-16 10:45:21 +0000 |
commit | 829821cc988be06c1f8a0699d11fecb7a6db972a (patch) | |
tree | 174843435756396ce8335daa4d141d9b49ff5d42 /sx.el | |
parent | 4715d7e9e4c3bc4f4488f2a09c285171b245296d (diff) |
Implement sx-initialize
Diffstat (limited to 'sx.el')
-rw-r--r-- | sx.el | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -143,10 +143,19 @@ SETTER should be a function of two arguments. If SETTER is nil, (,(or setter #'setq) ,variable ,value)))) nil) -(defun stack-initialize () - (run-hooks - 'sx-init--internal-hook - 'sx-init-hook)) +(defvar sx-initialized nil + "Nil if sx hasn't been initialized yet. +If it has, holds the time at which initialization happened.") + +(defun sx-initialize (&optional force) + "Run initialization hooks if they haven't been run yet. +These are `sx-init--internal-hook' and `sx-init-hook'. +If FORCE is non-nil, run them even if they've already been run." + (when (or force (not sx-initialized)) + (prog1 + (run-hooks 'sx-init--internal-hook + 'sx-init-hook) + (setq sx-initialized (current-time))))) (provide 'sx) ;;; sx.el ends here |