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.

1 Answer 1


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? Jul 11, 2015 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, 2018 at 17:32
  • I found the manual entry first, but the problem is it shows the variable to use is org-fold-catch-invisible-edits, which does not exist in version 9.5.2. So I had to come here for the right answer.
    – Jim
    Jan 7, 2023 at 14:56

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.