Hi Kasper. I wasn't sure I should be so presumptuous to put this somewhere on Github, but I think the following does the trick.
In zoom.cc, replace zoom::zoom contents with:
// Convert rules into a list (if it isn't already)
rules = cadabra::make_list(rules);
// Iterate over the list
cadabra::do_list(rules, rules.begin(), [&](Ex::iterator it) {
// Create a proper substitution rule out of the pattern (otherwise
// substitute will not swallow it).
auto wrap = rules.wrap(it, str_node("\\arrow"));
rules.append_child(wrap, str_node("dummy"));
return true;
});
This acts as
ex := A1 x+A2 y + A3 z.
zoom(ex, ${x A??, y A??});
and returns
A1 x + A2 y + ...
It also preserves the original behavior if the argument is not a list.