Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make Prelude package init code available to personal config files #171

alexanderdean opened this Issue Jun 8, 2012 · 10 comments


None yet
4 participants

Building on your Stack Overflow answer here, it would be cool if your Prelude package initialization code (or a derivative) was somehow made available to Prelude users to make use of in their personal configuration files.

In other words, I would love to be able to do this:

;; ~/.emacs.d/personal/evil.el

(prelude-package-install evil)
(require 'evil)
(evil-mode 1)

I'm quite new to Prelude (and Emacs), so if this is a stupid request, feel free to close...


genexp commented Jun 9, 2012

Hey @alexanderdean - Happily, I think this works the way you cant already. If you put anything in the personal directory it will get executed :) I use it to do exactly what you suggested.


bbatsov commented Jun 13, 2012

@alexanderdean I might be misunderstanding your request, but I'm pretty sure Prelude already does what you want :-)

Thanks for the comment @bbatsov - what would be the syntax then? I think I invented (prelude-package-install)...


bbatsov commented Jun 13, 2012

It would be (package-install 'evil) (it's a built-in feature of Emacs 24). I wouldn't put package installation in the init though (at least not without a check whether they aren't already installed first). You can use code similar to the one I've written in prelude-packages.el.

Ah thanks - I think that was my point: it would be nice if your code in prelude-packages.el was reusable so I didn't have to write my own! I'm new to Emacs but it would be nice if I could put my custom package dependencies in my dotfiles in a straightforward way rather than having to manually install them, write a custom script or indeed edit the list inside prelude-packages.el.

I'd think that would be a useful feature for other people too? But maybe I'm misunderstanding and my request isn't something that would be useful to other people... Feel free to close if so!


bbatsov commented Jun 13, 2012

I see - I've been thinking the very same thing for a while now and I'll implement that feature.

Cool! Glad it was a useful feature request :-)


genexp commented Jun 13, 2012

+1 - I agree in spirit at least. If we want to make this easy, it
would be cook to have something like this:

./personal/packages.el.sample - Include sample code for checking is
something is installed, and if not, install it.

Let people rename it to packages.el if they want to use the feature

On Wed, Jun 13, 2012 at 9:43 AM, Bozhidar Batsov

I see - I've been thinking the very same thing for a while now and I'll implement that feature.

Reply to this email directly or view it on GitHub:
#171 (comment)


bbatsov commented Dec 16, 2012

I've just added the function prelude-ensure-module-deps. It works like this:

(prelude-ensure-module-deps '(redo+ evil-numbers etc))

You simply need to put it before any code relying on the presence of the required packages.

@bbatsov bbatsov closed this Dec 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment