An installer for elisp code. It sets up autoloads, load-path, etc.

There are other package installers and there is “autoload.el”, bundled with emacs. Why use elinstall? Because:

It lives at http://repo.or.cz/w/elinstall.git and it will also be available thru ELPA.

How to autoload plugins with elinstall

Sometimes a large package will want to have plugins, optional modules that relate to the package in a specific predefined manner. That’s difficult to support in emacs. You can write autoloads for each one, but how do you tell the large package which plugins are available? How do you arrange it so that your users can put a plugin into the appropriate directory and have it just work?

Elinstall makes that possible and not all that hard. Here’s how I do it for Emtest:

    (defun emtt:add-explorer (pred func &optional name &rest dummy)
       "Add an explorer to our alist of explorers"
       (unless (assq pred emtt:test-finder:method-list)
	     (list pred func name)
    ;;;###autoload (emtt:add-explorer #'emthow:form-p #'emtt:explore-literal-clause
    ;;;###autoload "Literal clause") 
    ;;;###autoload (unless (fboundp 'emtt:add-explorer)
    ;;;###autoload   (error "emtest/runner/explorers/all must be loaded"))
    ;;;(Other stuff here)
    ;;;###autoload (provide 'emtest/runner/loadexplorers)
    (def-file "emtest/runner/loadexplorers.el" nil
	     (dir "emtest/runner/explorers"))

For reference, Emtest’s entire elinstall call looks like:

		 (  "^tests\\.el"
	      ;;Explorer plugins use this to inform top about their
	      (def-file "emtest/runner/loadexplorers.el" nil
		 (dir "emtest/runner/explorers"))
	      ;;Runner plugins use this to inform clause.el about their
	      (def-file "emtest/runner/runners/def-runners.el" nil
		 (dir "emtest/runner/runners"))))