Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

esk-user-dir files should be loaded after ELPA has completed #107

Closed
mamciek opened this Issue · 3 comments

3 participants

@mamciek

Starter kit has a nice feature of autoloading all files from directory called the same as username. Starting from version 24 however there is a problem with it.
Those files are loaded just after starter kit is loaded by package.el mechanism. The problem is that those files are evaluated before rest of ELPA (or Marmalade) packages are loaded, so i cannot use any functions from packages that are loaded after the starterkit.
It should be fixed so files in user-dir are evaluated AFTER package.el has loaded all packages

@technomancy
Owner

Unfortunately the starter kit is a package now, so it gets loaded with all the other packages. If you have any ideas of how this would be implemented I'm open to the idea, but I don't think it's possible with the way packages work.

In most cases it's best to just move everything that needs packages to init.el, which doesn't have this restriction.

@mamciek

unfortunately i do not know Lisp enough to propose implementation but I can see two possible solutions:
1. (simple) Code that loads those files can be moved into some function fun_x, so that i can just call it in init.el after packages have been evaluated - it won't be called during starter-kit package evaluation
2. (elegant) Is there some hook defined by package.el that is called at the end of the process? Well - it should be :) If there is one then you could attach your code there and load user-specific files

Actually I can prepare pull request with solution 1 if you think it is acceptable

@DarwinAwardWinner DarwinAwardWinner referenced this issue from a commit in DarwinAwardWinner/emacs-starter-kit
@DarwinAwardWinner DarwinAwardWinner Load system and user config files after init. Should help with #107.
ALMOST ENTIRELY UNTESTED.
b1fd4fc
@DarwinAwardWinner

Some options:

Delayed execution (fix it yourself)

You can put this:

(eval-after-load 'foo
  '(progn
     (turn-on-foo-mode)
     (do-more-foo-stuff)))

Or this:

(add-hook 'after-init-hook (lambda ()
  (require 'foo)
  (turn-on-foo-mode)
  (do-more-foo-stuff)))

into your starter kit init files.

Fix in Starter Kit

See #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.