Re: indent-ly

2009-11-15 Thread Ralph Palmer
Greetings, Martin Tarenskeen - I'd like to use your indent-ly. I copied and saved it from http://www.home.zonnet.nl/m.tarenskeen/tmp/indent-ly and named the new file indent-ly, but I'm not an experienced programmer, and I have some questions. Where should I put indent-ly? Does it need a file

Re: indent-ly

2009-10-26 Thread Wilbert Berendsen
Hi, Op dinsdag 20 oktober 2009 schreef Martin: Would be nice if he could also integrate such functionality in Frescobaldi: Be able to re-indent a complete score with a mouseclick from inside the Frescobaldi screen would be great ! ( Just like indent-ly has been integrated into frescobaldi

Re: indent-ly

2009-10-26 Thread Wilbert Berendsen
Op donderdag 22 oktober 2009 schreef Bertalan: Now, the real problem I see with this approach is that no perfect formatting (which is not the same as indentation) can be done without actually parsing the input. I think this is true; my indent script[1] includes a basic parser. It knows

Re: indent-ly

2009-10-23 Thread Martin Tarenskeen
Hi, I'm still working on indent-ly. New in current version as requested: - Backup files before overwriting. I'm giving these files names like infile.ly.1, infile.ly.2, etcetera. You don't loose files unless you delete them by hand. - Try to keep scheme stuff untouched ( needs improvement

Re: indent-ly

2009-10-23 Thread Martin Tarenskeen
On Fri, 23 Oct 2009, eluze wrote: Also new in today's version: If no input file is specified indent-ly reads from stdin. works - how do you stop stdin? (i used ctrl+z) Ctrl + d ? -- Martin ___ lilypond-user mailing list lilypond-user

Re: indent-ly

2009-10-23 Thread Daniel Hulme
On Fri, Oct 23, 2009 at 05:01:37PM +0200, Martin Tarenskeen wrote: works - how do you stop stdin? (i used ctrl+z) Ctrl + d ? You're both right. CTRL-z is Windows's way of signalling end-of-input; CTRL-d is likewise for POSIX-compliant systems. You can also do program file on both systems,

Re: indent-ly

2009-10-22 Thread Bertalan Fodor (LilyPondTool)
Now, the real problem I see with this approach is that no perfect formatting (which is not the same as indentation) can be done without actually parsing the input. Complete parsing of LilyPond input is _impossible_ without LilyPond itself. For example you need to format LilyPond code _inside_

Re: indent-ly

2009-10-22 Thread David Kastrup
Bertalan Fodor (LilyPondTool) lilypondt...@organum.hu writes: Now, the real problem I see with this approach is that no perfect formatting (which is not the same as indentation) can be done without actually parsing the input. I don't see that. Complete parsing of LilyPond input is

Re: indent-ly

2009-10-22 Thread Bertalan Fodor (LilyPondTool)
So a standard formatting engine can only be written inside LilyPond, or at least using LilyPond to generate metadata describing the structure of the input. I think that view is overly pessimistic. Ok, but I'm talking about a standard formatter, and not just indentation. But for that as

Re: indent-ly

2009-10-21 Thread Martin Tarenskeen
. An official style OK. I changed the default to two-space indentation: http://www.home.zonnet.nl/m.tarenskeen/tmp/indent-ly -- Martin Tarenskeen ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond

Re: indent-ly

2009-10-21 Thread Martin Tarenskeen
-comments %{ %} untouched. and texidoc strings in a header get re-indented if indentation has been left out (usually deliberately in the docs on a new line). Can you point me to an example ? I don't know what texidoc strings are. http://www.home.zonnet.nl/m.tarenskeen/tmp/indent-ly

Re: indent-ly

2009-10-21 Thread Martin Tarenskeen
On Tue, 20 Oct 2009, Neil Puttock wrote: Be able to re-indent a complete score with a mouseclick from inside the Frescobaldi screen would be great ! ( Just like indent-ly has been integrated into frescobaldi.) Or is it already possible ? Alt-l s a does this rather nicely. I can't make

Re: indent-ly

2009-10-21 Thread -Eluze
hope these comments are helpful - thanks! -- View this message in context: http://www.nabble.com/indent-ly-tp25971519p25993972.html Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com. ___ lilypond-user mailing list lilypond-user

Re: indent-ly

2009-10-21 Thread Graham Percival
On Wed, Oct 21, 2009 at 07:47:01AM -0700, -Eluze wrote: Martin Tarenskeen wrote: I think it does a nice job, but comments are welcome. - it would be nice to have an option to replace the file directly instead of having to copy/paste the resulting file Definitely! - scheme code is not

Re: indent-ly

2009-10-21 Thread David Kastrup
Martin Tarenskeen m.tarensk...@zonnet.nl writes: On Tue, 20 Oct 2009, Graham Percival wrote: The default for lilypond files is two-space indents. Is that official and written in the docs, or just common practice ? Lilypond itself does not write lilypond files, it just reads them. So it

Re: indent-ly

2009-10-21 Thread Martin Tarenskeen
On Wed, 21 Oct 2009, Graham Percival wrote: - it would be nice to have an option to replace the file directly instead of having to copy/paste the resulting file Definitely! Done in latest version. Use -m (--modify) Be careful: This version overwrites the original file without making a

Re: indent-ly

2009-10-21 Thread Graham Percival
On Wed, Oct 21, 2009 at 08:49:33PM +0200, Martin Tarenskeen wrote: Be careful: This version overwrites the original file without making a backup ( infile.ly~ )first. Maybe I should add that in the next version. Yes, that would be good. What about a version that read from standard input and

Re: indent-ly

2009-10-21 Thread Neil Puttock
2009/10/21 Martin Tarenskeen m.tarensk...@zonnet.nl: Can you point me to an example ? I don't know what texidoc strings are. Here's an example from the regression tests:

Re: indent-ly

2009-10-21 Thread Neil Puttock
2009/10/21 Martin Tarenskeen m.tarensk...@zonnet.nl: I can't make this work. I have tried Alt and/or Ctrl + l, L, I or i (In case you made a typo). But I can only make all or selected lines move to the right, which is not what I mean or need when I have messed up the indentation in a larger

Re: indent-ly

2009-10-21 Thread Patrick Horgan
Graham Percival wrote: What about a version that read from standard input and wrote to standard input? I'm thinking about the documentation -- we could automatically format all lilypond input syntax. On unix a lot of tools default to input coming from one or more file(s) whose names are

indent-ly

2009-10-20 Thread Martin Tarenskeen
and keep his/her own personal lilypond coding style, and to make things easier for me :-) I think it does a nice job, but comments are welcome. You get it here: http://www.home.zonnet.nl/m.tarenskeen/tmp/indent-ly Known bugs: I don't know if lilypond allows this, but indent-ly does

