From: David Kastrup <dak@gnu.org>
Date: Tue, 15 Sep 2015 18:44:29 +0000 (+0200)
Subject: Issue 4609/3: Create ly:context-matched-pop-property
X-Git-Tag: release/2.19.28-1~5^2~8^2~4
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ab62fdca38d77aaf780b209f2b420f9c70053d98;p=lilypond.git

Issue 4609/3: Create ly:context-matched-pop-property
---

diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc
index a26c168fac..169d0b7b3d 100644
--- a/lily/context-scheme.cc
+++ b/lily/context-scheme.cc
@@ -92,6 +92,19 @@ LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
   return SCM_UNSPECIFIED;
 }
 
+LY_DEFINE (ly_context_matched_pop_property, "ly:context-matched-pop-property",
+           3, 0, 0, (SCM context, SCM grob, SCM cell),
+           "This undoes a particular @code{\\override},"
+           " @code{\\once \\override} or @code{\\once \\revert}"
+           " when given the specific alist pair to undo.")
+{
+  Context *tg = LY_ASSERT_SMOB (Context, context, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, grob, 2);
+  Grob_property_info (tg, grob).matched_pop (cell);
+  return SCM_UNSPECIFIED;
+}
+
+
 LY_DEFINE (ly_context_property, "ly:context-property",
            2, 1, 0, (SCM context, SCM sym, SCM def),
            "Return the value for property @var{sym} in @var{context}."