This will not survive an update of TeXmacs. As written somewhere in the Help some of the scheme files are not loaded just right away at the boot but delayed to have faster response. So it could happen that you redefine the bindings before they are actually defined, and then when the system bindings are loaded they will change yours. In particular in $TEXMACS_PATH/progs/init-texmacs.scm
you can see the following lines:
;(display "Booting math mode\n")
(lazy-keyboard (math math-kbd) in-math?)
(lazy-keyboard (math math-sem-edit) in-sem-math?)
(lazy-menu (math math-menu) math-format-menu math-format-icons
math-menu math-insert-menu
math-icons math-insert-icons
math-correct-menu semantic-math-preferences-menu
context-preferences-menu insert-math-menu)
(lazy-initialize (math math-menu) (in-math?))
(lazy-define (math math-edit) brackets-refresh)
which load lazily the math mode. In $TEXMACS_PATH/progs/kernel/gui/kbd-define.scm
you see the definition of lazy-keyboard
. There is a procedure (lazy-keyboard-force)
which you need to run before you redefine the keybinding, in order to be sure that it is operative. I think also another possibility is to create a copy of math-kbd.scm
in your $TEXMACS_HOME_PATH
, i.e. in
$TEXMACS_HOME_PATH/progs/progs/math/math-kbd.scm
and this will be found before the system one. But this solution prevents updates to this module, so it could generate bugs whenever new versions of TeXmacs change these functionalities in some way. HTH.