5

I just updated emacs org-mode and when visiting org files, this binding takes effect:

C-TAB (org-force-cycle-archived) Cycle a tree even if it is tagged with ARCHIVE.

What's the best way to disable this binding?

I use C-Tab for moving between windows.

I tried creating a hook but this is not doing the trick. The local key binding still takes precedence.

(defun my-org-mode-hook ()
  (define-key global-map '[(control tab)] 'other-window)
  (define-key global-map '[(shift control tab)] 'my-other-window-back)
  (global-set-key '[(control tab)] 'other-window)
  (global-set-key '[(shift control tab)] 'my-other-window-back)
  (local-set-key '[(control tab)] 'other-window)
  (local-set-key '[(shift control tab)] 'my-other-window-back)
  )
(add-hook 'org-mode-hook 'my-org-mode-hook)

2 Answers 2

8

Here are examples of some things I disable in org-mode -- I used require, but you could use instead an eval-after-load -- you don't need to do it each time an org-mode buffer loads (e.g., a mode-hook is overkill):

(require 'org)

(define-key org-mode-map (kbd "<M-S-up>") nil)
(define-key org-mode-map (kbd "<M-S-down>") nil)
(define-key org-mode-map (kbd "<M-up>") nil)
(define-key org-mode-map (kbd "<M-down>") nil)
(define-key org-mode-map (kbd "<M-S-left>") nil)
(define-key org-mode-map (kbd "<M-S-right>") nil)
(define-key org-mode-map (kbd "<M-left>") nil)
(define-key org-mode-map (kbd "<S-left>") nil)
(define-key org-mode-map (kbd "<S-right>") nil)
(define-key org-mode-map (kbd "<S-up>") nil)
(define-key org-mode-map (kbd "<S-down>") nil)
(define-key org-mode-map (kbd "<M-right>") nil) 
(define-key org-mode-map (kbd "C-<tab>") nil)
(define-key org-mode-map (kbd "C-S-<tab>") nil)
(define-key org-mode-map (kbd "<C-up>") nil)
(define-key org-mode-map (kbd "<C-down>") nil)
1
  • Excellent! works perfectly! Oct 20, 2014 at 5:00
2

I have a similar problem with M-up and M-down, which I use for changing the text size. If you are a use-packager this resolves it:-

  (use-package org
   :bind (:map org-mode-map
          ("<M-up>"   . nil)           ;; do not steal my keys!
          ("<M-down>" . nil)           ;; ditto
          ("<C-f3>"   . org-metaup)    ;; use this instead
          ("<M-f3>"   . org-metadown)  ;; ditto
          ;; etc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .