From 136e98fe24af669dbc88dfd088b5c467d7bdbac6 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 9 Jun 2013 12:37:33 +0200 Subject: [PATCH] Issue 3406: convert-ly: Flag.transparent and Flag.color inherit from Stem 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/convertrules.py b/python/convertrules.py index aee0530e9c..121b12182c 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -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, -- 2.39.5