Navigation Menu

Skip to content

Commit

Permalink
Merge pull request technomancy#108 from DarwinAwardWinner/patch-2
Browse files Browse the repository at this point in the history
Load system and user config files after init. Should help with technomancy#107.
  • Loading branch information
technomancy committed Nov 15, 2011
2 parents 74b7ef9 + b1fd4fc commit 5efa136
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions starter-kit.el
Expand Up @@ -57,10 +57,21 @@
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)

(when (file-exists-p esk-system-config) (load esk-system-config))
(when (file-exists-p esk-user-config) (load esk-user-config))
(when (file-exists-p esk-user-dir)
(mapc 'load (directory-files esk-user-dir nil "^[^#].*el$"))))
(defun esk-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))))

(esk-eval-after-init
'(progn
(when (file-exists-p esk-system-config) (load esk-system-config))
(when (file-exists-p esk-user-config) (load esk-user-config))
(when (file-exists-p esk-user-dir)
(mapc 'load (directory-files esk-user-dir nil "^[^#].*el$"))))))

(provide 'starter-kit)
;;; starter-kit.el ends here

0 comments on commit 5efa136

Please sign in to comment.