6

Newer versions of org-mode remap C-up to org-backward-paragraph.

I would like C-up not to be remapped (and continue to use the standard Emacs' backward-paragraph instead).

But the standard ways of avoiding this remap do not work with org-mode (i.e., (local-unset-key [C-up]) and (define-key org-mode-map [C-up] 'backward-paragraph)) don't do anything). It seems that org-mode achieves this by remapping functions, not key bindings.

How to disable org-mode from remapping C-up?

Many thanks!

scaramouche
  • 1,772
  • 10
  • 24

1 Answers1

7

Org mode remaps all bindings of forward-paragraph and backward-paragraph to their Org counterparts with the following code which is executed when org.el is loaded:

(org-defkey org-mode-map [remap forward-paragraph] 'org-forward-paragraph)
(org-defkey org-mode-map [remap backward-paragraph] 'org-backward-paragraph)

You can undo this by overriding the remappings after org.el is loaded.

(defun org-take-back-paragraph-bindings ()
  (define-key org-mode-map [remap backward-paragraph] nil)
  (define-key org-mode-map [remap forward-paragraph] nil))
(eval-after-load "org" '(org-take-back-paragraph-bindings))
  • 1
    Something I only noticed recently is that the form you pass to `eval-after-load` can be a function. Hence in this scenario you could use: `(eval-after-load "org" #'org-take-back-paragraph-bindings)` – phils Dec 01 '14 at 00:40