I sometimes want to insert a new heading without first jumping to the end of the current tree. It was fairly simple to guess that this could be achieved by calling (org-insert-heading), but from C-h f this function didn't seem to be bound to any key. I discovered by accident, though, that this function is, usually, called after C-c <return>. Question: was there any non-accidental and easy way of discovering this?

  • C-h b org-insert-heading ? – gigiair Apr 22 '20 at 17:51
  • @Drew, f, sorry – Toothrot Apr 22 '20 at 18:44
  • @gigiair: did you mean C-h w org-insert-heading RET? That gives "... not on any key". C-h b describes the current set of bindings. – NickD Apr 23 '20 at 16:21

Org mode does a bunch of context-dependent actions by binding a key (e.g. C-c C-c or C-c RET) to a generic function (org-ctrl-c-ctrl-c or org-ctrl-c-ret). The function looks around to determine a context (am I in a header? or a source block? or a table? etc.) and then calls another function (e.g. org-insert-heading) depending on that context.

I don't know of any way to find these context-dependent actions through general emacs mechanisms. You need to consult the doc string of the specific top level function, e.g. C-h f org-ctrl-c-ret RET. You might do C-h f org-ctrl-c- TAB to find some of these dispatcher-type functions, but there are others as well: e.g M-RET is bound to org-meta-return.

It might be nice to collect all those in a table somewhere and add them to the Org mode documentation, but AFAIK no such table exists ATM.

  • I have often wanted to know what C-c <return> or <tab> does in the current context. Very frustrating. Tables in the docs is a good idea. – gregoryg Sep 20 '20 at 14:57

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.