I would like to change the mode-map of a minor mode with mode map.
I mean replacing the original mode-map that was specified in the
define-minor-mode call with another one. Keeping the two mode-map unmodified.
How could I do that?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
After digging a bit I found the
minor-mode-map-alist variable in the doc. It is holding a mapping between the minor modes symbol, and their associated mode-map.
Hence to replace the mode-map of
'my-minor-mode I went for:
(setcdr (assoc 'my-minor-mode minor-mode-map-alist) my-minor-mode-map))