You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently went through the process of installing this package via package-install and then loading it directly through my ~/.emacs.d/init.el (a.k.a. ~/.emacs). I finally got it to work, and I thought it would be useful to include information about it in the README. (This is for Emacs 24.5.1.)
Here's what I did.
Install color-theme-solarized via the package system from MELPA. I won't go through that process here. I'll assume this is known.
Set up the after-make-frame-functions hook as already specified.
Add a function to after-init-hook to turn it on. Something like this in your ~/.emacs.d/init.el:
The only caveat with this second approach is outlined in the Emacs manual under Package Installation:
The reason automatic package loading occurs after loading the init file is that user options only receive their customized values after loading the init file, including user options which affect the packaging system.
It looks like the "accepted" way to load and use packages is lazily, which means making liberal use of the after-init-hook. I don't know if this is really what was intended, but packages are not available when your init.el is processed, so you either have to (a) ensure all customization is done through customize; (b) don't use customize for much of anything; (c) run package-initialize yourself (which may make some customizations not work); (d) load the packages and apply code-based customizations after the packages are loaded by Emacs, which is after the init.el is processed. (Hey, let's just rewrite Emacs in Haskell to solve this problem!(*))
I've used this to deal with all the stuff I've installed through packages and have migrated my code-based customizations accordingly. It appears to work. (What's odd is that, essentially, you end up having the after-init-hook load some other Elisp file to do the code-based customizations for packages.)
I have a feeling I'm missing something, but this doesn't feel like a horrible hack so I'm suggesting it for the time being. If I come across something else, I'll provide more information.
(*) No. And shame on you for even entertaining the idea for a number of picoseconds greater than 0.
The text was updated successfully, but these errors were encountered:
I recently went through the process of installing this package via
package-install
and then loading it directly through my~/.emacs.d/init.el
(a.k.a.~/.emacs
). I finally got it to work, and I thought it would be useful to include information about it in theREADME
. (This is for Emacs 24.5.1.)Here's what I did.
color-theme-solarized
via the package system from MELPA. I won't go through that process here. I'll assume this is known.after-make-frame-functions
hook as already specified.after-init-hook
to turn it on. Something like this in your~/.emacs.d/init.el
:Technically speaking, you can also do this:
The only caveat with this second approach is outlined in the Emacs manual under Package Installation:
It looks like the "accepted" way to load and use packages is lazily, which means making liberal use of the
after-init-hook
. I don't know if this is really what was intended, but packages are not available when yourinit.el
is processed, so you either have to (a) ensure all customization is done throughcustomize
; (b) don't usecustomize
for much of anything; (c) runpackage-initialize
yourself (which may make some customizations not work); (d) load the packages and apply code-based customizations after the packages are loaded by Emacs, which is after theinit.el
is processed. (Hey, let's just rewrite Emacs in Haskell to solve this problem!(*))I've used this to deal with all the stuff I've installed through packages and have migrated my code-based customizations accordingly. It appears to work. (What's odd is that, essentially, you end up having the
after-init-hook
load some other Elisp file to do the code-based customizations for packages.)I have a feeling I'm missing something, but this doesn't feel like a horrible hack so I'm suggesting it for the time being. If I come across something else, I'll provide more information.
(*) No. And shame on you for even entertaining the idea for a number of picoseconds greater than 0.
The text was updated successfully, but these errors were encountered: