C-k
is bound to org-kill-line
by default (try with emacs -Q
), not to org-backward-heading-same-level
(which is bound to C-c C-b
by default).
One possibility is that somewhere in your init file, you rebind C-k
to org-backward-heading-same-level
but that has nothing to do with loading org
, so the eval-after-load
may trigger early, but you rebind it afterwards. You should check your init file(s) for such a setting and just expunge it.
[Feel free to stop reading here and try to fix your problem. Afterwards and if you are curious, read the following, although I don't think it has anything to do with your immediate problem; but it may be useful in various obscure situations in the future.]
There is an additional wrinkle with C-k
in particular however, that might be worth knowing (although it's firmly in the advanced category). C-k
is normally bound to kill-line
in most modes. Org mode redefines it but not by setting C-k
in the keymap, but by remapping the kill-line
command to org-kill-line
- see org-keys.el:
(org-remap org-mode-map
'self-insert-command 'org-self-insert-command
'delete-char 'org-delete-char
'delete-backward-char 'org-delete-backward-char
'kill-line 'org-kill-line
...
You can undefine such remappings, but you have to use something like the following:
(define-key org-mode-map [remap kill-line] nil)
although you should think through the implications.
And even after you do this, C-k
is still bound in the global map to kill-line
, so if you really want to make it do nothing, you will need to undefine it there as well. That is something I would NOT recommend however.
As I mentioned above, this is probably NOT the problem you are having; it is something to keep in the back of your mind for future reference. The moral of the story is that keymap handling can be a complicated subject in Emacs.