CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/10/17 00:30:32

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

Log message:
        * lily/context-property.cc (execute_general_pushpop_property):
        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.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.4185&tr2=1.4186&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/Documentation/user/introduction.itely.diff?tr1=1.144&tr2=1.145&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/context-property.cc.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/note-head.cc.diff?tr1=1.158&tr2=1.159&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/parser.yy.diff?tr1=1.492&tr2=1.493&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/stem.cc.diff?tr1=1.284&tr2=1.285&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/define-music-properties.scm.diff?tr1=1.42&tr2=1.43&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/document-translation.scm.diff?tr1=1.25&tr2=1.26&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.4185 lilypond/ChangeLog:1.4186
--- lilypond/ChangeLog:1.4185   Mon Oct 17 00:04:39 2005
+++ lilypond/ChangeLog  Mon Oct 17 00:30:31 2005
@@ -1,5 +1,10 @@
 2005-10-17  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * 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: lilypond/Documentation/user/introduction.itely
diff -u lilypond/Documentation/user/introduction.itely:1.144 
lilypond/Documentation/user/introduction.itely:1.145
--- lilypond/Documentation/user/introduction.itely:1.144        Tue Sep 27 
10:01:15 2005
+++ lilypond/Documentation/user/introduction.itely      Mon Oct 17 00:30:31 2005
@@ -319,7 +319,7 @@
     (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 @@
    \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: lilypond/lily/context-property.cc
diff -u lilypond/lily/context-property.cc:1.19 
lilypond/lily/context-property.cc:1.20
--- lilypond/lily/context-property.cc:1.19      Mon Oct 17 00:04:44 2005
+++ lilypond/lily/context-property.cc   Mon Oct 17 00:30:31 2005
@@ -161,6 +161,14 @@
     {
       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: lilypond/lily/note-head.cc
diff -u lilypond/lily/note-head.cc:1.158 lilypond/lily/note-head.cc:1.159
--- lilypond/lily/note-head.cc:1.158    Sun Oct 16 14:28:39 2005
+++ lilypond/lily/note-head.cc  Mon Oct 17 00:30:31 2005
@@ -153,6 +153,7 @@
               /* properties */
               "note-names "
               "accidental-grob "
+              "glyph-name "
               "stem-attachment "
               "style "
               );
Index: lilypond/lily/parser.yy
diff -u lilypond/lily/parser.yy:1.492 lilypond/lily/parser.yy:1.493
--- lilypond/lily/parser.yy:1.492       Mon Oct 17 00:04:44 2005
+++ lilypond/lily/parser.yy     Mon Oct 17 00:30:31 2005
@@ -2755,7 +2755,7 @@
                }
        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: lilypond/lily/stem.cc
diff -u lilypond/lily/stem.cc:1.284 lilypond/lily/stem.cc:1.285
--- lilypond/lily/stem.cc:1.284 Sun Oct 16 14:28:39 2005
+++ lilypond/lily/stem.cc       Mon Oct 17 00:30:32 2005
@@ -467,6 +467,7 @@
   return scm_from_int (dir);
 }
 
+/* A separate function, since this is used elsewhere too.  */
 Direction
 Stem::get_default_dir (Grob *me)
 {
Index: lilypond/scm/define-music-properties.scm
diff -u lilypond/scm/define-music-properties.scm:1.42 
lilypond/scm/define-music-properties.scm:1.43
--- lilypond/scm/define-music-properties.scm:1.42       Fri Oct  7 09:12:03 2005
+++ lilypond/scm/define-music-properties.scm    Mon Oct 17 00:30:32 2005
@@ -48,6 +48,7 @@
      (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: lilypond/scm/document-translation.scm
diff -u lilypond/scm/document-translation.scm:1.25 
lilypond/scm/document-translation.scm:1.26
--- lilypond/scm/document-translation.scm:1.25  Mon Jul 18 23:37:26 2005
+++ lilypond/scm/document-translation.scm       Mon Oct 17 00:30:32 2005
@@ -115,25 +115,27 @@
 
 (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))


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to