[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ISSUE] org-fold does not support auto-reveal for some external pack
From: |
Ihor Radchenko |
Subject: |
Re: [ISSUE] org-fold does not support auto-reveal for some external package commands |
Date: |
Tue, 03 May 2022 14:33:08 +0800 |
"Christopher M. Miles" <numbchild@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