From a2fad11ad4cd51a3a19b7eb37bc9ed5b56ad7c03 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 17 Aug 2013 17:34:00 +0200 Subject: [PATCH] Issue 3505: Let add-grace-property and remove-grace-property work from current context 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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index c07a935fe4..d714deec8c 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -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) -- 2.39.2