robustness checks.
* lily/parser.yy (music_property_def): allow \override #'a #'b =
#c too.
* lily/context-property.cc (lookup_nested_property): new function.
(evict_from_alist): new function.
(general_pushpop_property): new function.
(execute_general_pushpop_property): rewrite. Support nested
properties too.
2005-10-17 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/context-property.cc (execute_general_pushpop_property):
+ robustness checks.
+
+ * input/regression/override-nest.ly: new file.
+
* python/convertrules.py (FatalConversionError.subber): conversion
rule for #'callbacks
(if (and (memq 'note-head-interface interfaces)
(memq pos '(-2 -3 -5)))
(begin
- (ly:grob-set-property! grob 'print-function Text_interface::print)
+ (ly:grob-set-callback! grob 'stencil Text_interface::print)
(ly:grob-set-property! grob 'font-family 'roman)
(ly:grob-set-property!
grob 'text
\set autoBeaming = ##f
\time 2/4
<d f g>4
- \once \override NoteHead #'print-function = #Note_head::brew_ez_stencil
+ \once \override NoteHead #'callbacks #'stencil = #Note_head::brew_ez_stencil
<d f g>
\once \override NoteHead #'style = #'cross
<d f g>
{
SCM current_value = scm_car (current_context_val);
SCM daddy = scm_cdr (current_context_val);
+
+ if (!scm_is_pair (grob_property_path)
+ || !scm_is_symbol (scm_car (grob_property_path)))
+ {
+ programming_error ("Grob property path should be list of symbols.");
+ return;
+ }
+
SCM symbol = scm_car (grob_property_path);
SCM new_alist = evict_from_alist (symbol, current_value, daddy);
/* properties */
"note-names "
"accidental-grob "
+ "glyph-name "
"stem-attachment "
"style "
);
}
else if (tag == ly_symbol2scm ("pop")) {
m = MY_MAKE_MUSIC ("RevertProperty");
- grob_path = scm_cdr (args);
+ grob_path = args;
}
m->set_property ("symbol", symbol);
return scm_from_int (dir);
}
+/* A separate function, since this is used elsewhere too. */
Direction
Stem::get_default_dir (Grob *me)
{
(elements ,ly:music-list? "A list of elements for sequential of simultaneous music, or the alternatives of repeated music. ")
(force-accidental ,boolean? "If set, a cautionary accidental should always be printed on this note")
(grob-property ,symbol? "The symbol of the grob property to set. ")
+ (grob-property-path ,list? "A list of symbols, locating a nested grob property, e.g. (beamed-lengths details). ")
(grob-value ,scheme? "The value of the grob property to set")
(input-tag ,scheme? "Arbitrary marker to relate input and output")
(inversion ,boolean? "If set, this chord note is inverted.")
(define (document-property-operation op)
(let ((tag (car op))
- (body (cdr op))
- (sym (cadr op)))
+ (context-sym (cadr op))
+ (args (cddr op))
+ )
(cond
((equal? tag 'push)
+ (let*
+ ((value (car args))
+ (path (cdr args)))
+
(string-append
- "@item "
- (if (null? (cddr body))
- "Revert "
- "Set ")
- "grob-property @code{"
- (symbol->string (cadr body))
- "} in @ref{" (symbol->string sym)
- "}"
+ "@item Set "
+ (format "grob-property @code{~a} " (string-join path " "))
+ (format " in @ref{~a} " sym)
(if (not (null? (cddr body)))
- (string-append " to @code{" (scm->texi (cadr (cdr body))) "}" ))
- "\n"))
+ (format " to @code{~a}" (scm->texi value))
+ "")
+
+ "\n")))
((equal? (object-property sym 'is-grob?) #t) "")
- ((equal? (car op) 'assign)
+ ((equal? tag 'assign)
(string-append
"@item Set translator property @code{"
(symbol->string (car body))