Make the list of modules loaded by Prelude configurable.

Modules loaded by Prelude can now easily be adjusted via
the file `prelude-modules.el` in Prelude's installation folder.
To disable a module simply comment it out; conversely uncomment
a module to enable it.
This commit is contained in:
Bozhidar Batsov 2013-01-13 20:42:17 +02:00
parent 5a8a724abb
commit 29dc436b64
5 changed files with 70 additions and 24 deletions

1
.gitignore vendored
View file

@ -15,3 +15,4 @@ custom.el
places places
.smex-items .smex-items
savefile/ savefile/
/prelude-modules.el

View file

@ -46,6 +46,9 @@ Note that the installer will back up any existing `.emacs` file or
you're doing a manual install make sure you don't have a `.emacs` file you're doing a manual install make sure you don't have a `.emacs` file
or back up your existing `.emacs.d` directory manually. or back up your existing `.emacs.d` directory manually.
Don't forget to adjust your `prelude-modules.el` file once the installation is done.
By default most of the modules that ship with Prelude are not loaded.
## Installing Emacs 24 ## Installing Emacs 24
Obviously to use the Emacs Prelude you have to install Emacs 24 Obviously to use the Emacs Prelude you have to install Emacs 24
@ -86,6 +89,39 @@ You'd do well to replace `~/.emacs.d` with the value of
`user-emacs-directory` for your OS. You can check the value by doing `user-emacs-directory` for your OS. You can check the value by doing
`C-h v user-emacs-directory` inside Emacs. `C-h v user-emacs-directory` inside Emacs.
## Enabling additional modules
By default most of the modules that ship with Prelude are not loaded.
```lisp
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
(require 'prelude-c)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc)
;; (require 'prelude-erlang)
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-markdown)
;; (require 'prelude-mediawiki)
(require 'prelude-org)
(require 'prelude-perl)
;; (require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
;; (require 'prelude-scss)
(require 'prelude-xml)
```
You'll need to adjust your `prelude-modules.el` file once the installation is done.
## Running ## Running
Nothing fancy here. Just start Emacs as usual. Personally I run Emacs Nothing fancy here. Just start Emacs as usual. Personally I run Emacs

27
init.el
View file

@ -54,6 +54,8 @@ ELPA (or MELPA).")
"This folder houses additional yasnippet bundles added by the users.") "This folder houses additional yasnippet bundles added by the users.")
(defvar prelude-savefile-dir (expand-file-name "savefile" prelude-dir) (defvar prelude-savefile-dir (expand-file-name "savefile" prelude-dir)
"This folder stores all the automatically generated save/history-files.") "This folder stores all the automatically generated save/history-files.")
(defvar prelude-modules-file (expand-file-name "prelude-modules.el" prelude-dir)
"This files contains a list of modules that will be loaded by Prelude.")
(unless (file-exists-p prelude-savefile-dir) (unless (file-exists-p prelude-savefile-dir)
(make-directory prelude-savefile-dir)) (make-directory prelude-savefile-dir))
@ -90,28 +92,9 @@ Emacs load path."
;; the modules ;; the modules
(require 'prelude-programming) (require 'prelude-programming)
(require 'prelude-c)
(require 'prelude-clojure) (when (file-exists-p prelude-modules-file)
(require 'prelude-coffee) (load prelude-modules-file))
(require 'prelude-common-lisp)
(require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc)
(require 'prelude-erlang)
(require 'prelude-haskell)
(require 'prelude-js)
(require 'prelude-latex)
(require 'prelude-lisp)
(require 'prelude-markdown)
(require 'prelude-mediawiki)
(require 'prelude-org)
(require 'prelude-perl)
(require 'prelude-python)
(require 'prelude-ruby)
(require 'prelude-scala)
(require 'prelude-scheme)
(require 'prelude-scss)
(require 'prelude-xml)
;; config changes made through the customize UI will be store here ;; config changes made through the customize UI will be store here
(setq custom-file (expand-file-name "custom.el" prelude-personal-dir)) (setq custom-file (expand-file-name "custom.el" prelude-personal-dir))

24
sample/prelude-modules.el Normal file
View file

@ -0,0 +1,24 @@
;;; Uncomment the modules you'd like to use and restart Prelude afterwards
(require 'prelude-c)
;; (require 'prelude-clojure)
;; (require 'prelude-coffee)
;; (require 'prelude-common-lisp)
;; (require 'prelude-css)
(require 'prelude-emacs-lisp)
(require 'prelude-erc)
;; (require 'prelude-erlang)
;; (require 'prelude-haskell)
(require 'prelude-js)
;; (require 'prelude-latex)
(require 'prelude-lisp)
;; (require 'prelude-markdown)
;; (require 'prelude-mediawiki)
(require 'prelude-org)
(require 'prelude-perl)
;; (require 'prelude-python)
;; (require 'prelude-ruby)
;; (require 'prelude-scala)
(require 'prelude-scheme)
;; (require 'prelude-scss)
(require 'prelude-xml)

View file

@ -207,6 +207,7 @@ else
# Nothing yet so just install prelude # Nothing yet so just install prelude
install_prelude install_prelude
make_prelude_dirs make_prelude_dirs
cp $PRELUDE_INSTALL_DIR/sample/prelude-modules.el $PRELUDE_INSTALL_DIR
fi fi
if [ -z $PRELUDE_SKIP_BC ]; if [ -z $PRELUDE_SKIP_BC ];
@ -216,9 +217,9 @@ then
printf " Bytecompiling Prelude.\n" printf " Bytecompiling Prelude.\n"
if [ x$PRELUDE_VERBOSE != x ] if [ x$PRELUDE_VERBOSE != x ]
then then
emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/prelude/*.el emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/core/*.el
else else
emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/prelude/*.el > /dev/null 2>&1 emacs -batch -f batch-byte-compile $PRELUDE_INSTALL_DIR/core/*.el > /dev/null 2>&1
fi fi
else else
printf "$YELLOW Emacs not found.$RESET Skipping bytecompilation.\n" printf "$YELLOW Emacs not found.$RESET Skipping bytecompilation.\n"
@ -242,3 +243,4 @@ printf "$BBLUE | |_) | __/ _ \ | | | |/ _ |/ _ \ \n"
printf "$BBLUE | __/| | | __/ | |_| | (_| | __/ \n" printf "$BBLUE | __/| | | __/ | |_| | (_| | __/ \n"
printf "$BBLUE |_| |_| \___|_|\__,_|\__,_|\___| \n\n" printf "$BBLUE |_| |_| \___|_|\__,_|\__,_|\___| \n\n"
printf "$GREEN ... is now installed and ready to do thy bidding, Master $USER!$RESET\n" printf "$GREEN ... is now installed and ready to do thy bidding, Master $USER!$RESET\n"
printf "$GREEN Don't forget to adjust the modules you want to use in $PRELUDE_INSTALL_DIR/prelude-modules.el!$RESET\n"