]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3406: convert-ly: Flag.transparent and Flag.color inherit from Stem
authorDavid Kastrup <dak@gnu.org>
Sun, 9 Jun 2013 10:37:33 +0000 (12:37 +0200)
committerDavid Kastrup <dak@gnu.org>
Sat, 15 Jun 2013 08:15:05 +0000 (10:15 +0200)
After issue 3395, Flag color and transparency does not need to be
changed in synch with Stem color and transparency.

Strictly speaking, it is overkill to change synchronized reverts along
with synchronized overrides: this does not work with things like

\override Stem.color = #red
\override Flag.color = #blue
...
\revert Stem.color
\revert Flag.color

where only the reverts get conflated (and thus Flag color stays in
place).  That's less than perfect, but probably better than leaving
reverts alone (for Flag.transparent, they might have been created
automatically by an earlier convert-ly rule).

python/convertrules.py

index aee0530e9c71e98297b468e33212b4126c88de42..121b12182cadfad528e7e31903a2cd17b5dfa7a8 100644 (file)
@@ -3581,6 +3581,16 @@ def conv(str):
                   vspace_replace, str)
     return str
 
+@rule((2, 17, 20), _(r"Flag.transparent and Flag.color inherit from Stem"))
+def conv(str):
+    str = re.sub (r"(((?:\\once\s*)?)\\override\s+((?:\w+\.)?)Stem\.(transparent|color)\s*=\s*(#\S+))\s+\2\\override\s+\3Flag\.\4\s*=\s*\5",
+                  r"\1", str)
+    str = re.sub (r"(((?:\\once\s*)?)\\revert\s+((?:\w+\.)?)Stem\.(transparent|color))\s+\2\\revert\s+\3Flag\.\4",
+                  r"\1", str)
+    str = re.sub (r"(\\tweak\s+((?:\w+\.)?)Stem\.(transparent|color)\s+(#\S+))\s+\\tweak\s+\2Flag\.\3\s+\4",
+                  r"\1", str)
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,