lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: script for auto-indenting .scm files.


From: Carl Sorensen
Subject: Re: script for auto-indenting .scm files.
Date: Sat, 13 Aug 2011 13:06:31 -0600

On 8/13/11 9:44 AM, "Neil Puttock" <address@hidden> wrote:

> On 12 August 2011 01:44, Carl Sorensen <address@hidden> wrote:
> 
>> Yep.  Here it is, along with the change to /usr/bin/env guile.
> 
> I had to change this to
> 
> /usr/bin/guile
> 
> to get the script to work:
> 
> /usr/bin/env: guile -s: No such file or directory

Thanks.  I'll get this worked out, I think.

> 
>> I think I'm really going to like having this, if we can get all the bugs
>> worked out......
> 
> I've just tested it on a few files, and there are several problems:
> 
> 1) it introduces whitespace on blank lines

I had missed that difference.  That's now fixed.

> 
> 2) inside an `if', comments are counted, leading to incorrect
> indentation for the subexpressions

Good catch.  I'm not sure how I'll fix that, but I certainly need to.

> 
> 3) subexpression inside `begin' are indented only one space

De we have a standard for how much indentation we should have for each type
of compound expression?

define
let
begin

all get two, apparently.

I see some sources that show that

list 

gets one.

Are you aware of a definitive statement I can follow?

> 
> 4) if a top-level form is erroneously indented (e.g.,
> `set-music-properties!' in music-functions.scm), the rest of the file
> also gets the same indentation

Thanks for catching that.  I've fixed it so all top-level forms start at
column zero.

> 
> I've attached a diff which only shows the indentation changes (i.e.,
> tab->space conversion is ignored).

How did you do this?  Did you do tab expansion on the file in an editor,
then run it through guileindent.scm?

Once I've fixed all the issues you've raised and done some more
experimentation, I'll post a new patch.

Actually, since there has been no outcry saying "This is a stupid thing to
do" I'll add it to scripts/auxiliar and post it on Rietveld for review.

Thanks,

Carl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]