![]() |
Customizing TeXmacs | ![]() |
One major feature of TeXmacs is that it can be highly customized.
First of all, the most important aspects of the program can be configured in
Like
http://www.gnu.org/software/guile/guile.html
If you have downloaded the source files of TeXmacs, then it may be interesting for you to take a look at the files
Guile/Glue/build-glue-basic.scm
Guile/Glue/build-glue-editor.scm
Guile/Glue/build-glue-server.scm
These three “glue” files contain the C++ routines, which
are visible within
When starting up, TeXmacs executes the file
$TEXMACS_PATH/progs/init-texmacs.scm
as well as your personal initialization file
$TEXMACS_HOME_PATH/progs/my-init-texmacs.scm
if it exists. By default, the path $TEXMACS_HOME_PATH equals .TeXmacs. Similarly, each time you create a new buffer, the file
$TEXMACS_PATH/progs/init-buffer.scm
is executed, as well as
$TEXMACS_HOME_PATH/progs/my-init-buffer.scm
if it exists.
You may define (or modify) a (part of a) menu with name name using
(menu-bind name . prog)
and append new entries to an existing (part of a) menu with name name using
(menu-extend name . prog)
Here prog is a program which represents the entries of the menu. In particular, you may take a look at the files in the directory
$TEXMACS_PATH/progs/menu
in order to see how the standard TeXmacs menus are defined.
More precisely, the program prog in menu-set or menu-append is a list of entries of one of the following forms:
(=> "pulldown menu name" menu-definition)
(-> "pullright menu name" menu-definition)
("entry" action)
---
(if condition menu-definition)
(link variable)
The constructors => and -> are used to create pulldown or pullright menus and menu-definition should contain a program which creates the submenu. The constructor ("entry" action) creates an ordinary entry, where action will be compiled and executed when you click on entry. Items of a menu may be separated using –-. The constructor if is used for inserting menu items only if a certain condition is satisfied (for instance, if we are in math mode).
Finally, if you declared a menu name, then you may use this menu indirectly using the link constructor. This indirect way of declaring submenus has two advantages
The main TeXmacs menus are texmacs-menu, texmacs-popup-menu, texmacs-main-icons, texmacs-context-icons and texmacs-extra-icons. Other standard indirect menus are file-menu, edit-menu, insert-menu, text-menu, paragraph-menu, document-menu, options-menu and help-menu.
Keymaps are specified using the command
(kbd-map . keymaps)
Optionally, you may specify conditions which must be satisfied for the keymap to be valid using the :mode option. For instance, the command
(kbd-map (:mode in-math?) . keymaps)
specifies a list of keyboard shortcuts which will only be valid in math-mode. Each item in keymaps is of one of the following forms:
(key-combination action_1 ... action_n)
(key-combination result)
(key-combination result help-message)
In the first case, the action_i are
Some other files may also be worth looking at: