Pygmy Mode

(edited 30 January 2004)

pygmy.el (version of January 30, 2004) (19K)
(Modified BSD/MIT/X-style license)

The "next generation" of Pygmy Forth that I am using in my embedded systems work has some colorForth aspects, although I haven't been willing to go all the way.

As part of experimenting with some of these ideas, I have made a Pygmy Mode colorForth-esque block editor for use with the Emacs editor. It allows you to edit source and shadow blocks and to tag words with colorForth meanings and colors such as "name" (red), "compiled" (green), "variable" (purple). By default, words will be tagged in green.

Pygmy Mode uses an ordinary text file rather than a traditional 1KByte block file. Still, for source code, Pygmy Mode gives you much the flavor of a block editor, but without restricting a block to a fixed size. The plan, of course, is to keep the blocks short.

This is a first release and comments and suggestions, including everything from typos to Emacs conventions to bug fixes, are welcome. At the very least, the number of tags must be increased. You can reach me at pygmy@pobox.com.

Logical blocks consist of a pair of physical blocks (a source block followed by a shadow block). In Pygmy Forth 1.5, source and shadow blocks can be alternated between with Ctrl-A. In Pygmy Mode in Emacs, the same thing is accomplished with Ctrl-c Ctrl-a (usually written as C-c C-a). Physical blocks are separated by pagefeed characters (^L). Pygmy Mode automatically "narrows" the view to the currently selected block whenever you move to the next or previous or alternate block. You can page through the blocks with PgUp and PgDn just as in Pygmy Forth 1.5 (or with M-n and M-p as alternate keystrokes).

In describing Emacs keystrokes, a leading "C-" followed by a character means to hold the Control key down while pressing the character. Similarly, a leading "M-" means to hold the "meta" key (usually the Alt key) down while pressing the character. Thus, "M-n" means the same as "Alt n".

Of course, you have the full facilities of Emacs available for editing the file. If you wish to see the entire file, just execute the Emacs command "widen".

Here are some of the commands available and the keystrokes they are attached to at the moment. You may, of course, rebind them to other keystrokes if you wish:

I expect to add additional tags and possibility to delete a block. Currently, you can delete blocks by running the "widen" command and deleting the text as you would in a text file.

Return to my home page