Installing emacs lisp packages

Emacs is a large program with lots of possibilities. For Emacs to be able to use STORE, we have to make some changes to Emacs. Most of the changes are done when installing Emacs, seeing to that it is compiled with the correct load-path, options and X libraries. We must also make sure that the DOC-file is identical on all architecture (or that we use DOC-files with an unique suffix for each type of architecture.

You also need special conventions to handle the installation of emacs-lisp packages. Emacs should be compiled with the following load-path: /store/elisp /store/emacs/elisp. This enusres that we have at least two alternative directories in which to place emacs-lisp code. This gives us the possibility of overriding emacs-defaults by installing files with the same name in /store/elisp. Usually we are installing completely new packages. In which case we usually install them in /store/emacs/lisp.

For new packages to be accessible to Emacs, we need to insert code which will be run by Emacs on startup. There are two ways of handling this: the first one is to let users install code in their personal ~/.emacs file. The second is to make code being included in the /store/emacs/lisp/default.el file.

For an application like e.g. auc-tex, which radically changes the the behaviour from the standard TeX-mode, it's p[robably best to let individual users install the start-up code themselves. How to do this is well documented in the auc-tex emacs info file. In this sample installation we only install the lisp files under .../auc-tex/ver-6.1/emacs/lisp and leave it up to the user whether or not to use them.

For other packages it may be more suitable to make the installation common to all users. Since each package needs to have a few lines inserted into default.el, this file is generated automatically from the different emacs-lisp applications' pieces of code. The STORE convention is to make each application have a file .../app/ver-ver/emacs/lisp/default.el-app. These files are then concatednated to create the final default.el file.

An example: The application "term-lock" is very simple. It consists of a simple emacs lisp file, which let you lock your emacs (on a terminal) using a simple password. The file defines the function M-x term-lock. To make it publically available we create the file .../ver-90/emacs/lisp/default.el-term-lock containing the line:

(autoload 'term-lock "term-lock" "Lock the terminal" t)

A somewhat more advanced example is the USENET newsreader "GNUS". This newsreader has a lot of files we install in the .../ver-3.13/emacs/lisp directory. Also GNUS has a couple of functions we wish to publicise by inserting autoload lines as above. We create a default.el-gnus file with the following contents:

(autoload 'gnus "gnus" ""
Read network news." t)
(autoload 'gnus-post-news "gnuspost" ""
Post a news article." t)
(defvar gnus-use-generic-from t)
(defvar gnus-nntp-server "ugle.unit.no")
(defvar gnus-use-generic-path "imf.unit.no")
(defvar gnus-your-domain "imf.unit.no")
(defvar gnus-your-organization "Norwegian Institute of Technology")

As you can see from the contents, having the same version of this file for all sites using the same STORE system will create undesirable effects. We threfore split the file on the basis of the link tree name, making it specific for each organization using ut. Strictly speaking this gives us an overhead since separate machines in the same orgranization may need separate files. This files will be residing in the same master directory and can thus be easiliy maintained.

The contents of the directory /store/store/khym/gnus/ver-3.13/emacs/lisp will look like this:

default.el-gnus@chanur    gnus-user-sxa.el     gnuspost.elc
default.el-gnus@flory     gnus-user-tale.el    mhspool.el
default.el-gnus@hitra     gnus.el             mhspool.elc
default.el-gnus@hufsa     gnus.elc            nnspool.el
default.el-gnus@ild       gnusmail.el          nnspool.elc
default.el-gnus@kari      gnusmail.elc         nntp.el
default.el-gnus@khym      gnusmisc.el          nntp.elc
default.el-gnus@lise1     gnusmisc.elc         tcp-not-needed.el
default.el-gnus@tootikki  gnuspost.el          tcp-not-needed.elc

Luckily GNUS use a simple ASCII file for the configuration. Applications with the domain name compiled into them are much more difficult to handle in this system.

Up : Installing software in STORE, Previous: Example installation: Xgopher, Next : Example installation: ange-ftp.

Index

arnej@lise.unit.no