Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
alexanderdean opened this Issue · 10 comments

4 participants

@alexanderdean

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

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
Owner

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

@alexanderdean

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

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

@alexanderdean

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
Owner

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

@alexanderdean

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

@genexp
@bbatsov
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.

@bbatsov bbatsov closed this
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.