TweetFollow Us on Twitter

Alpha
Volume Number:10
Issue Number:7
Column Tag:Tools of the Trade

Alpha - An Adaptable Programmer’s Editor

Don’t let that shareware label fool you - this editor’s feature-rich and powerful

By David Rogers, Aldus Corporation

About the author

A programmer for fifteen years, David is a software engineer at Aldus, and lives with his wife, two small children, and a cocker spaniel in Issaquah, Washington.

[About the article:When we made mention in comp.sys.mac.programmer of the review of programmer editors in our June issue, David was quick to let us know that we had missed one. Sure enough, Alpha is a contender, and David was good enough to write up an introduction to Alpha for us - Ed stb]

Overview

Alpha is a shareware programmer’s editor for the Macintosh with a wide range of capabilities. Alpha is a product of Pete Keleher, a graduate student at Rice University.

Like most programmer’s editors, Alpha is designed to work with ASCII text, normally source code. Alpha also edits TEX files, but that capability is not reviewed here. When needed, Alpha can store text with DOS or UNIX line-ends. Alpha can also save MPW state information when you close the file. When you reopen the file, the window will be restored to its former position and the cursor positioned at its previous point in the file. This is a real advantage if you open and close files frequently.

A quick look at the look of Alpha

Alpha has a layered architecture. At the core of Alpha is an editing engine which provides the editing primitives. Layered on top of this is the command language, TCL. That’s an acronym for Tool Command Language and is pronounced “tickle”. TCL is a full-fledged C-like language. Most of the Alpha user interface is written in TCL. This exposes the internals of Alpha to the user. This access to the internals gives Alpha a great deal of flexibility.

In particular, all the keyboard mappings and menu definitions are user definable. Alpha even allows you to use multiple keystrokes as a single command in the manner of Emacs or Wordstar (Word who?). You can, of course, write your own procedures in TCL and attach menu items or keystrokes to your commands.

In addition to a rare measure of customizability, Alpha has extensive support for programmers: ToolServer support, Apple Event (including Symantec Project Manager) support, and Electric Aliases (I’ll describe this below).

Unfortunately, all this power comes at a price. Like any full-featured application, it takes time to learn to use Alpha to the fullest. This problem is exacerbated in Alpha because it lacks extensive documentation. Nevertheless, Alpha offers so much that it deserves a closer look.

“More Power!”- Tim Allen

Details Details

The power, or usefulness if you prefer, of a programmer’s editor is often a matter of attention to detail. Many of the features of Alpha are just little things. But, those little conveniences add up. Moreover, Alpha chooses to emphasize features you use often. A feature that saves you two or three minutes once a month is not nearly a helpful as the feature that saves you a second or two again and again.

Cursor Control

Alpha includes all the standard cursor control operations, moving by page, jumping to the top or bottom of the file and so forth. Alpha also includes some less common capabilities. Alpha attempts to maintain the column position when you move the cursor up or down a line. In most Macintosh editors, the cursor jumps to the left margin when the cursor hits a blank line.

You’ll notice another nice feature when you page up or down. The cursor moves with you. This allows you to quickly move great distances in your code without having to take your hands off of the keyboard. This feature could be improved, however. Currently the cursor is arbitrarily moved to the upper left corner of the window after a paging movement. It would be better if the cursor stayed in the same relative spot in the window. That would allow you to page down and page back to the exact spot you started.

Somewhat related to cursor control is the fact that Alpha includes a true undo and redo capability. Unlike many other editors, Alpha can undo and redo most actions, not just text entry.

Block Moves

Again the power is in the details. Alpha does the standard cut, copy and paste, but also includes drag-and-drop editing and rectangular selection. Drag-and-drop allows you to move blocks of code using only the mouse. Very nice - especially when modifying existing code. You’re normally mousing around a bit then anyway. Unfortunately, you cannot drag-and-drop between windows. Also, Alpha does not use Apple’s Drag Manager, so you can’t drop Finder items onto Alpha windows or text clippings into other applications.

