This repository has been archived on 2022-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
emacs/emodule
2021-09-24 14:53:57 +02:00
..
emodule.el Correctly handle installed packages and custom file 2021-09-24 14:53:57 +02:00
README.org Make config use user-emacs-directory instead of hard-coded value 2020-04-05 23:45:45 +02:00

EModule

EModule (Emacs Module) - is a small add-on to Emacs that helps manage personal configuration by splitting it into manageable modules. It goes beyond simply splitting configuration across multiple files by also managing the installation and removal of packages.

This was inspired by Spacemacs' automatic package management with layers. However, adding additional configuration to an existing layer, or creating a new layer required some ramp-up in how they work. By developing something simpler, the hope was to have something close in simplicity to just writing a basic init file, with the additional benefit of automatic package installation and removal.

Usage

Import the package:

(add-to-list 'load-path (concat (file-name-as-directory user-emacs-directory) "emodule"))
(require 'emodule)

Define one or more modules in the modules directory (by default <user-emacs-directory>/modules). The module MODULE, is expected to be defined in a file called MODULE.el which will define the list of required packages in emodule/MODULE-packages and any accompanying initialisation in the function emodule/MODULE-init.

Finally, invoke emodule/init from your init file:

(emodule/init '(MODULE
                ...))

This will install all the required packages (including all dependencies), remove any packages that are no longer required (i.e. packages that are no longer explicitly listed as required and are not a dependency of some other required package), and invoke all the initialisation functions.

There is also emodule/init-debug, which will not install/remove packages so you can comment out modules to help you in debugging your init file.