From: David Kastrup Date: Fri, 25 Nov 2011 16:15:07 +0000 (+0100) Subject: Make 2-argument form of \accidentalStyle X-Git-Tag: release/2.15.21-1~23 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=25191e57fa34030e148d9b98478ce5690b8d385b;p=lilypond.git Make 2-argument form of \accidentalStyle --- 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)