Rectangular editing is one of those features that you don’t use often. But when you need it, you really need it. It is very useful when modifying tables of static data, for instance. Unfortunately, sometimes the rectangular selection feature isn’t quite right. Selections which include tabs aren’t calculated properly. It is obvious that the tabs are being treated a single character. Pete suggests that you convert tabs to spaces before using rectangular selection until this feature is fixed.

Example of rectangular selection

Keyboard selection (holding down Shift and typing arrow keys to make a selection) is also unusual. Once you have started selecting in a particular direction, you can’t back up. Reversing direction doesn’t shrink the selected area. It grows the opposite end of the selection. In order to shrink the selection, you have to start the selection over. This is time consuming and inconsistent with the way mouse selection works.

Searching

Alpha includes a number of ways to search your text - incremental search, multi-file search, batch multi-file search, and a grep command in the shell. More on the shell later. Incremental search allows you to start searching immediately, no muss, no fuss, no dialog. Press the key for incremental search and start typing. With each character you type, incremental search finds the next occurrence of what you have typed so far. That’s the incremental part of incremental search. Incremental search is a boon when you don’t need all the fancy options. You just want to start searching.

When you do need the options, Alpha also includes a find dialog. Alpha’s find allows full regular expression searching. For those not familiar, regular expression searching allows you to search for patterns of text. This allows you to search for “something that looks like this”. The find dialog also allows you to specify a multi-file search. You can select from predefined sets of files, or you can specify a directory to be searched. In multi-file searches, you have the choice of finding matches one at a time, the same way that Symantec does it. However, you can also elect to do a batch search. In this case, a new untitled window is opened and the output of the search is placed there.

The output is typical of grep-style output. You can also perform a grep search from the command line in the Alpha shell. No command-line parameters though. In this case, the output is displayed right in the shell window.

Two changes would greatly enhance the usefulness of Alpha’s search facilities. The multi-file searching would profit from the ability to search sub-folders recursively. The options dialog off the find dialog contains a check-box for it, but it would never activate for me - no matter how sternly I told it to. Another improvement would be to provide the option of having the grep command output TCL commands. Then you could execute a line of the output to open the file and see the surrounding text. This is the way MPW does it and it can be enormously helpful when you are searching large amounts of code.

Window Control

Window manipulation is not a sexy topic, but can be enormously helpful when you have a gaggle of windows open. Of course, Alpha has commands to switch to the next and previous windows. Alpha also allows you to choose a window from a list and to organize your windows. The choose window dialog allows you to switch to an arbitrary window without taking your hands off the keyboard.

The arrange window menu allows you to arrange your Alpha windows vertically or horizontally or to tile or overlay them. Arranging affects only the top two windows. Tiling and overlaying affects all Alpha windows.

Some sample TCL code

One thing Alpha really needs in the window management sector is split windows. It is very convenient to look at two portions of the same file at the same time. Named marks (described below) partially alleviate the need for this feature, but the split windows feature would be a better solution. [Note: Alpha allows you to open more than one copy of a file, so you can achieve a similar effect without window panes - Ed stb]

TCL command language

TCL was developed by John Ousterhout, a professor at U.C. Berkeley, for a microkernel operating system he was developing called Sprite. John developed TCL as a common command language for various Sprite tools. Well, Sprite never took off, but TCL did. In due course, an Alpha user suggested that TCL would be a nice addition to Alpha.

When Alpha was originally developed, it had a very simple and non-standard macro language. Pete saw the power of TCL and redesigned Alpha with a C core and a TCL interface. Pete continues to add features to the Alpha engine, but many of the enhancements to Alpha are done completely in TCL.

TCL is a string based language. Its only data type is string. Also, every operation is an operation on strings. TCL can manipulate numeric values, but the values are stored as strings. TCL’s syntax will often look like C on first glance, but do not be confused. TCL is entirely command based. For instance, the if statement in the following procedure is actually an if command, and the statement collections and the else are parameters.


/* 1 */
proc testThis {a b} {
 if { $a < $b} {
 set a 10
 } else {
 set b 10
 }
}

