Software notes: XEmacs with Win32

XEmacs is tricky to configure on *n*x systems, and trickier on windoze. These are my notes on making it work as I like it.

Home directory

A home directory is required for many of XEmacs advanced functions, including custom configuration files. This exists by default on most *n*x systems, but not windoze, on which it should look something like c:\user\. There must also be an environment variable called HOME containing the path to the home directory. Create the home directory via Start... Settings... Control panel... System... Advanced... Environment Variables.... To make the HOME variable appear immediately as well, from a command prompt enter (in this case)

set HOME=c:\user

Create a further directory in the new HOME directory called .xemacs. Do this from a command prompt as the Windows GUI rejects names starting with a dot.

c:\user>mkdir .xemacs

Top of page

Line and column numbers

Unlike many nerdy text editors, XEmacs does not by default display the cursor's line or column number. To toggle them, M-x line-number-mode and M-x column-number-mode, or in init.el add either or both of these:

(line-number-mode 1)
(column-number-mode 1)

Top of page

Abbreviation files

read-abbrev-file to load an abbreviation list.

edit-abbrevs to edit the abbreviation list.

write-abbrev-file to save an abbreviation list.

Add quietly-read-abbrev-file <filename> to .emacs to load an abbreviation list.

If the abbreviation file is in the home/.xemacs directory, it can be loaded at startup by adding this line to the init.el startup file.

(quietly-read-abbrev-file "~/.xemacs/scodes.abb")

Top of page

LilyPond extensions

LilyPond (version: 2.9.24) comes with Emacs extensions which include syntax lighlighting; these also work with XEmacs. From the LilyPond directory usr/share/emacs/site-lisp, copy the lilypond*.el files to the XEmacs directory lisp.

To load the extensions at startup, add these lines to init.el. The first line is a bugfix because xargs isn't needed (and doesn't normally exist) on Win32 systems.

(setq grep-find-use-xargs nil)
(load "lilypond-init.el" nil t t)

Top of page

Aspell

(This worked on an office PC I tried it on with an earlier version of XEmacs but not on a second, "home" PC running 2.4.18.)

Download from aspell.net the Win32 version of the aspell binary (current version: 0.50.3) and as many of the dictionaries as you need and install them.

Add the path to the Aspell binary (typically c:\program files\aspell\bin\) to the PATH environment variable.

By default, XEmacs looks for the ispell spellchecker. To change this, add these lines to the file custom.el in the .xemacs directory.

;; Aspell
(setq-default ispell-program-name "aspell")

Thanks to Sridhar Lavu for working out much of the aspell stuff.

Top of page

HTML syntax highlighting

XEmacs comes with a lot of language-specific stuff, but for some reason the HTML-relevant parts (including syntax highlighting) has disappeared from version 21.4.18 for Win32. To restore it, the package files psgml-1.44-pkg.tar.gz and psgml-dtds-1.03-pkg.tar.gz need to be unpacked (preserving their internal directories) into the local package archive (normally c:\program files\XEmacs\Packages\xemacs-packages.

Top of page

Installing ESS

ESS ("Emacs speaks statistics") is an [X]Emacs mode for statistics software such as R, S and SAS. There's more than one way of installing it, this works for me:

(setq inferior-R-program-name "C:/progra~1/R/R-2.7.0/bin/rterm.exe")
(load "c:/progra~1/xemacs/packages/site-packages/ess-5.3.7/lisp/ess-site")

Top of page

About XEmacs

XEmacs is a multi-purpose text editor available from www.xemacs.org.

Document history