undo works with the new pand framework

parent e2844f43
......@@ -1548,7 +1548,17 @@ SCM_DEFINE(gp_pop_engine, "gp-pop-engine", 0, 0, 0, (),
SCM s_stack = SCM_CAR(gp_engine_path);
if(SCM_CONSP(gp_store_path))
gp_store_path = SCM_CDR(gp_store_path);
else
scm_misc_error
("gp-pop-engine","gp_store_path not a nonempty list", SCM_EOL);
if(SCM_CONSP(gp_engine_path))
gp_engine_path = SCM_CDR(gp_engine_path);
else
scm_misc_error
("gp-pop-engine","gp_engine_path not a nonempty list", SCM_EOL);
gp_paths = scm_cons(gp_engine_path, gp_store_path);
......@@ -1589,7 +1599,7 @@ SCM_DEFINE(gp_push_engine, "gp-push-engine", 2, 0, 0, (SCM s, SCM e),
int logical = gp->_logical_;
gp_engine_path = scm_cons(x , gp_engine_path);
gp_paths = scm_cons(gp_engine_path, SCM_BOOL_F);
gp_paths = scm_cons(gp_engine_path, SCM_EOL);
scm_fluid_set_x(gp_current_stack,e);
......@@ -1662,7 +1672,7 @@ SCM_DEFINE(gp_set_engine, "gp-set-engine", 1, 0, 0, (SCM paths),
"")
#define FUNC_NAME s_gp_set_engine
{
SCM e = SCM_CDR(SCM_CAR(paths));
SCM e = SCM_CDR(SCM_CAR(SCM_CAR(paths)));
SCM pathout = gp_paths;
gp_engine_path = SCM_CAR(paths);
......@@ -1688,9 +1698,6 @@ SCM_DEFINE(gp_combine_engines, "gp-combine-engines", 1, 0, 0, (SCM l),
gp->gp_ci[0] = vec;
gp->gp_ci++;
gp_store_path = scm_cons(vec, gp_store_path);
SCM_SETCDR(gp_paths, gp_store_path);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
......@@ -1712,6 +1719,13 @@ SCM_DEFINE(gp_combine_push, "gp-combine-push", 1, 0, 0, (SCM r),
#define FUNC_NAME s_gp_combine_push
{
gp_store_path = scm_cons(r, gp_store_path);
if(SCM_CONSP(gp_paths))
SCM_SETCDR(gp_paths, gp_store_path);
else
scm_misc_error("gp-combine-push","gp_paths not a cons ~a~%",
scm_list_1(gp_paths));
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
......
......@@ -904,9 +904,16 @@ static inline void gp_unwind_(SCM s , int ncons, int nvar, int nci,
lt = gp_gp_cdr(s,s);
if(SCM_CONSP(lt))
{
paths = SCM_CDR(lt);
path = SCM_CAR(paths);
spath = SCM_CDR(paths);
SCM ltpaths = SCM_CDR(lt);
if(SCM_CONSP(ltpaths))
{
path = SCM_CAR(ltpaths);
spath = SCM_CDR(ltpaths);
}
else
{
path = gp_engine_path;
}
}
else
path = gp_engine_path;
......@@ -961,10 +968,15 @@ static inline void gp_unwind_(SCM s , int ncons, int nvar, int nci,
{
if(scm_is_true(lpath))
{
s = SCM_CAR(lpath);
paths = SCM_CDR(gp_gp_cdr(s,s));
spath = SCM_CDR(paths);
gp_store_path = spath;
gp_paths = paths;
s = SCM_CAR(lpath);
lpath = SCM_CDR(lpath);
ncons = scm_to_int(SCM_CAR(lpath));
lpath = SCM_CDR(lpath);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment