+ {
+ SCM cell = scm_cons (symbol, new_value);
+ props_->alist_ = scm_cons (cell, props_->alist_);
+ return cell;
+ }
+ return SCM_EOL;
+}
+
+// Used for \once \override, returns a token for matched_pop
+SCM
+Grob_property_info::temporary_override (SCM grob_property_path, SCM new_value)
+{
+ SCM cell = push (grob_property_path, new_value);
+ if (!scm_is_pair (cell))
+ return cell;
+ if (scm_is_symbol (scm_car (cell)))
+ props_->nested_++;
+ cell = scm_cons (SCM_BOOL_T, cell);
+ props_->alist_ = scm_cons (cell, scm_cdr (props_->alist_));
+ return cell;
+}
+
+// Used for \once \revert, returns a token for matched_pop
+SCM
+Grob_property_info::temporary_revert (SCM grob_property_path)
+{
+ if (!check ())
+ return SCM_EOL;
+
+ SCM current_alist = props_->alist_;
+ SCM daddy = props_->based_on_;
+ SCM tail = SCM_EOL;
+
+ 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_EOL;
+ }
+
+ if (scm_is_pair (scm_cdr (grob_property_path)))
+ {
+ tail = assoc_tail (grob_property_path, current_alist, daddy);
+ if (scm_is_false (tail))
+ return SCM_EOL;
+ }
+ else
+ {
+ tail = assq_tail (scm_car (grob_property_path), current_alist, daddy);
+ if (scm_is_false (tail))
+ return SCM_EOL;
+ ++props_->nested_;
+ }
+
+ SCM cell = scm_cons (SCM_BOOL_F, scm_car (tail));
+ props_->alist_ = partial_list_copy (current_alist, tail,
+ scm_cons (cell, scm_cdr (tail)));
+ return cell;
+}
+
+
+void
+Grob_property_info::matched_pop (SCM cell)
+{
+ if (!scm_is_pair (cell))
+ return;
+ if (!check ())
+ return;
+ SCM current_alist = props_->alist_;
+ SCM daddy = props_->based_on_;
+ for (SCM p = current_alist; !scm_is_eq (p, daddy); p = scm_cdr (p))
+ {
+ if (scm_is_eq (scm_car (p), cell))
+ {
+ SCM key = scm_car (cell);
+ if (scm_is_false (key))
+ {
+ // temporary revert, reactivate
+ cell = scm_cdr (cell);
+ if (scm_is_symbol (scm_car (cell)))
+ props_->nested_--;
+ props_->alist_ = partial_list_copy (current_alist, p,
+ scm_cons (cell, scm_cdr (p)));
+ return;
+ }
+ if (!scm_is_symbol (key))
+ props_->nested_--;
+ props_->alist_ = partial_list_copy (current_alist, p, scm_cdr (p));
+ return;
+ }
+ }
+ return;