technomancy / emacs-starter-kit

[ARCHIVED] this is ancient history
GNU General Public License v3.0
2.86k stars 887 forks source link

Load system and user config files after init. Should help with #107. #108

Closed DarwinAwardWinner closed 12 years ago

DarwinAwardWinner commented 12 years ago

If my code is correct, this pull request should result in the user and system config files being loaded after init, and hence after all other packages have been loaded.

This should fix #107, assuming that the code works.

technomancy commented 12 years ago

Oh, cool; I didn't know about that hook. That's been tripping up a lot of people; thanks!

DarwinAwardWinner commented 12 years ago

Make sure you test it. I haven't actually confirmed that the function works at init time.

The trick is that after-init-time is nil during startup (M-x describe-variable after-init-time), so that's how I tell if Emacs is already done initializing. If it's already done, I just eval the code immediately. So this should not break anything if for some reason esk is not loaded until after init.

eoranged commented 12 years ago

It helps, but only after wrapping config autoloads to esk-eval-after-init this way:

--- starter-kit-autoloads.el    2011-11-25 00:41:24.000000000 +0400
+++ starter-kit-autoloads.el    2011-11-25 01:15:10.225880579 +0400
@@ -20,11 +20,13 @@

(global-set-key (kbd "M-x") 'smex)

-(when (file-exists-p esk-system-config) (load esk-system-config))
+(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-config) (load esk-user-config))

-(when (file-exists-p esk-user-dir) (mapc 'load (directory-files esk-user-dir nil "^[^#].*el$")))
+    (when (file-exists-p esk-user-dir) (mapc 'load (directory-files esk-user-dir nil "^[^#].*el$")))))

 ;;;***

I'm not sure how to provide appropriate fix for this issue, because autoloads are auto-generated. Also It is necessary to ensure that the esk-eval-after-init is exists at autoloads eval time. I've simply put It at the beginning of my ~/.emacs.d/init.el

DarwinAwardWinner commented 12 years ago

Is is possible that the autoloads file was left over from an earlier version that didn't have my fix?

mamciek commented 12 years ago

Yes. you have to regenerate autoloads after applying patch

eoranged commented 12 years ago

Yes, I've patched already installed version.

25.11.2011, 08:48, "Ryan Thompson" reply@reply.github.com:

Is is possible that the autoloads file was left over from an earlier version that didn't have my fix?


Reply to this email directly or view it on GitHub: https://github.com/technomancy/emacs-starter-kit/pull/108#issuecomment-2871314

Best regards, Vladimir Protasov.

eoranged commented 12 years ago

Yes, thanks. It worked for me.

25.11.2011, 14:08, "Maciej Mazur" reply@reply.github.com:

Yes. you have to regenerate autoloads after applying patch


Reply to this email directly or view it on GitHub: https://github.com/technomancy/emacs-starter-kit/pull/108#issuecomment-2873070

Best regards, Vladimir Protasov.

bmabey commented 12 years ago

Thanks for merging this in, it should make things much easier. @technomancy, will this be released to marmalade soon?

DarwinAwardWinner commented 12 years ago

Has anyone tested this? Does it work well? I don't use ESK myself; I just have an interest in it since it started depending on my ido-ubiquitous package.

technomancy commented 12 years ago

To be honest it'll probably be a couple weeks before I get a chance to cut a release. I'll be sure to test it thoroughly before it's pushed out.

bmabey commented 12 years ago

I've been using it and it has been working like a charm. :) I am on the latest version of the code and I haven't ran into any issues.

eoranged commented 12 years ago

It works very well (no problem since 25.11.2011).

19.01.2012, 07:31, "Ryan Thompson" reply@reply.github.com:

Has anyone tested this? Does it work well? I don't use ESK myself; I just have an interest in it since it started depending on my ido-ubiquitous package.


Reply to this email directly or view it on GitHub: https://github.com/technomancy/emacs-starter-kit/pull/108#issuecomment-3557470

Best regards, Vladimir Protasov.

DarwinAwardWinner commented 12 years ago

Glad to know it works.