Browse Source

show the tips after the init sequence has completed

custom
Bozhidar Batsov 14 years ago
parent
commit
026dc563d1
  1. 5
      init.el
  2. 9
      prelude/prelude-core.el

5
init.el

@ -75,7 +75,8 @@ ELPA (or MELPA).")
(message "Prelude is ready to do thy bidding, Master %s!" (getenv "USER"))
;; greet the use with some useful tip
(prelude-tip-of-the-day)
(prelude-eval-after-init
;; greet the use with some useful tip
(run-at-time 5 nil 'prelude-tip-of-the-day))
;;; init.el ends here

9
prelude/prelude-core.el

@ -381,5 +381,14 @@ and so on."
(interactive)
(message (concat "Prelude tip: " (nth (random (length prelude-tips)) prelude-tips))))
(defun prelude-eval-after-init (form)
"Add `(lambda () FORM)' to `after-init-hook'.
If Emacs has already finished initialization, also eval FORM immediately."
(let ((func (list 'lambda nil form)))
(add-hook 'after-init-hook func)
(when after-init-time
(eval form))))
(provide 'prelude-core)
;;; prelude-core.el ends here
Loading…
Cancel
Save