General architecture of the Scheme API

When programming Scheme extensions of TeXmacs, it may be useful to be conscious of the internal architecture of the Scheme modules inside TeXmacs (see figure ?).

Figure 1. Schematic organization of the Scheme API.

Built-in Scheme commands

On the very basic level, one has the standard Scheme language, with some enhancements by the Guile implementation (these extensions are used as least as possible, for future portability). The standard Scheme language is enriched by some routines implemented in the C++ part of TeXmacs and exported to Scheme via the glue. If you unpacked the source code of TeXmacs in source-dir, then you can find a full list of the routines exported by the glue in the files

    source-dir/src/Guile/Glue/build-glue-base.scm

source-dir/src/Guile/Glue/build-glue-editor.scm

source-dir/src/Guile/Glue/build-glue-server.scm

Extensions to Scheme and further utilities

Above the standard Scheme language and the extra routines from the glue, TeXmacs comes with a second level of language extensions, utilities and libraries. The corresponding Scheme files can be found in the directories

    $TEXMACS_PATH/progs/kernel

$TEXMACS_PATH/progs/utils

Roughly speaking, the functionality provided by this second level is the following:

Whereas the modules in $TEXMACS_PATH/progs/kernel are automatically loaded, all modules in $TEXMACS_PATH/progs/utils have to be explicitly included.

Internal modules and plug-ins

The remaining Scheme extensions of TeXmacs are regrouped into internal modules which usually correspond to a particular type of content. For instance, the directories

    $TEXMACS_PATH/progs/source

$TEXMACS_PATH/progs/math

$TEXMACS_PATH/progs/table

respectively contain routines for editing source code, mathematics and tables. Exceptions are the internal modules content and fonts, which rather correspond to a particular type of functionality. Each internal module corresponds to a group of files, each of which corresponds to an individual TeXmacs module. The internal modules are designed to be as independent as possible.

From the Scheme point of view, the structure of a plug-in is very similar to that of an internal module. Each plug-in defines a collection of Scheme programs in its progs subdirectory. Although distinct plug-ins may in principle depend on each other, they are usually designed in a way which makes them as independent as possible.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".