.----------.
configel |
`----------’
The purpose of the configel package is to auto-find and load other packages that exist in a directory or set of directories.
Is your .emacs (or equivalent) file too long? Or if you’re like me you broke it into pieces but then have to load each of those, which is still a management problem. This package takes care of this for you by allowing you to auto-load separate configuration files for each package and then auto-loading the package itself.
For example, the following configuration can be used to bootstap everything else in a given set of directories:
(setq configel-search-paths ‘(“~/lib/elisp/emacs”)) (add-to-list ‘load-path “~/src/configel”) (require ‘configel) (configel-load-everything)
Lets say the directory in question contained the following items:
org-mode.el org-mode/ other-package/ magit/ magit.el
Then the (default) results would be: ; first it will add org-mode/lisp to the load path (load “org-mode.el”) (require ‘org-mode)
; first it will add magit to the load path (load “magit.el”) (require ‘magit)
Note that ‘other-packgae’ is ignored by default because it doesn’t contain a corresponding .el file.
Lets say you have your lisp packages in ~/lib/elisp/emacs and you just found out about [http://www.orgmode.org/ org-mode] and want to check out the git repo and start playing with it.
Now you can store your personal config in the org-mode.el file and the next time you start emacs configel will find the directory, load your (currently empty) org-mode.el file and then load the main org-mode code set as well. Done!
By default if there is a .el file too above each sub-directory found in the configel-search-paths list of directories, the package will:
- add each directory to the search path (or dir/lisp if it exists)
- load the .elc or .el file above the directory
- perform a (require ‘name) if it could find one of:
- name/name.elc
- name/name.el
- name/lisp/name.elc
- name/lisp/name.el
- configel-search-paths: A list of paths to search for directories
- configel-load-every-package: If t (default is nil), it will load every directory found not just ones with .el files above it.
- configel-auto-require: If t (the default) it will try and perform a ‘(require …)’ statement to load the package after loading the .el config file.