[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/16] Change \accidentalStyle to get a symbol list as argument
From: |
David Kastrup |
Subject: |
[PATCH 13/16] Change \accidentalStyle to get a symbol list as argument |
Date: |
Tue, 9 Oct 2012 20:59:58 +0200 |
This changes the syntax of \accidentalStyle to accept specs like
Voice.piano-cautionary .
---
ly/property-init.ly | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 3a88098..28a13e3 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -13,24 +13,21 @@ 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) ((context-name?) string?)
- (_i "Set accidental style to @var{style}, a string. If an optional
address@hidden 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
address@hidden as a context." )
- (if context
- (set-accidental-style (string->symbol style) context)
- (set-accidental-style (string->symbol style))))
+ (parser location style) (symbol-list?)
+ (_i "Set accidental style to symbol list @var{style} in the form
address@hidden If @var{style} has a form like
address@hidden, 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." )
+ (case (length style)
+ ((1) (set-accidental-style (car style)))
+ ((2) (set-accidental-style (cadr style) (car style)))
+ (else
+ (ly:parser-parse-error parser (_ "not an accidental style")
+ location)
+ (make-music 'Music))))
%% arpeggios
--
1.7.9.5
- Context.Grob considered as symbol list, David Kastrup, 2012/10/09
- [PATCH 08/16] Allow property and grob paths to be constructed from strings, David Kastrup, 2012/10/09
- [PATCH 07/16] Add symbol-list? predicate, David Kastrup, 2012/10/09
- [PATCH 05/16] Let \accidentalStyle detect its optional context argument by looking at its letter case, David Kastrup, 2012/10/09
- [PATCH 11/16] Replace the rather fuzzy list-or-symbol? with symbol-list-or-symbol?, David Kastrup, 2012/10/09
- [PATCH 13/16] Change \accidentalStyle to get a symbol list as argument,
David Kastrup <=
- [PATCH 03/16] parser.yy: make is_regular_identifier match the lexer definition, David Kastrup, 2012/10/09
- [PATCH 14/16] convert-ly rule for \alterbroken, \accidentalStyle, \overrideProperty, David Kastrup, 2012/10/09
- [PATCH 01/16] Assignments can't contain literal lyric music (wrong lexer mode), David Kastrup, 2012/10/09
- [PATCH 04/16] Factor SCM_IDENTIFIER out from embedded_scm_arg*, David Kastrup, 2012/10/09
- [PATCH 02/16] parser.yy: FRACTION does not require a closed expression before it, David Kastrup, 2012/10/09
- [PATCH 16/16] Let \overrideProperty accept nested properties, David Kastrup, 2012/10/09
- [PATCH 12/16] Make \alterBroken, \hide, \omit, \overrideProperty, \shape take unquoted Context.Grob specs, David Kastrup, 2012/10/09
- [PATCH 09/16] Allow the string "xxx.yyy" to parse as a symbol list, David Kastrup, 2012/10/09
- [PATCH 06/16] Allow LilyPond strings to stand in for symbols when parsing, David Kastrup, 2012/10/09
- [PATCH 15/16] Run scripts/auxiliar/update-with-convert-ly.sh, David Kastrup, 2012/10/09