[racket] auto-spacer

From: Laurent (laurent.orseau at gmail.com)
Date: Wed Apr 18 12:36:16 EDT 2012

With the new Script Plugin on PLaneT, it has been quite easy to do
something along these lines:
http://planet.plt-scheme.org/package-source/orseau/script-plugin.plt/2/0/examples/indent-let.rkt

I use a double-space instead of a tab separator (mostly by laziness to look
for how to make the tab key actually print a tab).
It's probably not the most efficient implementation, but it seems to work.

Laurent.


On Tue, Aug 3, 2010 at 02:52, Robby Findler <robby at eecs.northwestern.edu>wrote:

> I think that could work well in drracket. It is careful never to
> insert tab characters into your program when it indents (for the
> problems listed in the beginning of that essay) so there is relatively
> little existing use of tabs.
>
> And drracket's editor class is now implemented in racket, so anyone
> can add stuff to it (without fear of segfaults :).
>
> Robby
>
> On Mon, Aug 2, 2010 at 10:35 AM, Dave Gurnell <d.j.gurnell at gmail.com>
> wrote:
> > I saw this on the Internets a while ago:
> > http://nickgravgaard.com/elastictabstops/
> > I thought it was pretty clever... it could be relevant here. There's a
> demo
> > about half way down the page.
> > -- Dave
> > On 2 Aug 2010, at 16:26, Jos Koot wrote:
> >
> > +1, I do this often in my code (in which case I don't touch
> auto-redent-all)
> > Jos
> >
> > ________________________________
> > From: users-bounces at racket-lang.org [mailto:
> users-bounces at racket-lang.org]
> > On Behalf Of Laurent
> > Sent: 02 August 2010 17:19
> > To: PLT-Scheme Mailing List
> > Subject: [racket] auto-spacer
> >
> > Speaking of DrRacket UI, one thing that I'd really appreciate is an
> > "auto-spacer" for `define' and `let'.
> > Let me explain what I mean.
> > I often have things like:
> >
> > (define something 3)
> > (define some-other-thing 4)
> > (define whatever-you-like 42)
> > ....
> >
> > And I like the right-hand-side to be aligned to make it more readable:
> > (define something         3)
> > (define some-other-thing  4)
> > (define whatever-you-like 42)
> > ....
> >
> > (to be read it with a constant-width font of course).
> >
> > This also happens quite a lot within `let' forms.
> > So of course I do it by hand, but if someone has already done a tool for
> > that or knows how to do it, that would be wonderful.
> > I don't know how easy that would be though...
> > Maybe something that works only on the selected lines.
> >
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120418/5ec93fcd/attachment.html>

Posted on the users mailing list.