The root cause here seems to be related to the funky way calc
is loading its keybindings.
If I start emacs with no customization of calc
(or casual-calc
, which I'm also trying to use), then do M-x calc
, and then do C-h k t
to see about the t
key in calc, I get this!
t runs the command calc-missing-key (found in calc-mode-map), which is
an autoloaded interactive Lisp function in ‘calc-misc.el’.
It is bound to C-k, C-w, C-M-w, M-k and M-w, and many ordinary text
characters.
(calc-missing-key N)
This is a placeholder for a command which needs to be loaded from calc-ext.
When this key is used, calc-ext (the Calculator extensions module) will be
loaded and the keystroke automatically re-typed.
If I hit t
in calc
, then run the above declaration, it works.
If I try that declaration before doing t
in calc
, it doesn't work -- it looks like that prefix doesn't even get defined until you do t
in calc.
Since it seems that the t
prefix keymap isn't defined until the calc-ext
package gets loaded, the solution seems to be to use that:
(use-package calc-ext
:defer t
:bind (:map calc-mode-map
("t<" . calc-trail-first)
("t>" . calc-trail-last)
("t[" . calc-trail-scroll-left)
("t]" . calc-trail-scroll-right)))