Updated 2013-01-26 23:00:11 by RLE

The open-source library of Tcl scripts driving the Alpha text editors (Alpha8 for Mac OS9, AlphaX for OSX, AlphaTk for any platform).

According to the AlphaTcl Wiki at http://alphatcl.sourceforge.net, AlphaTcl contains more than 170000 lines of code.

Much of this code is probably rather useless outside Alpha, because it relies on Alpha's text rendering engine and windows management routines, involving for example Alpha commands like 'getPos', 'goto', 'selectText', 'killWindow', etc. (OTOH, AlphaTk demonstrates that it is possible to emulate these commands in pure Tcl/Tk, if one really wants to.)

There are however also many packages in AlphaTcl that are rather abstract and not very text-editing related, e.g.

  • interaction with an smtp server / a Tcl interpreter / a TeX installation,
  • file scanning,
  • diffing,
  • file management,

etc.

Excerpt from the Alpha Manual:

Differences between 'Alpha' and 'AlphaTcl'

The program Alpha has two parts: one compiled binary part and a big library of scripts written in Tcl (Dr. Ousterhout's Tool Command Language). The binary part handles windows, mouse movements, and all such, and then it has a built-in Tcl interpreter which drives the second part AlphaTcl, the vast library of Tcl scripts that provide most of Alpha's functionality. Most editing functions, actions taken when a menu item is selected or a key combination is pressed, and all of Alpha's packages and extensions are implemented in Tcl. With this design it is easy to configure and extend Alpha --- anybody can tweak Alpha's behavior by modifying Tcl functions, or extend Alpha by writing a new package!

Of course, you don't have to learn Tcl to use Alpha --- Alpha is designed to be operated through a graphical user interface, and in normal operation you will never be confronted with Tcl. But if you want to become a real power user, you should consider taking a look at Tcl --- it is one of the easiest scripting languages to learn. Then the possibilities of customizing Alpha are unlimited.