From 1ec92395c0ac0f8aa26cf4e2472ef21d9c620b32 Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sat, 21 Jul 2012 12:33:03 +0200 Subject: [PATCH] Issue 2688: Add ly:context-mod-apply! function. --- lily/context-mod-scheme.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lily/context-mod-scheme.cc b/lily/context-mod-scheme.cc index ce6d149dbb..9c79c37859 100644 --- a/lily/context-mod-scheme.cc +++ b/lily/context-mod-scheme.cc @@ -55,3 +55,16 @@ LY_DEFINE (ly_make_context_mod, "ly:make-context-mod", else return Context_mod ().smobbed_copy (); } + +LY_DEFINE (ly_context_mod_apply_x, "ly:context-mod-apply!", + 2, 0, 0, (SCM context, SCM mod), + "Apply the context modification @var{mod} to @var{context}.") +{ + LY_ASSERT_SMOB (Context, context, 1); + LY_ASSERT_SMOB (Context_mod, mod, 2); + + apply_property_operations (unsmob_context (context), + unsmob_context_mod (mod)->get_mods ()); + scm_remember_upto_here_1 (context); + return SCM_UNSPECIFIED; +} -- 2.39.2