[plt-scheme] Drscheme syntax highlighting and #;

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Oct 4 13:52:00 EDT 2007

On Oct  4, David Einstein wrote:
> It appears that Dr Scheme does not highlight code commented out with
> #; as comments.  Is there some way of changing this?  I've outwitted
> myself too many times with this.

A little off topic but relevant for whether you want this or not.

I've recently switched my Emacs setup to v22, and one of the things
that looked good is that it deals "properly" (proper in the usual
Emacs terms) with #; comments.  It can even handle combinations that I
like, such as

  #; ; the following is disabled
  (...disabled-stuff...)
  ; #; ; use this instead
  (...enabled-stuff...)

(The only thing it doesn't deal with is a double #; #; but I happen
not to use that.)

It was nice to see if when I did my "new feature" scan, it was also
nice when I edited a few files.  But the more I used this, the less I
like it, and I'd probably disable it sometime soon.  The thing is that
it does a *good* job in treating the s-expression as a comment -- good
enough that matching sexprs from inside the commented area is bogus,
and sexpr-based editing is therefore messed up heavily.

DrScheme deals with comments in a similar way, which is how you can
skip over this

  (foo bar ; blah :)
       baz)

in a single M-right.  Even the colors of commented sexprs shouuld not
really be comment-colors, since it's still code in there...

So, the best way I see to make such a feature available (speaking as a
user) is:

* do not treat the contents as a comment for navigation, only use
  different colors;

* the colors should be based on the usual colors, probably some less
  saturated version;

* Probably better not to accumulate the faded color effect, or nested
  uses of #; will end up with unreadable code.

My guess is that it will not be easy to do all that, and given my
Emacs experience I prefer if things stay as they are now.

(BTW, if something like that is implemented, then it might be easy to
do the same for quotes (accumulating color effects), quasiquotes, and
unquote (negating the color effect), and the same for syntax,
quasisyntax, and unsyntax.)

(BTW^2, and getting farther away -- symmetry freaks like me will
obviously suggest new concrete syntaxes for `quasicomment',
`uncomment', and `uncomment-splicing'.  I'm sure that everyone will
share my joy at the beautiful-but-completely-useless syntax.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.