]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/context-property.cc (execute_general_pushpop_property):
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 17 Oct 2005 00:30:32 +0000 (00:30 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 17 Oct 2005 00:30:32 +0000 (00:30 +0000)
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.

ChangeLog
Documentation/user/introduction.itely
lily/context-property.cc
lily/note-head.cc
lily/parser.yy
lily/stem.cc
scm/define-music-properties.scm
scm/document-translation.scm

index be7900bee17dc7b43f5d91bd7bb641a17be22809..1bf3a05b47ddd0db3227389a0ef7c21799589b6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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
 
index 78bc0220aa5317b0d51d0bdb38285d4e92ccf25f..3d8b8c540e22b72f5591bfc862917ce0b4763cfb 100644 (file)
@@ -319,7 +319,7 @@ fragment.
     (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
@@ -336,7 +336,7 @@ fragment.
    \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>
index d7923c7018584b410ae5ee85d34a38ec0fc085a0..4ee9a4300214c5abce9f596753e3991225048335 100644 (file)
@@ -161,6 +161,14 @@ execute_general_pushpop_property (Context *context,
     {
       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);
 
index 76ce69b7065642d9738729baa8b6989ab83fdc05..3b80b114ba0abb21a1e4944429138a15caa8b1af 100644 (file)
@@ -153,6 +153,7 @@ ADD_INTERFACE (Note_head, "note-head-interface",
               /* properties */
               "note-names "
               "accidental-grob "
+              "glyph-name "
               "stem-attachment "
               "style "
               );
index 52c07bf8672f1ab3c4e61db709c00b198e1f9dfe..4ddc525e55f1a1376c60a0422627dcbf79ebad61 100644 (file)
@@ -2755,7 +2755,7 @@ property_op_to_music (SCM op)
                }
        else if (tag == ly_symbol2scm ("pop")) {
                m = MY_MAKE_MUSIC ("RevertProperty");
-               grob_path = scm_cdr (args);
+               grob_path = args;
                }
 
        m->set_property ("symbol", symbol);
index cb41fa15fb82d7afef325fe060e5bfa6fa4a696a..c9974220a89ebcc72c24892aa2479ed344147267 100644 (file)
@@ -467,6 +467,7 @@ Stem::calc_direction (SCM smob)
   return scm_from_int (dir);
 }
 
+/* A separate function, since this is used elsewhere too.  */
 Direction
 Stem::get_default_dir (Grob *me)
 {
index 8bc0e995abe3e3026403bb87d48e24cf7fe5b9dc..263c188a62ae20ec2da8b8cacfba46973ec5e2e3 100644 (file)
@@ -48,6 +48,7 @@ descend in the context tree.")
      (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.")
index a7ce3b993442f69302ad4e675465ff13d5953fdf..096de09c49be532c9ca1b9e777ee012db7903649 100644 (file)
 
 (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))