The TCL Shell window

As if that weren’t strange enough, proc in the command above is also a command. The name of the proc, the parameter list and the statement body are all parameters to the proc command. While this is an unusual approach, the language is so consistent that you should have no trouble learning to use TCL in short order. As stated above, most of Alpha’s interface is in TCL, so there are lots of examples if you do get stuck.

TCL is quite good at what it is intended for. It has arrays (lists) but nothing more complicated in the way of data structures. However, it has the usual complement of flow control statements, and a full procedural language. In addition, it has string and list processing commands you won’t find in most other languages. As a tool command language, that’s just the way you’d want it.

If you do need to perform some action that is beyond the capabilities of TCL, you can write an XTCL in your favorite compiled language. XTCLs are similar in form and function to HyperCard’s XCMDs. Unlike most of Alpha, XTCLs are adequately documented and several examples are included.

Alpha allows you interactive access to TCL through the “Shell” menu item. You can execute any currently defined procedure through the shell. Since Alpha comes with commands to copy, move, and delete files, the shell makes a usable, if limited, command-line interface. I realize that command-line interfaces are anathema to most Mac users. However, they are handy when file manipulation is repetitious or when large numbers of files are involved. You can also use the shell to quickly test commands your are developing. [MPW afficionados know there’s little reason to apologize for an interactive shell - Ed stb]

Alpha’s TCL documentation is limited. It includes a very brief definition of the language and a description of each keyword and built-in command. This is fine if you already understand the quirks of TCL, but is not sufficient for a newcomer to the language. Fortunately, the language is better documented elsewhere. If you can find documentation for version 6 of TCL, it provides a much better overview.

Interpreted languages have a bad reputation. “Slow” is the word that usually comes to mind. This is not the case with TCL. Even though Alpha executes quite a bit of TCL code at startup, Alpha loads in 4 seconds on a IIfx - less than that on an 840AV.

Programmer Specific Support

Electric Aliases / Template editing

When you’re editing code, you spend a large portion of your time typing for statements, while statements, if statements, and so forth. Wouldn’t it be nice if the editor did a lot of that work for you? That’s the principle behind Alpha’s Electric Alias feature (also known as template editing). The way it works is this: You enter “if” and press tab. The editor types the parens and the curly braces and positions the cursor in the parens. You’re ready to type the condition. Another key jumps the cursor between the condition and body of the if statement. Like everything else in Alpha, Electric Aliases are easily modified. It is convenient to set them to trigger on single characters. So, in the case of a while statement, you only have to enter a “w”, press tab, and you’re ready to enter the condition. Template editing saves a lot of time and a lot of wear and tear on the fingers.

ToolServer Support

Alpha provides support for Apple’s ToolServer by providing an editing window set to a special ToolServer mode. Anything entered in that window is sent via Apple Events to the ToolServer application. ToolServer, for the uninitiated, is MPW with no user interface. Most commands you can give in MPW will also work as commands sent to ToolServer.

Unfortunately, Alpha’s implementation is flawed. Alpha does not allow you to switch to dialogs put up by ToolServer. This precludes you from using any MPW tools which contain a dialog, or even the lowly alert command. Unless you are sure that you will never invoke a ToolServer dialog, I recommend that you do not use the ToolServer shell until this feature is fixed.

Apple Events/AppleScript Support

Alpha provides Apple Event/AppleScript support both into and out of the editor. Going into the editor, Alpha provides open, print, quit, and run events from the required suite. From the misc suite, Alpha provides the DoScript event. This is a powerful facility since you can send TCL strings to Alpha from AppleScript scripts and have them executed. Alpha does not support the full editing suite, but, given the power of TCL and the inclusion of the DoScript command, it is not a great loss. One limitation, though, is that DoScript doesn’t return the value of the executed TCL command.

Alpha provides two methods for sending apple events to other applications. The dosc command provides a number of parameters for designating the target and nature of the event. The limitation is that the data of the event must be a string or a file. Alpha also provides an AEBuild command. There is no documentation at all for this command, except that the documentation warns that this command is under development and subject to change.

