]> git.donarmstrong.com Git - lilypond.git/commitdiff
Let \accidentalStyle detect its optional context argument by looking at its letter...
authorDavid Kastrup <dak@gnu.org>
Sun, 7 Oct 2012 08:22:55 +0000 (10:22 +0200)
committerDavid Kastrup <dak@gnu.org>
Thu, 25 Oct 2012 18:29:26 +0000 (20:29 +0200)
This is a fishy stopgap measure to let \accidentalStyle able to
distinguish #'Voice "default" from "default" alone while we generate
symbols from from #'Voice as well as "default".  If the first letter
is uppercase, the symbol is considered to be a context specification.

ly/property-init.ly

index 269648639b7d81b54b53b37aeb72cddf470b3a46..fd9c2f337a33eea93fef7ee57994dfd9cfd47ed8 100644 (file)
@@ -13,10 +13,16 @@ defaultNoteHeads =
    (_i "Revert to the default note head style.")
    (revert-head-style '(NoteHead TabNoteHead)))
 
+#(define (context-name? c)
+  "A stopgap measure until dotted lists become available as arguments.
+Distinguish context names from accidental styles by virtue of their
+first letter being uppercase."
+  (and (symbol? c)
+   (char-upper-case? (string-ref (symbol->string c) 0))))
 
 accidentalStyle =
 #(define-music-function
-   (parser location context style) ((symbol?) string?)
+   (parser location context style) ((context-name?) 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