Indentation configuration for DrRacket and fmt

@notjack and @SamPhillips seem to prefer pattern from the syntax/parse library to be indented as follows:

(define-syntax-class arglist
  (pattern x:id
    #:with name #'x))

as opposed to:

(define-syntax-class arglist
  (pattern x:id
           #:with name #'x))

fmt can deal with this easily, provided that most people prefer it. So please reply to this thread if you have any opinion. (cc: @ryanc)

Another change that should be made is to add pattern as a "Define-like Keywords" in DrRacket. This is so that fmt and DrRacket will not fight each other. Any objection?

On the topic of DrRacket indentation configuration, is it worth cleaning up the current configuration? I see stuff like class-asi, class100, which are not documented anywhere. Also, a lot of entries in "Define-like Keywords" already match the regexp, so there's no need to list them explicitly (e.g., define-predicate). Is it OK to remove these entries? (cc: @robby)

-- Sorawee (Oak)

6 Likes

I think it would be great to clean that up!

My instinct would be that fmt should look at the same preferences that DrRacket looks at (and modifies). This would mean a module-level dependency on framework/preferences (not a big deal) and a pkg-level dependency on gui-lib (possibly a big deal but I don't mind moving things).

Longer term, of course, it would be great if there wasn't a direct dependency between fmt (or DrRacket's indentation code) and these settings, but it was all gotten via something like read-language.

3 Likes

Since no one objects, I will submit a PR to add pattern as a “Define-like Keywords” to syntax-color as I outlined above.

2 Likes