If I run certain functions like isearch-forward (with C-s) in an org-mode buffer, all content become temporarily visible. When I end the search, headings automagically collapse the way they were before I searched. Nice.

But if I run something like query-replace (with M-%), trees stay collapsed. The point essentially hidden inside them. I am asked to confirm a change that I can't see. That's not good at all!

Surely functions like query-replace should behave more like isearch-forward does. I swear I found a simple solution to this at some point. (A variable with a smart setting, I thought?) But I seem to have lost track of it. Please help me.

  • 2
    M-x report-emacs-bug, to suggest this as a feature enhancement. – Drew Nov 8 '15 at 3:56
  • I see you've done that. Great. – Drew Nov 8 '15 at 4:34
  • In the meantime I'll leave this open in case someone has a simple fix. Maybe some sort of hook using org-show-context? This is driving me nuts because I'm 99% sure I found a fix for this online somewhere and somehow lost track of it. – Brian Z Nov 8 '15 at 6:29
  • I went digging in my init and realized I already have this line: (setq org-catch-invisible-edits (quote smart)). Maybe this just stopped working because a recent upgrade in org-mode. (I'm running the version on ELPA.) – Brian Z Nov 8 '15 at 7:04
  • Maybe you want the value show instead of smart. – Andrew Swann Nov 8 '15 at 15:58

Please try in GNU Emacs 24.4 or 24.5 where it should work as you want.

  • Thanks. I wish the Ubuntu repo would update emacs, but I guess it might be time to try building it myself. – Brian Z Nov 9 '15 at 10:55

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.