I'd like to keep snippets of Tidal code in an org-mode file, because org makes it easy to divide a file into a hierarchy, jump around that hierarchy, and hide irrelevant branches of it. The problem is that in org-mode you don't have the handy syntax highlighting and indentation of haskell-mode. So I'd like to be able to switch between those two modes while viewing the org file. But currently, each time I switch modes, the view that I had carefully curated gets obliterated -- either everything is revealed (when leaving org-mode), or everything but the top level is hidden (when re-entering it).
I just asked about this on Stack Exchange. If you know how to do it, please answer! If you'd like to know, please make some noise on the page!
I took a quick look at your SE post, and what you might want to consider is using an indirect buffer (try C-x 4 c) to 'clone' your org file. you can have one view in org-mode and the other in haskell-mode then either split frame for side-by-side, or flip between full frame buffers...
Thanks, Nik! I didn't know about indirect buffers. That would do exactly what I was asking for if there were a way to link the points in the two buffers so they always moved in tandem.
I have a feeling there is something in Melpa that links cursor movement between buffers. If I can remember what it's called I'll let you know. Might also be interesting to experiment with using multiple cursors {and/or bookmarks in the buffers) as part of the live coding cycle...
Evaluating the elisp code at the top (highlight it, without the "{- ... -}" braces, and run M-x eval-region) makes it possible to fold, hop around and restructure the headings using commands like (respectively) outline-cycle, outline-next-visible-heading and outline-move-subtree-down.
(I've radically renamed this thread -- now the title indicates my underlying purpose, rather than the initial approach I was taking, which I never got to work.)