0

I would like to set (or unset in this case) keys in the org-columns-map at startup but when I use "org-columns" nothing happens. If I use "org" instead I get errors that org-columns-map is not defined.

    (with-eval-after-load "org-columns"
     (define-key org-columns-map (kbd "a") nil)
     (define-key org-columns-map (kbd "o") nil)
     (define-key org-columns-map (kbd "c") nil)
     (define-key org-columns-map (kbd "n") nil)
     (define-key org-columns-map (kbd "p") nil)
     (define-key org-columns-map (kbd "g") nil)
    )

If I use eval-region the definitions work as expected, but they do not set at startup.

1 Answer 1

1

There is no file called org-columns so the eval-after-load never triggers. The variable org-columns-map is defined in the file org-colview.el, so use

(with-eval-after-load "org-colview"
     (define-key org-columns-map (kbd "a") nil)
     (define-key org-columns-map (kbd "o") nil)
     (define-key org-columns-map (kbd "c") nil)
     (define-key org-columns-map (kbd "n") nil)
     (define-key org-columns-map (kbd "p") nil)
     (define-key org-columns-map (kbd "g") nil)
)

You can do C-h v org-columns-map RET to find out in which file the variable is defined (and of course that is not limited to org-columns-map: you can do that with any variable).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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