Emacs + psgml  ☑

GNU Emacs is a plain-text editor and work environment by Richard Stallman, with a macro and programming facility using a dialect of Lisp, used extensively for the creation of add-on packages. Emacs 20.7 for Windows 95 and NT was installed from the GNU archive.

The psgml-mode package by Lennart Staflin is an Emacs major mode for SGML and XML which parses the DTD (a requirement in SGML). At the time it provided the only free and unencumbered fully-featured SGML editor.[4] Installation of various versions of psgml were tested to find one which was compatible with the 20.7 version of Emacs, as at that time there was no package library synchronisation. Version 2.12 worked with the removal of the compiled form of the psgml-other.elc file, which was the only code mismatch. Installation would normally be via the Emacs package system,[5] or by using the Makefile in a downloaded psgml distribution, or (in the test case under Windows) by copying the files to a suitable directory manually.

Figure 4. Emacs with the sample document before and after normalization

Emacs with the sample document before and after normalization

A setting in the user’s .emacs configuration file can make Emacs invoke psgml-mode automatically for files ending in .sgml or other extensions. The DTD is tokenised and the result used to guide the user’s selection of element types via a menu or with TAB completion, and the use of attributes via a subsidiary window. Manipulation of markup in context as with any other syntax-directed editor is done from the menus or with keystroke abbreviations.

[4] Arguably, it still does, and for XML as well.

[5] The package has recently and inexplicably been withdrawn from the current repositories.