Re: indent-ly

2009-10-20 Thread Graham Percival
On Tue, Oct 20, 2009 at 10:31:15AM +0200, Martin Tarenskeen wrote: I have tried to write a tool in Python to (re-)indent lilypond source files. Something like indent ( for C/C++ ) or tidy ( for HTML ) but now with Lilypond in mind. Nice! If it works well, this would satisfy

Re: indent-ly

2009-10-20 Thread Martin Tarenskeen
could also integrate such functionality in Frescobaldi: Be able to re-indent a complete score with a mouseclick from inside the Frescobaldi screen would be great ! ( Just like indent-ly has been integrated into frescobaldi.) Or is it already possible ? The default for lilypond files is two-space

Re: indent-ly

2009-10-20 Thread Bertalan Fodor (LilyPondTool)
The default for lilypond files is two-space indents. Is that official and written in the docs, or just common practice ? Lilypond itself does not write lilypond files, it just reads them. So it does not have a default indentation. I have tried different tools ( frescobaldi, lilypondtool,

Re: indent-ly

2009-10-20 Thread Graham Percival
On Tue, Oct 20, 2009 at 01:02:59PM +0200, Martin Tarenskeen wrote: On Tue, 20 Oct 2009, Graham Percival wrote: Nice! If it works well, this would satisfy http://code.google.com/p/lilypond/issues/detail?id=777 I also see there Wilbert Berendsen already wrote a similar, but more advanced,

Re: indent-ly

2009-10-20 Thread Neil Puttock
2009/10/20 Martin Tarenskeen m.tarensk...@zonnet.nl: Would be nice if he could also integrate such functionality in Frescobaldi: Be able to re-indent a complete score with a mouseclick from inside the Frescobaldi screen would be great ! ( Just like indent-ly has been integrated