"Christopher M. Miles" <numbch...@gmail.com> writes: > I'm using package "consult" which has command "consult-org-heading" to search > org headlines. It will > auto jump to the selected headline and expand the jumped headline. After > using org-fold, it does not > auto jump to the headline now. > > The previous discussion here as reference > https://github.com/minad/consult/issues/563. > > As @minad mentioned we need to wait for org-fold provide an official API to > reveal content. Hope > this can be added to org-fold plan.
I reviewed the available API and realized that Org actually does provide sufficient functionality to reveal search matches temporarily. (there was a bug in that area, but I already fixed it) The basic idea is demonstrated in a simple function below: (defun test (pos) (interactive "nEnter point to be revealed: ") (read-char "Revealing point temporarily. Press any key...") (save-excursion (org-fold-save-outline-visibility nil (goto-char pos) (org-fold-show-set-visibility 'local) (read-char "About to restore the previous fold state. Press any key..."))) (read-char "Now, reveal the point permanently. Press any key...") (goto-char pos) (org-fold-show-set-visibility 'local)) Hope it helps. Best, Ihor