4

I cannot unbind the key M-l in org-mode.

When the cursor is in an org-mode buffer, I tried to eval (M-:)

(unbind-key "M-l" org-mode-map)
;; ^^^ from bind-key.el

(define-key org-mode-map (kbd "M-l") nil)

But C-h k M-l always says:

M-l runs the command org-demote-subtree (found in org-mode-map), which
is an interactive compiled Lisp function in ‘org.el’.

It is bound to M-l, C-c C->, <normal-state> M-l.

Same problem for other keys, e.g. C-k. I also use bind-key.el for other bindings, in case that is of interest.

3
  • Has evil-mode remapped the Org keys? M-l is typically lower-case in the global key map. Did you also try (define-key org-mode-map (kbd "M-l") nil) ?
    – RichieHH
    Feb 17, 2020 at 0:01
  • Yes, I already tried the command, see above. From the output of C-h k M-l (above), I guess, yes, evil-mode has remapped the key in normal mode "<normal-state>". But I'm not sure what this means.
    – schoettl
    Feb 17, 2020 at 7:30
  • So you did, apologies. I missed that.
    – RichieHH
    Feb 17, 2020 at 8:46

1 Answer 1

3

I always use helpful-key to unbind my keys. It's not mandatory but gives better readability.

As you know, for different Emacs configuration everybody has different modes keybindings. So there is not any exact answer for everybody, but there is same path that can lead you to unbind unwanted keys.

The way that I do.

  1. Install package
  2. M-x helpful-keybind
  3. Press M-l

Key Bindings(Before)

evil-org-mode-map <insert-state> M-l
evil-org-mode-map <normal-state> >
evil-org-mode-map <normal-state> M-l
org-mode-map ESC <right>
  1. Depends on your keybinding, apply this changes
(define-key evil-org-mode-map (kbd "<insert-state> M-l") nil)
(define-key evil-org-mode-map (kbd "<normal-state> M-l") nil)

Key Bindings(After)

esc-map l 
global-map M-l
1
  • Thank you! I did not recognize that "<normal-state>" is part of the key binding. And I still don't understand it, to be honest; cannot find documentation on it. In my case it was just the org-mode-map.
    – schoettl
    Feb 18, 2020 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.