forsyth@uunet.uu.net (03/15/89)
Someone was asking about alternative text editors for Suns. Many of us use Rob Pike's editor `sam', which is available from the AT&T Toolchest; it was very good value when we bought it. The distribution includes support for Sunview, X11, 5620, and AT&T 630. The interactive part & the editor proper are separate programs which can be run on different machines. Even with NFS, the superior performance to be had by doing file IO where the files are makes that worthwhile, especially with 1 MIP on the desk for interaction and 7-10Mips & lots of memory near the files for editing. sam provides editing using both mouse & command language; they do not conflict, they co-operate. The mouse language is the usual cut & paste variety. The command language has ``structural regular expressions'' at its heart. sam's regular expressions can cross line boundaries. Commands are built much like Unix pipelines: one command passes a refined view of its data to the next. Commands can act on text selected by the mouse. Many files can be edited at once in a number of rectangular frames within a sun window. Several frames can be open on one file. Text can be cut & pasted from one frame to another, and can be exchanged with tty windows (on Sunview; I'm not sure about X). One frame is the command frame: text (command text) in that frame is edited using the mouse in the same way as on text elsewhere. With this, and sam's general ``undo'' request, it is easy to retract & repair incorrect commands, or more often, work out a complicated change a bit at a time interactively. Because the elements of sam's command language were carefully chosen to work together well, a command language with a tiny fraction of the number of specialised commands in some other editors (all sam's commands have printable names!) is considerably more powerful than it might first appear. I am afraid this short note does not begin to do sam justice. The distribution comes with a good introduction to the command language. Here are some references: %T Structural Regular Expressions %A R. Pike %J European UNIX Systems User Group Autumn Conference %C M/S Mariella, Helsinki, Finland - Stockholm, Sweden %D May 1987 %P 21-27 %T The Text Editor \fIsam\fR %A R. Pike %J SOFTWARE - Practice and Experience %V 17 %N 11 %P 813-845 %D November 1987 Pike deserves a place in the Honours List, for serv. to edtng. ukc!minster!forsyth forsyth@minster.york.ac.uk