How to remove a key from a minor-mode keymap in Emacs?

前端 未结 3 1974
渐次进展
渐次进展 2020-12-29 18:37

I have globally assigned C-c/ to ace-jump-mode but reftex-mode (a minor mode for citations used with AucTeX) overrides this key with some function I never use.<

3条回答
  •  清歌不尽
    2020-12-29 19:24

    You can change an existing key map using define-key. By passing nil as the function to call, the key will become unbound. I guess that you should be able to do something like:

    (define-key reftex-mode-map "\C-c/" nil)
    

    Of course, you should do this in some kind of hook, for example:

    (defun my-reftex-hook ()
      (define-key reftex-mode-map "\C-c/" nil))
    (add-hook 'reftex-mode-hook 'my-reftex-hook)
    

提交回复
热议问题