XEmacs Site-Wide Configuration

This is the site-wide configuration for XEmacs on systems I administer (I merge it into my .emacs (source) on systems I don't administer). It's quite large and quite complex, and does lots of things, but these things don't change the `default look' of XEmacs all that much (except for setting default colours). The few changes that it does make (autoloading the desktop and doing keybindings) can all be disabled from users' .emacs (or your .xemacs/init.el, the horrible new name for XEmacs's startup file).

It is rather more complex than it needs to be; it jumps through numerous hoops to avoid having to copy code from packages, change code in packages, or load packages before they are actually needed by the user (even if it customizes the behaviour of those packages). (Changing the source code for packages that come with XEmacs, while possible, is inadvisable, because when the packages are upgraded, such changes are liable to disappear.)

Only in a few cases have packages provided with XEmacs been replaced completely; in those cases, it is normally because I have rewritten them from the ground up...

For an example of a personal configuration which makes XEmacs look rather different, see my personal configuration.

Everything here goes into the site-lisp directory, which is normally /usr/lib/xemacs/site-lisp, but can also be /usr/lib/xemacs/site-packages/lisp.

(Thanks to Hrvoje Niksic for htmlize.el, which was used to HTMLify all this Lisp code.)

The files are mostly wrapped to roughly 80 characters, but the Lisp may wander some distance beyond that. Sorry, 80x24 users.

site-start.el (source)
This file runs first; it does a few requirements that don't fit anywhere else, then loads in everything else.
gawd-misc.el (source)
This sets a bunch of miscellaneous, non-mode-specific variables, and defines `inhibit-default-init-portions', which can be used to suppress many of the things that are normally done automatically (keybindings, desktop saving and so forth.)
gawd-faces.el (source)
This sets the screen colours. I like dark backgrounds with light text; this editorial is a fairly good explanation of why that is a better choice of colours than the paper-simulation of Word and friends. It also sets ludicrously overblown colours for the wonderful ediff mode, for the emacs-w3m, XEmacs web browser, and for the buffer tabs and help balloons. Finally, it gives the echo area a face of its own, to fix the user-interface annoyance factor caused by echo area messages appearing while you're working in the minibuffer.
gawd-mode-frobs.el (source)
This sets huge quantities of mode-specific stuff. Major changes include: It's much too large, and really needs splitting up.
gawd-keys.el (source)
This does lots of keybinding work, setting up support for all sorts of things under VT100 emulators with suitable macros, and providing an easy way to set keybindings at startup (the `gawd-key-bind-alist' variable). It also implements an `event-apply-modifier' that can apply special keys to anything, rather than to a subset of keys the user presses.
default.el (source)
This code runs after the .emacs; it applies things that the `inhibit-default-init-portions' allow it to.

There are other files in my site-wide config, too, which aren't strictly part of my XEmacs configuration per se, but rather things that can be used as XEmacs runs, but which either I didn't write, or are in some way ancillary. These are the ones that are either unusual, or modified from their canonical copy.

c-font-lock-keywords.el (source)
This is Chris Holt's work of insane genius, a system to syntax-highlight (`fontify') C and C++ code properly. It is very slow.
fff.el (source)
This is Noah Friedman's Fast File Finder, which lets you quickly find files in a variety of databases.
uncompress.el (source)
This is a heavily modified copy of the standard automatic uncompression code that comes with XEmacs; unlike the standard code, it can handle any number of compression formats; see the variable `uncompress-program-alist'. In my standard configuration, it is dumped with XEmacs.
type-break.el (source)
This is a modified version of Noah Friedman's anti-RSI code, which tells you to take a typing break after you've typed a lot, or if you've been typing for a long time without a pause. The modifications make `type-break' a lot more efficient by using the XEmacs internal `num-input-chars' variable; it doesn't slow typing down detectably anymore.
vi-dot.el (source)
This is a modified copy of Will Mengarini's mode which provides functionality like the `.' command in vi in Emacs. This version has been ported to XEmacs by myself; see the post to the xemacs-beta mailing list about it. It is bound by default in my gawd-keys.el to `C-x z', but should you want to rebind it, as is done in my .emacs (source). It needs a patch to the XEmacs core to work.

And there are lots of other packages I've installed that I haven't mentioned above. A list:

boxquote browse-kill-ring globrep whitespace fsf-morecompat hack-locals obarray-fns arrange pls-mode structured-regexp remember

All of these modes are on the Emacs Lisp List.

However, even with all of this, you still can't actually build XEmacs as I do; and if you want to clone my configuration on another system (perish the thought), you'll need to do that.

The important parts of the build system are as follows:

The site-packages file. (source)
This lists the packages (beyond the standard ones) that are `dumped' into XEmacs; that is, built into the XEmacs binary. Dumping packages is a good thing because it reduces the memory usage of XEmacs when multiple people are using it at the same time, but it is disadvantageous because not all packages can be dumped, because you can't `unload-feature' dumped packages, and because you have to rebuild XEmacs whenever you upgrade a dumped package. If this file is to take effect, it must be located both in the build directory and in the XEmacs source directory when XEmacs is built. (This duplication is a bug.)
The configuration switches (source)
These switches are passed to the XEmacs `configure' script to turn on things that I think are useful. (In addition, I have an extremely ugly site-config script (source) that sets CFLAGS and so on.)
The patches
A number of patches need to be applied to the XEmacs source tree before it can be built with the configuration above. The patches are in unified diff format, so only GNU patch is likely to be able to apply them.
num-input-keys.diff (source)
A patch that adds a `num-input-keys' built-in variable to XEmacs, paralleling the variable of the same name in GNU Emacs. It is needed by the `vi-dot' package. It, and the changes to `vi-dot.el' itself, were posted to comp.emacs.xemacs and to the xemacs-beta mailing list recently.
num-input-chars.diff (source)
A patch that adds a `num-input-chars' built-in variable to XEmacs, which is sort of like `num-input-keys', except that it counts physical keystrokes rather than key sequences. It is needed by my improved-efficiency `type-break' package.
xemacs-quash-sound.diff (source)
This tiny patch turns the console beep off if its volume is set to zero. Useful for TTY users.
These patches are against XEmacs-21.5.28, in the main.

