[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DONE] Re: [ISSUE] org-fold does not support auto-reveal for some extern
From: |
Christopher M. Miles |
Subject: |
[DONE] Re: [ISSUE] org-fold does not support auto-reveal for some external package commands |
Date: |
Tue, 03 May 2022 18:19:56 +0800 |
User-agent: |
mu4e 1.6.10; emacs 29.0.50 |
Ihor Radchenko <yantar92@gmail.com> writes:
> "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
Interesting, I tested and confirmed this works good. Thanks for demonstrating.
I will figure out
consult-org-heading command part.
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express.
Blog: https://stardiviner.github.io/
IRC(freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
signature.asc
Description: PGP signature