[racket] Indenting with class

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Apr 14 11:37:08 EDT 2012

I looked into this a little bit and with the diff below, it starts to
get close to make the docs indent the way DrRacket does, but it looks
like getting closer is going to be complicated because of the way the
layout is set up and, I guess, that the layout is set up that way
because that's the best compromise with the html/pdf backed that's
been found.

So I'm not really sure if the right thing is to try to lay out the
table differently, or perhaps I'm missing something about the way the
current things are set up that there is another simple tweak to do.

In any case, the diff below makes the racket/draw canvas% docs's
constructor line the first argument up under the "w" new "new",
instead of under the "c" in "canvas%". The current setup seems to have
the "new canvas%" all in a single cell in the canvas and judicious use
of (hspace 1) doesn't seem to help.


diff --git a/collects/scribble/private/manual-proc.rkt
index 5499aab..6780390 100644
--- a/collects/scribble/private/manual-proc.rkt
+++ b/collects/scribble/private/manual-proc.rkt
@@ -363,7 +363,7 @@
                            (list flow-spacer)
                            (list flow-spacer flow-spacer
                                  flow-spacer flow-spacer))]
-                [one-ok? (tagged+arg-width . < . 60)])
+                [one-ok? (and (not (eq? mode 'new)) (tagged+arg-width
. < . 60))])

On Sun, Apr 8, 2012 at 11:08 PM, Nick Shelley <nickmshelley at gmail.com> wrote:
> Punny, right? Anyway, I can't figure out how to get DrRacket to indent like this:
> (define msg (new message% [parent frame]
>                           [label "No events so far..."]))
> like it is in the docs. I've tried putting new in the begin-like, define-like, and lambda-like sections of the preferences and none of them do it. I'm sure there's a simple solution that's in an obvious place in the docs, but it's eluding me right now. (I at least looked in the most obvious place that I could think of, which is the DrRacket preferences section, but the entry on indenting wasn't very helpful for what I want to know: "This panel controls which keywords DrRacket recognizes for indenting, and how each keyword is treated.")
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

Posted on the users mailing list.