how to find where a key binding is defined in emacs?

纵饮孤独 提交于 2019-12-13 00:29:01

问题


Somehow shift + m is got bound to Meta key in emacs. Now I cant type any words that start with M like Mock. I want to find why it is happening or which package is causing this.

There is one question regarding this issue but doesn't solve this problem.

I tried C h k m which showed m runs command self-insert-command

But when when i try C h k M it is activating Meta key and is waiting for another key to input.

The same is happening with C h c M.

Is there any way to find out what is causing this?

Update:

  1. My emacs config https://github.com/ChillarAnand/.emacs.d

  2. The problem is not occuring at OS level. If I start emacs with emacs -Q everything works fine.


回答1:


The problem was the code

(define-key smartparens-mode-map (kbd "M up") nil)
(define-key smartparens-mode-map (kbd "M down") nil)))

This doesn't bind shift m as Meta but rather binds the key sequences M u p and M d o w n to nil. To specify Meta inside kbd use M-{the key}, to specify up use <up>, for the code in question:

(define-key smartparens-mode-map (kbd "M-<up>") nil)
(define-key smartparens-mode-map (kbd "M-<down>") nil)))


来源:https://stackoverflow.com/questions/29226265/how-to-find-where-a-key-binding-is-defined-in-emacs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!