[plt-scheme] question about dr. scheme indentation

From: Danny Yoo (dyoo at hkn.eecs.berkeley.edu)
Date: Mon Apr 10 21:30:05 EDT 2006

>> I am new to Dr Scheme and would like to change how it indents.

Hi John,

The style that DrScheme uses, though, does have a lot of history and 
inertia behind it.  I know this sounds anti-democratic, but it might be 
worthwhile to conform in this situation.  Ken Arnold makes a case for it 
here:

     http://www.artima.com/weblogs/viewpost.jsp?thread=74230

Almost all of the code you're be seeing will use the same indentation 
standard, so it may be good practice to start using it too so you can read 
it better.


>> I would prefer closing parenthesis to be aligned with opening parenthesis, 
>> and for everything to be indented with tabs, more like this:
>>  
>> (define (myfunction myparam)
>>     (let*
>>         [
>>             (myvar 10)
>>         ]
>>         (+ myvar myparam)
>>     )
>> )

But those tabs show up as ugly rectangles on my end!  *wink*  Spaces seem 
more robust than tabs.


>> Is there a way to specify HOW it auto indents? How can I configure dr 
>> scheme to do this?

There might not be a convenient out-of-the-box way to configure DrScheme 
to indent the way you want.  The code for doing this seems embedded in the 
GUI framework code, using the TABIFY method of the scheme:text<%> 
interface:

http://download.plt-scheme.org/doc/301/html/framework/framework-Z-H-638.html#node_sec_24.3

and the actual implementation of this tabify code appears to live in 
collects/framework/private/scheme.ss.

     http://ja.soegaard.net/planet/html/collects/framework/private/scheme.ss

Anything's possible since we can always kludge the source here.  But I 
think sticking with the default indentation strategy is a better idea.


Best of wishes!

Posted on the users mailing list.