Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize the list of packages that emacs-prelude provides

I see at this link how emacs prelude ensures that a set of packages is installed when emacs starts. I was wondering if I could somehow extend the variable prelude-packages to add some other packages, without changing the prelude-packages.el file?

Barring that I was wondering how I could define a list of packages that are installed at start-up if they aren't currently installed.

like image 965
Varun Madiath Avatar asked Aug 09 '12 00:08

Varun Madiath


2 Answers

You can place a .el file in personal/ directory in Prelude. Prelude loads any .el file it finds there in an alphabetical order. Below is the content of my personal/00-packages.el file.:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" .
               "http://marmalade-repo.org/packages/"))
(package-initialize)

;; My packages
(setq prelude-packages (append '(
                                 drupal-mode
                                 nginx-mode
                                 ) prelude-packages))

;; Install my packages
(prelude-install-packages)

"00" is added to the file name to ensure that the file is loaded before all personal customizations. Add any new package you need to the list being appended to prelude-packages.

Also, if you want to use any mode that is not available in MELPA or Marmalade, you can simply drop the mode's file in personal folder and Prelude will pick it up while loading. If there are any customizations to that mode, simply create another .el file and add the Emacs Lisp code there.

like image 139
kaustavdm Avatar answered Oct 24 '22 20:10

kaustavdm


Prelude recommends to use

(prelude-require-packages '(some-package some-other-package))

if you have several package. Or in case you want to add just one package:

(prelude-require-package 'some-package)

If you want you can still maintain your package list in a variable:

(setq my-packages '(drupal-mode nginx-mode toto-mode)
(prelude-require-package my-packages)
like image 43
AdrieanKhisbe Avatar answered Oct 24 '22 20:10

AdrieanKhisbe