New language feature breaks lilypond-words

2010-12-09 Thread Jay Anderson
This is a small annoyance, but one I didn't see reported.
lilypond-words.py used the language files to generate the list of
lilypond words. Since these language files now only include \language
"mylanguage" many note names are not being found. The result is vim
syntax highlighting (and I imagine also emacs) doesn't highlight many
note names. A suggested patch is at the end of this email. I adjusted
the regular expression so it wouldn't include the language name as
part of note_names. Thanks.

-Jay

diff --git a/scripts/build/lilypond-words.py b/scripts/build/lilypond-words.py
index ef6328f..d65ecdb 100644
--- a/scripts/build/lilypond-words.py
+++ b/scripts/build/lilypond-words.py
@@ -47,21 +47,8 @@ for name in ['ly/chord-modifiers-init.ly',
 keywords += [w for w in re.findall (r"(?m)^\s*\"?([a-zA-Z]+)\"?\s*=", s)]

 # note names
-for name in ['ly/catalan.ly',
- 'ly/deutsch.ly',
- 'ly/drumpitch-init.ly',
- 'ly/english.ly',
- 'ly/espanol.ly',
- 'ly/italiano.ly',
- 'ly/makam.ly',
- 'ly/nederlands.ly',
- 'ly/norsk.ly',
- 'ly/portugues.ly',
- 'ly/suomi.ly',
- 'ly/svenska.ly',
- 'ly/vlaams.ly']:
-s = open (name, 'r').read ()
-note_names += [n for n in re.findall
(r"(?m)^\s*\(([a-z]+)[^l]+ly:make-pitch", s)]
+s = open ('ly/language-init.ly', 'r').read ()
+note_names += [n for n in re.findall
(r"(?m)^\s*\(([a-z]+)\s*\.\s*,\(ly:make-pitch", s)]

 # reserved words
 for name in ['ly/engraver-init.ly',

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: New language feature breaks lilypond-words

2010-12-11 Thread Patrick McCarty
On 2010-12-09, Jay Anderson wrote:
> This is a small annoyance, but one I didn't see reported.
> lilypond-words.py used the language files to generate the list of
> lilypond words. Since these language files now only include \language
> "mylanguage" many note names are not being found. The result is vim
> syntax highlighting (and I imagine also emacs) doesn't highlight many
> note names. A suggested patch is at the end of this email. I adjusted
> the regular expression so it wouldn't include the language name as
> part of note_names. Thanks.

Thanks for the report, Jay.  The note-name definitions have just moved
from the ly/ directory to the scm/ directory, so I've adapted your
patch to use the new location.

You'll find the git commit here:
http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commitdiff;h=4e06a1fa15844c780efc808b1be55ddd3046aee9

Thanks,
Patrick

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: New language feature breaks lilypond-words

2010-12-12 Thread Jay Anderson
On Sat, Dec 11, 2010 at 5:09 PM, Patrick McCarty  wrote:
> Thanks for the report, Jay.  The note-name definitions have just moved
> from the ly/ directory to the scm/ directory, so I've adapted your
> patch to use the new location.

Thanks for taking care of this. Much faster than I expected.

Here's another lilypond vim annoyance. Take these lines as examples:

\version "2.13.42"
\once \override Staff.DynamicText #'self-alignment-X = #LEFT

If you place the cursor over the "2" in the first line or over the "S"
in Staff in the second line and type 'dw' (delete word) it will treat
the dots as word characters and result in these lines:

\version ""
\once \override #'self-alignment-X = #LEFT

I would expect it to stop at the dots. I haven't looked too much at
the syntax file yet to see how this might be easily fixed.

Thanks for the help!

-Jay

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: New language feature breaks lilypond-words

2010-12-13 Thread Patrick McCarty
On 2010-12-12, Jay Anderson wrote:
> 
> Here's another lilypond vim annoyance. Take these lines as examples:
> 
> \version "2.13.42"
> \once \override Staff.DynamicText #'self-alignment-X = #LEFT
> 
> If you place the cursor over the "2" in the first line or over the "S"
> in Staff in the second line and type 'dw' (delete word) it will treat
> the dots as word characters and result in these lines:
> 
> \version ""
> \once \override #'self-alignment-X = #LEFT
> 
> I would expect it to stop at the dots. I haven't looked too much at
> the syntax file yet to see how this might be easily fixed.

Interesting!

The problem is that LilyPond's Vim syntax file includes the system's
Scheme syntax file, which overrides the `iskeyword' property to
something not-that-desirable for LilyPond files.

I *thought* that by including the Scheme syntax file, the overrides
and such would only apply to the @embeddedScheme group, but I guess
some of them leak through and apply to the entire LilyPond syntax
file.  Seems odd, but there's probably something missing.

I'll think about this some more tomorrow.

Thanks,
Patrick

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: New language feature breaks lilypond-words

2010-12-18 Thread Patrick McCarty
On Mon, Dec 13, 2010 at 12:05 AM, Patrick McCarty  wrote:
> On 2010-12-12, Jay Anderson wrote:
>>
>> Here's another lilypond vim annoyance. Take these lines as examples:
>>
>> \version "2.13.42"
>> \once \override Staff.DynamicText #'self-alignment-X = #LEFT
>>
>> If you place the cursor over the "2" in the first line or over the "S"
>> in Staff in the second line and type 'dw' (delete word) it will treat
>> the dots as word characters and result in these lines:
>>
>> \version ""
>> \once \override #'self-alignment-X = #LEFT
>>
>> I would expect it to stop at the dots. I haven't looked too much at
>> the syntax file yet to see how this might be easily fixed.
>
> Interesting!
>
> The problem is that LilyPond's Vim syntax file includes the system's
> Scheme syntax file, which overrides the `iskeyword' property to
> something not-that-desirable for LilyPond files.
>
> I *thought* that by including the Scheme syntax file, the overrides
> and such would only apply to the @embeddedScheme group, but I guess
> some of them leak through and apply to the entire LilyPond syntax
> file.  Seems odd, but there's probably something missing.

Not sure how to implement a proper fix at the moment, so I've opened a
tracker issue:

https://code.google.com/p/lilypond/issues/detail?id=1457

Thanks,
Patrick

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: New language feature breaks lilypond-words

2010-12-19 Thread Jay Anderson
On Sun, Dec 19, 2010 at 12:27 AM, Patrick McCarty  wrote:
> Not sure how to implement a proper fix at the moment, so I've opened a
> tracker issue:
>
> https://code.google.com/p/lilypond/issues/detail?id=1457

Thanks for looking into this. In my local lilypond install I've
disabled syntax highlighting for embedded scheme in the meantime.

-Jay

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond