Line Feeds and Formatting

Dan Ingalls DanI at wdi.disney.com
Tue Sep 29 15:19:50 UTC 1998


>Which brings me to item two. Am I the only one that uses the format menu
>option? As valuable as it is (to me), I'm surprised that it is under the
>more menu, and there's no apparent short cut key for this either.
>Everytime I want to format and accept, I have to do a number of more
>accurate than I would like clicks to get the code to look nice. Of
>course, given the above, it doesn't currently matter. :(

Travis -

You are definitely not the only person interested in the 'format' command for prettyPrinting Squeak source code.  There are two reasons that I did not bother to make 'format' more accessible in Version 2.2.  

1.  I installed it as a command-key (cmd-shift-p or ctrl-p for prettyPrint), so it is already much more accessible than before.

2.  I put in a preference that causes Squeak always to prettyPrint any code that you are viewing.  Use help.../preferences... to set it, if you are interested.

You will be glad to know that Version 2.2 is our first release (certainly in a while) that can successfully prettyPrint every method in the system.  This was important for PDA support, where decompilation (and prettyPrinting by default) is the only access to system sources.

I must apologize that I only had time to put in the above two conveniences and fix all the bugs in the prettyPrinter.  It had been my goal also to spend some time tweaking the algorithms to the point where most people would actually prefer prettyPrinting.  There are still some problems with comment placement, and I feel a better job can be done with the heuristics that govern the format of keyword messages.

Here are two further thoughts about prettyPrinting...

1.  In the process of tuning the formatting parameters, it would not be that hard to make a simple UI so that anyone could tune the prettyPrinter to their favorite conventions.

2.  If we made the prettyPrinter good enough that everyone preferred it, or liked it equally, then we could greatly compress the system sources by only saving temp names and comments.

If anyone wants to take on prettyPrinting as a project, send me a message offline, and I'll coordinate so we work together and don't duplicate effort.

	- Dan





More information about the Squeak-dev mailing list