SGML for Windows NT: Setting up a free SGML/XML editing and publishing system on the Windows platform | ||
---|---|---|
Prev | Next |
Emacs is the core component of the SGML/XML system. Due to its configurability and extensibility it will be the SGML and XML document editor and front-end to all related applications, just like an IDE for a programming language. Emacs is completely different from most other text editors in that it is basically a Lisp interpreter implemented in C and a whole bunch of Lisp files, which add most of the functionality.
NTEmacs is a port of GNU Emacs for the 32bit Windows platforms. The user interface retains most of the features of its Unix counterpart, so it takes some time to get used to it for the average MS Word user. However, there are quite a few tutorials and an extremely helpful reference card for the most important commands to get started quickly. There are some important things that you should know right now to understand what is happening during the installation below.
Emacs is installed in a set of directories which will be automatically created when unpacking the archive. The \bin subdirectory holds the executables. The \lisp subdirectory holds all the Emacs Lisp code which turns Emacs into what it is. The \site-lisp subdirectory is a nice place for the configuration files site-start.el and default.el (see below).
Emacs is configured by a set of startup files. As Windows NT is a multi-user system just like Unix, there are system-wide configuration files as well as user configuration files. When Emacs is started, it first reads a file called site-start.el. This file is meant to hold all the system-wide configuration data that users may override by their personal configuration files. It next reads the personal configuration file _emacs of the current user (NTEmacs also accepts the Unix-style .emacs, but you should be aware that files with a leading dot may be ignored by file-handling software like backup utilities, thus giving a new meaning to the leading dot as a hiding attribute on Unix systems). This file should contain personal modifications like color schemes, mail- or newsserver configuration or code to load specialized packages that other users on the system don't need. Finally it reads the file default.el, which can be used for code that users normally should not be allowed to override. If Emacs doesn't find any of these files, it starts up with sensible defaults which allow to access the basic functionality (and this is more than you'd expect).
As the built-in Help->Customize feature affects only the _emacs file of the current user, we will make all configuration changes in this file throughout the whole tutorial. To turn this file into a system-wide configuration file, it is sufficient to move the contents or part of the contents from this file to your site-lisp.el or default.el afterwards.
As Emacs reads the startup files only at startup, it is necessary to reload them after they were changed. The least elegant but safest way to do this is to restart Emacs.
Due to its Unix heritage, Emacs accepts and sometimes expects path denominators in Unix style with forward slashes instead of the DOS-style backslashes. If you use backslashes in Emacs Lisp, be aware that this is a special character: the escape character. You'll need two consecutive backslashes to get one in the end, as in DOS-style paths.
Also due to its Unix heritage, Emacs relies on the presence of a HOME environment variable which denotes the home directory of the current user. This may be any valid path that the user has write access to, including directories on network drives. When typing in paths, e.g. upon loading a file, the home directory can be abbreviated as ~.
Emacs uses major and minor modes (defined in an .el/.elc file or in a set of such files) to add functionality which is not present by default.
The Emacs Lisp source files (.el) can be byte-compiled (.elc) to increase the speed of execution. To minimize the archive size, the NTEmacs distribution contains only the byte-compiled versions. To modify the code or to learn from the code, you will have to download the sources separately.
Instead of dialog boxes Emacs uses the minibuffer (the last line in the Emacs frame) to display messages and to enter commands. This command-line has many features in common with Bash (a widely used Unix shell), e.g. completion with the tab key and a sort of an argument history.
Gnuserv is a small utility which greatly simplifies the use of Emacs. If you associate file types with Emacs, each double-click on an associated file will start a new copy of the editor, thus wasting time and memory. Gnuserv allows to open such files in a running copy of Emacs, and it will create a new frame for the file if you wish so.
Although not directly related to Emacs, we will also install Ghostscript (a PostScript interpreter) and Ghostview (a graphical frontend for Ghostscript including a previewer) at this point. These tools are useful to preview PostScript documents and print them on non-PostScript printers. We need this feature in this and the following chapters to view or print useful help files. At a later stage you will be able to create PostScript documents from your SGML source documents.
NTEmacs version 21.1. This contains the precompiled lisp files, but not the Lisp sources. If you want to edit the Lisp source code (or just want to learn from it), you can download the bigger full release instead.