I found this nifty little function for Org-mode:
;;; Move to next heading with dedicated buffer preview
(defun ded/org-show-next-heading-tidily ()
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (show-children))
(outline-next-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-show-entry)
(show-children)))
It moves from headline to headline, and shows its direct content and children.
I liked the idea, but would rather it would show in a dedicated buffer, using (org-tree-to-indirect-buffer).
I tried to do it like so:
(defun ded/org-show-next-heading-test ()
"Show next entry, keeping other entries closed."
(if (save-excursion (end-of-line) (outline-invisible-p))
(progn (org-show-entry) (org-tree-to-indirect-buffer))
(outline-next-heading)
(unless (and (bolp) (org-on-heading-p))
(org-up-heading-safe)
(hide-subtree)
(error "Boundary reached"))
(org-overview)
(org-reveal t)
(org-tree-to-indirect-buffer)
(show-children)))
But then I have to double press the key – once it shows the entry in a dedicated buffer and secondly it still shows the entry.
I tried to remove the progn function, but then it didn’t work entirely.
I’m not a lisp programmer, and I tried to play with it for an hour or so but to no avail, so I would love someone with some experience to help me sort this thing 🙂
Much obliged.
I ended up making my own, simple functions to navigate more easily: