It looks like a bug, to me. Adding some debug message
calls, I see that the first n
(after p p
), correctly calls my-forward-word
, but the second n
then is interpreted in my-backward-word-map
, not in my-forward-word-map
.
IOW, the call in my-forward-word
of (set-transient-map my-forward-word-map t)
seems to have no effect.
(And you get the same behavior if you bind M-n
instead of n
and M-p
instead of p
, in the transient maps; IOW, if you try to use only M-n
and M-p
.)
Unless someone points out something we're missing, you might consider filing a bug report: M-x report-emacs-bug
.
Yes, I'd say that it is definitely a bug. I just tried it in Emacs 24.3, for which the function was named set-temporary-overlay-map
instead of set-transient-map
, and there it works. So this is apparently a regression, introduced in Emacs 24.4.
Please file a bug report.