]> git.donarmstrong.com Git - lilypond.git/commitdiff
Make 2-argument form of \accidentalStyle
authorDavid Kastrup <dak@gnu.org>
Fri, 25 Nov 2011 16:15:07 +0000 (17:15 +0100)
committerDavid Kastrup <dak@gnu.org>
Wed, 30 Nov 2011 08:23:30 +0000 (09:23 +0100)
ly/property-init.ly
python/convertrules.py

index c5bf597b6e428dd8b0945cece03e2c944a25b73b..494bfd3eec6646a2bb4827ff01218db04189ad08 100644 (file)
@@ -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
 
index ae15f68e8261f71ffde0840718112c0f624f4c05..ad518547c4a093223078d7515533128cbae909ed 100644 (file)
@@ -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)