There are a lot of occasions where, by default, the key-binding C-c C-c
does something useful - e.g. in org-mode or magit. I would like to take whatever function C-c C-c
runs, and bind that function to something like F8
, without having to know what specific function is being called under the hood.
Thus: how can I take an existing key-binding, obtain the function which that key-binding would run, and then simply run that function?
(I'm aware it would take me 5 min to just make a list of functions that I'm interested in, and bind them appropriately in the respective modes - but I would nevertheless like to know how to achieve the above)
C-c C-c
in org-mode runs a generic command (org-ctrl-c-ctrl-c
) that then dispatches to different functions, depending on context. The solutions below will get you to the top-level command dispatcher, but if you want to get to the lower level dispatched function, you will have to read theorg-ctrl-c-ctrl-c
code.