Alpha uses the above commands to provide support for communicating with the Symantec Project Manager and Symantec Reference. When editing a C or C++ file, Alpha attaches an extra menu with commands for driving the Symantec Project Manager and for looking up Symantec Reference templates.

The Think Menu

Other Programming Goodies

Alpha displays the current line and column on the title bar. Alpha also searches source code at load time for function names. Alpha uses these names in a pop-up menu on the title bar. You can click on the pop-up and jump directly to a specific function.

Automatic function popup

The named-marks feature is not specifically for programmers, but it is especially useful in that context. Often when modifying existing code, you need to examine more than one function at different spots in a source file. Named marks allow you to quickly note the location of each spot and jump between them easily.

Alpha as word processor - not!

While you do not want to use Alpha as a word processor, it is useful for the occasional note and for typing long comments in source code. Alpha behaves differently (and may present different menus) depending on the mode of the active window. Each window opened in Alpha is considered to belong to a particular mode - normally based on the file extension or file type. In text mode, text wrap is active. Text entered in text mode is automatically wrapped at a user defined column. You can also wrap arbitrary areas of text on command.

Alpha will also check the spelling of selections or entire files using the freeware spelling checker Excalibur. Imagine having no spelling errors in your comments!

Omega

The topic of programmer’s editors is prone to heated debate, if not outright warfare. Everyone has a favorite feature that they swear by (and other features that they swear at). I feel compelled, therefore, to state that this article does not contain a comprehensive list of Alpha’s features. Fortunately, since Alpha is shareware, you can take a look for yourself to see if Alpha contains that gotta-have-it-or-I’ll-die feature.

Alpha Shrugged

Alpha’s greatest lack is not in the range of features or in the implementation of those features. With few exceptions, Alpha does many things and does them well. Where Alpha falls down is in making Alpha accessible to the new user. Alpha needs a great deal more documentation, including a Getting Started document. It also needs a way to easily set the new user’s preferences.

Alpha’s Future

Alpha is currently written in Symantec C. Pete is currently evaluating Metrowerks CodeWarrior. If all goes well, Pete hopes to port the Alpha source to CodeWarrior sometime this summer. At that point he will consider porting Alpha to PowerPC.

Conclusions

Whether Alpha will interest you depends on whether you are willing to pay the price for the power contained there. Alpha requires little learning to use as delivered. However, if you want to take full advantage of Alpha’s power, you must take some time to customize it to your needs.

Another price might be paid in the fact that Alpha is shareware. Because it’s shareware, it is inexpensive and you can try before you buy. However, support for Alpha is not as readily available as support for commercial products. You can reach Pete by e-mail if you have access to the Internet, but there is no phone support. Furthermore, Alpha is a sideline for Pete. He is currently a busy graduate student, but is due to finish this summer and hopes to find a research lab or faculty position soon. Obviously, support for Alpha will vary with the other demands on Pete’s time.

Availability and Pricing

