Emacs: making modular your config file.
Q. What type of configuration do we prefer? It's better a very long singol file or many small files?
A. Many small files for us and one (better if byte-compiled) very long file for emacs.
Emacs Modular Configuration lets you split your emacs configuration within of a (configurable) ~/.config/emacs/emc/config directory. When you're ready, simply call emc-merge-config-files and all the .el files under that directory tree will merge on a (configurable) ~/.emacs.d/emc/emc-config.el. Lastly, this file will be byte compiled, so all you need to write on your Emacs initalization file (e.g. ~/.emacs or ~/.emacs.d/init.el) is:
(load "~/.config/emacs/emc/emc-config")Note: the directory tree ~/.config/emacs/emc/config will be visited recursively using the BFS algorithm and in alphabetical order.
- copy
emacs-modular-configuration.elin a directory which is in the Emacsload-path - write on your Emacs initalization file (e.g.
~/.emacsor~/.config/emacs/init.el):
;; Emacs Modular Configuration entry point
(require 'emacs-modular-configuration)
(load "~/.config/emacs/emc/emc-config" t)- write a bit of
.elfiles within~/.config/emacs/emc/configdirectory tree - use
emc-merge-config-files
Next time you start Emacs, you'll load the ~/.config/emacs/emc/emc-config.elc file. That's all.
M-x customize-group and then modular-configuration.