disable package key-binding override in Emacs

elisp, emacs, perforce

Solution

To remove an over-riding binding from a mode keymap, so that Emacs will fall back to what it would usually use, you would normally do something like this:

(eval-after-load "vhdl-mode"
  '(progn
    (define-key vhdl-mode-map (kbd "M-e") nil) ;; unbind M-e
    (define-key vhdl-mode-map (kbd "M-a") nil))) ;; unbind M-a

As MrBones comments, though, these are not very desirable custom bindings. Both M-s and M-e have standard uses in Emacs (the former is normally a prefix binding which a bunch of useful things hang off), and if possible you should consider moving those bindings to other keys.

(My impression is that the "preinstalled on site" version had these bindings already in place, though? In which case that's more a note for whoever maintains that...)

Problem

This seems like some basic Emacs configuration issue that I do not understand. I have Emacs 24.3 preinstalled on site. In a Verilog file, pressing M-s is bound to p4-current-file "edit" (Perforce operation), likewise M-e is bound to p4-current-file "sync". All is well. The problem is in a VHDL file, M-s does the same, but M-e is bound to "vhdl-end-of-statement". I would like it to do "p4 edit" like in Verilog. Seems that vhdl-mode is overriding the M-e key function, and I cannot not find how to change this permanently. If I do local-unset-key and unset M-e, I get the desired result, M-e does p4 edit, but when I restart Emacs M-e does "vhdl-end-of-statement" again. How can I change M-e to do "p4 edit" permanently? I'm not fluent in Lisp, but will be happy to get instructions how to change this. Thanks.

Original source