By using the higher level function read-key instead of the lower level
read-event, translation keymaps such as key-translation-map are taken
into account, which allows sniping for the intended characters, i.e.
after translation.
Since read-key doesn't return special symbols but characters, adapt the
tests for tab, enter, escape, and backspace.
While at it, use cl-incf for consistency with the code nearby.
By using the higher level function
read-key
instead of the lower levelread-event
, translation keymaps such askey-translation-map
are taken into account, which allows sniping for the intended characters, i.e. after translation.Since read-key doesn't return special symbols but characters, adapt the tests for tab, enter, escape, and backspace.
While at it, use
cl-incf
for consistency with the code nearby.