I would like to add a "super-heading" with recursive section indentation.

By that I mean that I want to transform the content:

* Fruits
** Durian
** Jackfruit
** Lychee

to become

* Produce
** Fruits
*** Durian
*** Jackfruit
*** Lychee

But of course whatever is under "Durian" etc also need to be appropriately indented.

Is there a way to do this?


1 Answer 1


You can demote the whole Fruits subtree with M-S-<right> (hold down Meta and Shift and press the right arrow). That key combo is bound to the function org-shiftmetaright which does context-dependent things: when it is at a heading it calls org-demote-subtree which does what you want with the Fruits subtree.

The doc string of org-shiftmetaright which you can get with C-h f org-shiftmetaright says:

Demote subtree or insert table column.
Calls ‘org-demote-subtree’, ‘org-indent-item-tree’, or
‘org-table-insert-column’, depending on context.  See the
individual commands for more information.

You can then add a top-level Produce heading by opening up an empty line above with C-O, if necessary, and adding a heading with M-RET.

Demoting a subtree can also be done through the Org menu item,: look under Edit Structure/Demote subtree. See Structure Editing in the Org manual for more structure-editing commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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