0

I don't like all the major mode bindings. So I usually just (setq the-map-in-question (make-sparse-keymap)) each time I come across a new major mode.

But for c++-mode-map, it does not remain empty. I use help-fns+.el to display the bindings of the keymap. When I open emacs, c++-mode-map is indeed empty. But as soon as I open a C++ file, the following bindings in the keymap (in the picture) appears.

Why? Picture of the keymaps that appears in c++-mode-map

Edit: This part seems to be the problem (in cc-mode.el): enter image description here

I still don't know how to fix this issue though.

Alan
  • 37
  • 5

1 Answers1

4

Messing with keymaps is usually best done after the defining library has loaded.

(with-eval-after-load "cc-mode"
  (setq c++-mode-map (make-sparse-keymap)))
phils
  • 48,657
  • 3
  • 76
  • 115