]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Add lilypond-book ly verbatim gettext quirk
[lilypond.git] / scripts / lilypond-book.py
index d52e09ad2f2725c201523bd0f783b3a0d8190724..b4bd319a690d3b35aa27b969a7d0b4edd2d0435a 100644 (file)
@@ -390,9 +390,9 @@ snippet_res = {
          r'''(?mx)
           (?P<match>
           <lilypond
-           (\s*(?P<options>.*?)\s*:)?\s*
+           (\s+(?P<options>.*?))?\s*:\s*
            (?P<code>.*?)
-          />)''',
+          \s*/>)''',
 
         'lilypond_block':
          r'''(?msx)
@@ -401,7 +401,7 @@ snippet_res = {
            \s*(?P<options>.*?)\s*
           >
           (?P<code>.*?)
-          </lilypond>)''',
+          </lilypond\s*>)''',
 
         'lilypond_file':
          r'''(?mx)
@@ -410,7 +410,7 @@ snippet_res = {
            \s*(?P<options>.*?)\s*
           >
           \s*(?P<filename>.*?)\s*
-          </lilypondfile>)''',
+          </lilypondfile\s*>)''',
 
         'multiline_comment':
          r'''(?smx)
@@ -960,7 +960,7 @@ def verb_ly_gettext (s):
 
     if langdefs.LANGDICT[document_language].enable_ly_identifier_l10n:
         for v in ly_var_def_re.findall (s):
-            s = re.sub (r"(?m)(^|[' \\#])%s([^a-zA-Z])" % v,
+            s = re.sub (r"(?m)(?<!\\clef)(^|[' \\#])%s([^a-zA-Z])" % v,
                         "\\1" + t (v) + "\\2",
                         s)
         for id in ly_context_id_re.findall (s):
@@ -1204,8 +1204,10 @@ left-margin-default right-margin-default)"
 
         option_list = []
         for option in self.get_option_list ():
-            if not any (option.startswith (name)
-                        for name in PROCESSING_INDEPENDENT_OPTIONS):
+            for name in PROCESSING_INDEPENDENT_OPTIONS:
+                if option.startswith (name):
+                    break
+            else:
                 option_list.append (option)
         option_string = ','.join (option_list)
         compose_dict = {}