As a throw-in extra, a couple of other vaguely useful patches, which aren't important enough to post to the mailing lists, or that have been posted there but haven't been applied in a released XEmacs yet, or that stand an ice-cream cone's chance in hell of being applied to the stable XEmacs tree, or that have been posted and applied but not widely deployed yet:

xemacs-buffer-replace-char-cache-fix.diff (source)
This patch fixes a bug that can lead to line numbers getting wildly askew, especially when using hideshow-mode, folding-mode or similar modes that involve lots of use of selective-display (although the bug itself is not related to selective-display, but rather to `subst-char-in-region'). The patch has been posted to xemacs-patches, but seems to have been overlooked.
disabled-command-hook-symbol.diff (source)
This patch fixes a silly bug that stops you from putting any function not called `disabled-command-hook' onto the hook variable of that name.
mark-even-if-inactive.diff (source)
This patch implements the rather nice `mark-even-if-inactive' variable for XEmacs, with the same effect as the GNU Emacs variable of the same name.

Finally, some patches that have been applied, in case you can't or won't upgrade (shame on you!)

uniquify-super-ignore.diff (source)
This patch fixes a bug which makes uniquify automatically rename buffers with `buffer-file-name's very different from their `buffer-name's. This breaks some buffers, like buffers in info-mode. The patch has been posted to xemacs-beta, and applied in the current XEmacs sumo packages.
timer-now.diff (source)
This patch handles the case where someone calls `timer-set-time' with a time before the current one. It is present in versions of the XEmacs fsf-compat package released after 2002-03-24.
multi-height-glyphs.diff (source)
This patch fixes a silly redisplay bug which leads to glyph positions and baselines getting miscomputed whenever there are multiple glyphs of different heights on the line, and that leads to the baseline of the text getting miscomputed whenever the tallest glyph on the line has an automatically computed baseline. If you see images `up in the air' or text baselines jumping around like a mad thing, this patch is for you. The patch has been posted to xemacs-patches, and is present in XEmacs-21.4.9 and later. If you are using preview-LaTeX, and a version of XEmacs earlier than that, then you really do rather need this patch if things aren't to look disgusting.
dead-processes.diff (source)
This patch fixes a huge race condition in process liveness detection in XEmacs. preview-LaTeX (and any other process doing time-intensive things and process communication at the same time) will benefit from this. The patch has been posted to xemacs-patches, and is present in XEmacs-21.4.8 and above. (A thoroughly broken version is present in XEmacs-21.4.7; the brokenness of this version led to the release of 21.4.8.)

Nix

Last modified: Fri Aug 17 21:33:41 BST 2007