]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3505: Let add-grace-property and remove-grace-property work from current context
authorDavid Kastrup <dak@gnu.org>
Sat, 17 Aug 2013 15:34:00 +0000 (17:34 +0200)
committerDavid Kastrup <dak@gnu.org>
Fri, 30 Aug 2013 07:16:49 +0000 (09:16 +0200)
This basically sets the grace settings in the current context unless
the context specification is for a parent context in which case it is
directed there lest it become ineffective.

scm/music-functions.scm

index c07a935fe4512cf3cef5061bbc84b3b4132e2112..d714deec8c886123abff1072a46916580d0ffd4c 100644 (file)
@@ -915,12 +915,12 @@ actually fully cloned."
 (define-public (add-grace-property context-name grob sym val)
   "Set @var{sym}=@var{val} for @var{grob} in @var{context-name}."
   (define (set-prop context)
-    (let* ((where (ly:context-property-where-defined context 'graceSettings))
+    (let* ((where (or (ly:context-find context context-name) context))
            (current (ly:context-property where 'graceSettings))
            (new-settings (append current
                                  (list (list context-name grob sym val)))))
       (ly:context-set-property! where 'graceSettings new-settings)))
-  (context-spec-music (make-apply-context set-prop) 'Voice))
+  (make-apply-context set-prop))
 
 (define-public (remove-grace-property context-name grob sym)
   "Remove all @var{sym} for @var{grob} in @var{context-name}."
@@ -929,7 +929,7 @@ actually fully cloned."
          (eq? (cadr property) grob)
          (eq? (caddr property) sym)))
   (define (delete-prop context)
-    (let* ((where (ly:context-property-where-defined context 'graceSettings))
+    (let* ((where (or (ly:context-find context context-name) context))
            (current (ly:context-property where 'graceSettings))
            (prop-settings (filter
                            (lambda(x) (sym-grob-context? x sym grob context-name))
@@ -939,8 +939,7 @@ actually fully cloned."
                   (set! new-settings (delete x new-settings)))
                 prop-settings)
       (ly:context-set-property! where 'graceSettings new-settings)))
-  (context-spec-music (make-apply-context delete-prop) 'Voice))
-
+  (make-apply-context delete-prop))
 
 
 (defmacro-public def-grace-function (start stop . docstring)