Alpha has a shareware fee of $25. That fee includes all future releases of Alpha. Alpha is updated regularly. The latest update of Alpha is always available via the Internet by anonymous ftp at cs.rice.edu in the /public/Alpha directory. Alpha is also distributed to other major sites and to the major BBSs. I reviewed version 5.76.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Minecraft 1.20.2 - Popular sandbox build...
Minecraft allows players to build constructions out of textured cubes in a 3D procedurally generated world. Other activities in the game include exploration, gathering resources, crafting, and combat... Read more
HoudahSpot 6.4.1 - Advanced file-search...
HoudahSpot is a versatile desktop search tool. Use HoudahSpot to locate hard-to-find files and keep frequently used files within reach. HoudahSpot is a productivity tool. It is the hub where all the... Read more
coconutBattery 3.9.14 - Displays info ab...
With coconutBattery you're always aware of your current battery health. It shows you live information about your battery such as how often it was charged and how is the current maximum capacity in... Read more
Keynote 13.2 - Apple's presentation...
Easily create gorgeous presentations with the all-new Keynote, featuring powerful yet easy-to-use tools and dazzling effects that will make you a very hard act to follow. The Theme Chooser lets you... Read more
Apple Pages 13.2 - Apple's word pro...
Apple Pages is a powerful word processor that gives you everything you need to create documents that look beautiful. And read beautifully. It lets you work seamlessly between Mac and iOS devices, and... Read more
Numbers 13.2 - Apple's spreadsheet...
With Apple Numbers, sophisticated spreadsheets are just the start. The whole sheet is your canvas. Just add dramatic interactive charts, tables, and images that paint a revealing picture of your data... Read more
Ableton Live 11.3.11 - Record music usin...
Ableton Live lets you create and record music on your Mac. Use digital instruments, pre-recorded sounds, and sampled loops to arrange, produce, and perform your music like never before. Ableton Live... Read more
Affinity Photo 2.2.0 - Digital editing f...
Affinity Photo - redefines the boundaries for professional photo editing software for the Mac. With a meticulous focus on workflow it offers sophisticated tools for enhancing, editing and retouching... Read more
SpamSieve 3.0 - Robust spam filter for m...
SpamSieve is a robust spam filter for major email clients that uses powerful Bayesian spam filtering. SpamSieve understands what your spam looks like in order to block it all, but also learns what... Read more
WhatsApp 2.2338.12 - Desktop client for...
WhatsApp is the desktop client for WhatsApp Messenger, a cross-platform mobile messaging app which allows you to exchange messages without having to pay for SMS. WhatsApp Messenger is available for... Read more

Latest Forum Discussions

See All

‘Resident Evil 4’ Remake Pre-Orders Are...
Over the weekend, Capcom revealed the Japanese price points for both upcoming iOS and iPadOS ports of Resident Evil Village and Resident Evil 4 Remake , in addition to confirming the release date for Resident Evil Village. Since then, pre-orders... | Read more »
Square Enix commemorates one of its grea...
One of the most criminally underused properties in the Square Enix roster is undoubtedly Parasite Eve, a fantastic fusion of Resident Evil and Final Fantasy that deserved far more than two PlayStation One Games and a PSP follow-up. Now, however,... | Read more »
Resident Evil Village for iPhone 15 Pro...
During its TGS 2023 stream, Capcom showcased the Following upcoming ports revealed during the Apple iPhone 15 event. Capcom also announced pricing for the mobile (and macOS in the case of the former) ports of Resident Evil 4 Remake and Resident Evil... | Read more »
The iPhone 15 Episode – The TouchArcade...
After a 3 week hiatus The TouchArcade Show returns with another action-packed episode! Well, maybe not so much “action-packed" as it is “packed with talk about the iPhone 15 Pro". Eli, being in a time zone 3 hours ahead of me, as well as being smart... | Read more »
TouchArcade Game of the Week: ‘DERE Veng...
Developer Appsir Games have been putting out genre-defying titles on mobile (and other platforms) for a number of years now, and this week marks the release of their magnum opus DERE Vengeance which has been many years in the making. In fact, if the... | Read more »
SwitchArcade Round-Up: Reviews Featuring...
Hello gentle readers, and welcome to the SwitchArcade Round-Up for September 22nd, 2023. I’ve had a good night’s sleep, and though my body aches down to the last bit of sinew and meat, I’m at least thinking straight again. We’ve got a lot to look at... | Read more »
TGS 2023: Level-5 Celebrates 25 Years Wi...
Back when I first started covering the Tokyo Game Show for TouchArcade, prolific RPG producer Level-5 could always be counted on for a fairly big booth with a blend of mobile and console games on offer. At recent shows, the company’s presence has... | Read more »
TGS 2023: ‘Final Fantasy’ & ‘Dragon...
Square Enix usually has one of the bigger, more attention-grabbing booths at the Tokyo Game Show, and this year was no different in that sense. The line-ups to play pretty much anything there were among the lengthiest of the show, and there were... | Read more »
Valve Says To Not Expect a Faster Steam...
With the big 20% off discount for the Steam Deck available to celebrate Steam’s 20th anniversary, Valve had a good presence at TGS 2023 with interviews and more. | Read more »
‘Honkai Impact 3rd Part 2’ Revealed at T...
At TGS 2023, HoYoverse had a big presence with new trailers for the usual suspects, but I didn’t expect a big announcement for Honkai Impact 3rd (Free). | Read more »

