Syntax-Styling

This is an abbreviated version of a Fred syntax-styling utility.

Hemlock currently uses temporary text attributes, so styling is limited to color, and underlining.  I've added capitalization.  You can't mix fonts, font sizes, and font styles the way you could with Fred.

There's no preference dialog and only one built-in style.  To develop your own style, hack the parameters at the top of syntax-styling-specials.lisp.

You'll need a newer Mac to use this.  Cocoa-Hemlock is shaping up to be a very capable Lisp editor, but it is just not as fast as old Fred.  This runs okay on a Core 2 Duo Mac Mini, 2.0 GHz, 4 GB.  

Usage:
First use the CCL Preference Dialog to set font, font-size and background color.  I use Monaco 11 with either a white or a light gray background, but you might like something else.  

Next use System Preferences to turn anti-aliasing on or off.  The CCL preference, "Use bitmapped screen fonts, when available" will also affect appearance.

The built-in style uses capitalization.  If you don't want capitalization, set *style-case-p* to nil.  It is at the top of syntax-styling-specials.lisp.  This is the simplest way to use the utility.

If you want capitalization, there are some details:
You will probably want to batch style all your source files.  The temporary text attributes, color and underlining, are not persistent, but capitalization obviously is.   The utility will dynamically style a screenful of code every time you scroll, but it does not set capitalization, only color and underlining.  If it set capitalization, you would have to save every file you viewed, whether you edited it or not.

When *style-case-p* is set to t, the utility adds a Style Folder... menu-item under the Edit menu.  It will style all the Lisp files in the folder you choose and recursively style all the sub-folders.  I recommend making a copy of you source files and style the copy.   Once you are satisfied with what the utility does, you can proceed.

When *style-case-p* is set to t, Style File and Style File Vanilla are also added to the Edit menu.  Style File styles and sets capitalization in the currently active Hemlock window.  Style File Vanilla removes all styling and sets capitalization to lower case, but leaves string, comments, objc function names and various constants alone.   There is also a Syntax Styling menu-item which lets you turn styling on and off.

The utility does a good job of keeping styling correct, but sometime it can be wrong.  This can happen, for example, when you type in bogus syntax, which you later re-edit.  If you press Control-j  in a complete top level form, the form will be restyled, correcting any errors.

Setup:
cd  ccl/contrib/
svn update

That will pull in new versions of all contribs, including Syntax-Styling.

In the Listener or in ~/ccl-init.lisp execute this form:

(require :syntax-styling)

Shareware:
If you decide to use Syntax-Styling on a regular basis, please make a $5 contribution to either the Save Darfur Coalition or the World Wildlife Fund.  You can do this online.