I have been mulling over the temporal ordering of commands with on-key. For example:
define-command test-on-key-bad %{
on-key %{
echo one
}
on-key %{
echo two
}
echo three
}
I would expect to see “one, two, three” on the echo line (in this order, after pressing one key, then another one – except, of course, that “two” would be quickly covered by “three”). What would you expect?
NB: the only way I could get the order right was to nest the on-keys:
define-command test-on-key-good %{
on-key %{
echo one
on-key %{
echo two
}
}
}
In this second version I have removed echo three
for clarity. Note that if echo three
were a command doing some serious work and depending on some option setting done by the “previous” on-keys … then the command would fail.