NB: that lambda-in-Emacs screenshot shows my ugly reader-macro-hack version, which munges the actual source files. Later in the usenet thread, other people improved the code so that Emacs font-lock does it all without affecting source files - added bonus that all the existing Lisp programs you read have pretty lambdas automatically. It's especially great for reading Scheme code, I find.
In principle the final version is not totally clean with respect to indentation, but I haven't seen the trouble cases actually occur in a real file. This is the basic problem case:
(lambda (x) (+ x
y))
(\ (x) (+ x
y))
i.e. if you need to indent to the level of something following a 'lambda' (on the same line), then you can't do it consistently.
But as I say, I've yet to come across that problem in a real source file. Note also that if you indent-region it within Emacs, it will actually consider the 'lambda' as a single character, so indentation will always do the Right Thing for the current Emacs configuration.
|