elinstall

Last edit

Summary: Changed list formatting, it was backwards.

Changed:

< ** What it is

to

> * What it is

Changed:

< ** Why use it

to

> * Why use it

Changed:

< * It works with my-site-start (DotEmacsModular) (which I highly recommend)
< * It supports slash-style paths, like

to

> ** It works with my-site-start (DotEmacsModular) (which I highly recommend)
> ** It supports slash-style paths, like

Changed:

< * Unlike autoload.el, it can also set up load-path and

to

> ** Unlike autoload.el, it can also set up load-path and

Changed:

< * Unlike autoload.el, it's not focussed on building emacs, it's

to

> ** Unlike autoload.el, it's not focussed on building emacs, it's

Changed:

< * Unlike some other installers, it works with canonical

to

> ** Unlike some other installers, it works with canonical

Changed:

< * Unlike other installers, what you install doesn't have to be

to

> ** Unlike other installers, what you install doesn't have to be

Changed:

< * Because internally it works in articulated stages, it's easier to

to

> ** Because internally it works in articulated stages, it's easier to

Changed:

< * Because it supports plugins.
< ** Where to get it

to

> ** Because it supports plugins.
> * Where to get it


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)
	  (push 
	     (list pred func name)
	     emtt:test-finder:method-list)))
    ;;;###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:

    (elinstall
       "emtest"
       (elinstall-directory-true-name)
       '(load-path 
	   (all 
	      (block-in-subtree 
		 (  "^tests\\.el"
		    "^testhelp\\.el"
		    "^explorers$"
		    "^rtest\\.el"
		    "^vtests\\.el"
		    "^examples$"
		    "^qexamples\\.el")
		 t) 
	      ;;Explorer plugins use this to inform top about their
	      ;;existence
	      (def-file "emtest/runner/loadexplorers.el" nil
		 (dir "emtest/runner/explorers"))
	      ;;Runner plugins use this to inform clause.el about their
	      ;;existence
	      (def-file "emtest/runner/runners/def-runners.el" nil
		 (dir "emtest/runner/runners"))))
       t)