Price Scanner via MacPrices.net

New low price: 13″ M2 MacBook Pro for $1049,...
Amazon has the Space Gray 13″ MacBook Pro with an Apple M2 CPU and 256GB of storage in stock and on sale today for $250 off MSRP. Their price is the lowest we’ve seen for this configuration from any... Read more
Apple AirPods 2 with USB-C now in stock and o...
Amazon has Apple’s 2023 AirPods Pro with USB-C now in stock and on sale for $199.99 including free shipping. Their price is $50 off MSRP, and it’s currently the lowest price available for new AirPods... Read more
New low prices: Apple’s 15″ M2 MacBook Airs w...
Amazon has 15″ MacBook Airs with M2 CPUs and 512GB of storage in stock and on sale for $1249 shipped. That’s $250 off Apple’s MSRP, and it’s the lowest price available for these M2-powered MacBook... Read more
New low price: Clearance 16″ Apple MacBook Pr...
B&H Photo has clearance 16″ M1 Max MacBook Pros, 10-core CPU/32-core GPU/1TB SSD/Space Gray or Silver, in stock today for $2399 including free 1-2 day delivery to most US addresses. Their price... Read more
Switch to Red Pocket Mobile and get a new iPh...
Red Pocket Mobile has new Apple iPhone 15 and 15 Pro models on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide service using all the major... Read more
Apple continues to offer a $350 discount on 2...
Apple has Studio Display models available in their Certified Refurbished store for up to $350 off MSRP. Each display comes with Apple’s one-year warranty, with new glass and a case, and ships free.... Read more
Apple’s 16-inch MacBook Pros with M2 Pro CPUs...
Amazon is offering a $250 discount on new Apple 16-inch M2 Pro MacBook Pros for a limited time. Their prices are currently the lowest available for these models from any Apple retailer: – 16″ MacBook... Read more
Closeout Sale: Apple Watch Ultra with Green A...
Adorama haș the Apple Watch Ultra with a Green Alpine Loop on clearance sale for $699 including free shipping. Their price is $100 off original MSRP, and it’s the lowest price we’ve seen for an Apple... Read more
Use this promo code at Verizon to take $150 o...
Verizon is offering a $150 discount on cellular-capable Apple Watch Series 9 and Ultra 2 models for a limited time. Use code WATCH150 at checkout to take advantage of this offer. The fine print: “Up... Read more
New low price: Apple’s 10th generation iPads...
B&H Photo has the 10th generation 64GB WiFi iPad (Blue and Silver colors) in stock and on sale for $379 for a limited time. B&H’s price is $70 off Apple’s MSRP, and it’s the lowest price... Read more

Jobs Board

Housekeeper, *Apple* Valley Villa - Cassia...
Apple Valley Villa, part of a 4-star senior living community, is hiring entry-level Full-Time Housekeepers to join our team! We will train you for this position and Read more
Housekeeper, *Apple* Valley Village - Cassi...
Apple Valley Village Health Care Center, a 4-star rated senior care campus, is hiring a Part-Time Housekeeper to join our team! We will train you for this position! Read more
Optometrist- *Apple* Valley, CA- Target Opt...
Optometrist- Apple Valley, CA- Target Optical Date: Sep 23, 2023 Brand: Target Optical Location: Apple Valley, CA, US, 92308 **Requisition ID:** 796045 At Target Read more
Senior *Apple* iOS CNO Developer (Onsite) -...
…Offense and Defense Experts (CODEX) is in need of smart, motivated and self-driven Apple iOS CNO Developers to join our team to solve real-time cyber challenges. Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.