Backport from trunk: compute shortcuts in tmm.el.