4
votes

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
Perhaps the meta-prefix-char was set to the capital letter M? If that sounds possible, you could grep your customizations and third-party libraries for that variable. On my machine, a capital letter M is 77. You can use describe-variable to check the value.lawlist
I guess it's (define-key smartparens-mode-map (kbd "M up") nil), it's binding M u p to nil. You really want (kbd "M-<up>")npostavs
Note that when you press your Meta key (or Ctrl key, or any other modifier), Emacs does not then wait for another key like this. Pressing and releasing a modifier key does nothing at all, so "activating Meta key" is a misleading description -- it's neither what is happening, nor something which makes a great of sense (unless calling event-apply-meta-modifier, but it's hard to bind something to that by accident).phils
I'm still searching for the answer to this title.CodyChan

1 Answers

2
votes

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)))