Is it possible to prevent editing of text within a collapsed subtree in Org Mode? That is, I would like to make it impossible to edit the hidden text. This seems like something that should exist but I haven't seen a way to do it.


From the fine Org Manual -- 2.3.3 Catching Invisible Edits:

Sometimes you may inadvertently edit an invisible part of the buffer and be confused on what has been edited and how to undo the mistake. Setting org-catch-invisible-edits to non-nil will help prevent this. See the docstring of this option on how Org should catch invisible edits and process them.

I have this in my init.el:

(setq-default org-catch-invisible-edits 'smart)

I found out about the 'smart option by hitting C-h v org-catch-invisible-edits.

  • 1
    Is 'smart sufficient, or should I set it to 'error if I want to make it impossible to accidentally edit hidden text? – incandescentman Jul 11 '15 at 5:47
  • Smart should be good enough. If you do a 'C-h v' to get help on 'org-catch-invisible-edits' you can find the following explanation of what the ''smart' option means: '"Make point visible, and do insertion/deletion if it is adjacent to visible text and the change feels predictable. Never delete a previously invisible character or add in the middle or right after an invisible region. Basically, this allows insertion and backward-delete right before ellipses."' – Brian Z Apr 29 '18 at 17:32

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.