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).
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,