From 25191e57fa34030e148d9b98478ce5690b8d385b Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Fri, 25 Nov 2011 17:15:07 +0100 Subject: [PATCH] Make 2-argument form of \accidentalStyle --- ly/property-init.ly | 14 +++++++++----- python/convertrules.py | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ly/property-init.ly b/ly/property-init.ly index c5bf597b6e..494bfd3eec 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -16,11 +16,15 @@ defaultNoteHeads = accidentalStyle = #(define-music-function - (parser location style) (string-or-symbol?) - (_i "Set @var{style} as the accidental style to use.") - (set-accidental-style (if (string? style) - (string->symbol style) - style))) + (parser location context style) ((symbol?) string?) + (_i "Set accidental style to @var{style}, a string. If an optional +@var{context} symbol is given, e.g. @code{#'Staff} or @code{#'Voice}, +the settings are applied to that context. Otherwise, the context +defaults to @samp{Staff}, except for piano styles, which use +@samp{GrandStaff} as a context." ) + (if context + (set-accidental-style (string->symbol style) context) + (set-accidental-style (string->symbol style)))) %% arpeggios diff --git a/python/convertrules.py b/python/convertrules.py index ae15f68e82..ad518547c4 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3350,6 +3350,10 @@ def conv (str): def conv (str): str = re.sub (r"\$\(set-accidental-style\s+'([-a-z]+)\)", r'\\accidentalStyle "\1"', str) + str = re.sub (r"\$\(set-accidental-style\s+'([-a-z]+)\s+'([-A-Za-z]+)\s*\)", + r'''\\accidentalStyle #'\2 "\1"''', str) + str = re.sub (r"(@funindex\s+)set-accidental-style", + r"\1\\accidentalStyle", str) return str # Guidelines to write rules (please keep this at the end of this file) -- 2.39.2