Ordinary keyboard macros are already very useful, allowing you to carefully construct repeatable actions to automate batch tasks. But with Symex, they become much more powerful, since the keystrokes recorded by the macros represent not elementary cursor movements and manual edits, but complex traversals and rich structural operations.
When you define macros in symex mode (e.g., via C-x (
, or via q
for Evil users), make sure that the commands you use are those that have the same effect in every situation. For instance, the “up” and “down” motions (default: k
and j
) could vary based on “branch memory” — up may sometimes move you to the first position on the higher level, but at other times it may move you to the third position, if that happens to be your most recent position. Using up and down in your macro would mean that it could have different results in each tree depending on your activities in the tree, unless you remember to reset the frame of reference by using something like 0
or $
. Instead, it may be more natural to use the “flow” traversal commands (default: f
and b
), repeating them or prefixing them with count arguments if necessary, to move around in a fully deterministic way. This will ensure that your macros behave the same way in every case.