Skip to content
This repository

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

Closed
alexanderdean opened this Issue · 10 comments

4 participants

Alexander Dean Brian Corrigan Bozhidar Batsov Tulio Magno Quites Machado Filho
Alexander Dean

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...

Brian Corrigan
genexp commented

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.

Bozhidar Batsov
Owner

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

Alexander Dean

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

Bozhidar Batsov
Owner

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.

Alexander Dean

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!

Bozhidar Batsov
Owner

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

Alexander Dean

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

Brian Corrigan
genexp commented
Bozhidar Batsov
Owner

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.

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.