aboutsummaryrefslogtreecommitdiff
path: root/sx.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2014-11-17 22:33:07 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2014-11-17 22:33:07 +0000
commit3e17a40c0701dcd3cfa03141b2669abeb55e160a (patch)
tree2d2003fa91889bb54f0beeb4dac5232b99cb788b /sx.el
parent34d28e79f4a6049dc4ceb44397a2ca0725cecd5f (diff)
parent278fa010e6a63474fce6bf46aaf3327b0d9cf7f7 (diff)
Merge branch 'master' into question-mode-keybindings++
Diffstat (limited to 'sx.el')
-rw-r--r--sx.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/sx.el b/sx.el
index 53aae84..64c555c 100644
--- a/sx.el
+++ b/sx.el
@@ -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