emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patch suggestion] Mitigating the poor Emacs performance on huge org


From: Ihor Radchenko
Subject: Re: [patch suggestion] Mitigating the poor Emacs performance on huge org files: Do not use overlays for PROPERTY and LOGBOOK drawers
Date: Fri, 25 Sep 2020 10:16:08 +0800

> I understand from your answer to Bastien's query that this fix is
> specific to your branch; would it be hard to backport it to Org's maint
> branch?  Otherwise IIUC Org 9.4 will keep this regression, and users
> will have to wait until Org 9.5 for a fix.

The problem is that fix in my branch has nothing to do with main branch.
The bugs were inherently different even though looked same from user
point of view. If one wants to make the fix work on master, the whole
branch must be applied.

However, I can try to suggest a way to fix the issue on master. The way
isearch handles folded text in org is set from org-flag-region
(org-macs.el):

(overlay-put o
                   'isearch-open-invisible
                   (lambda (&rest _) (org-show-context 'isearch)))

It means that isearch calls org-show-context (org.el) to reveal hidden
text. Then, it calls org-show-set-visibility with argument defined in
org-show-context-detail (now, it is 'lineage). With current defaults,
the searched text is revealed using org-flag-heading, which reveals both
heading body and drawers.

The easiest way to write the fix would be changing org-flag-heading
directly, but there might be unforeseen consequences on other folding
commands.

Another way would be changing the way org-show-set-visibility handles
'lineage argument. Again, it may affect other things.

Finally, one can add an extra possible argument to
org-show-set-visibility and alter default value of
org-show-context-detail accordingly.

The last way will have least risk to break something else.

I guess, patches welcome ;)

> Bastien asked for the /gist/ as a patch against master, whereas your
> answer explained why you couldn't share the /fix/ as a patch against
> master.  If Bastien did mean the whole gist, here is the corresponding
> patch against master:

Well. The gist is a patch applying the whole feature/org-fold branch to
master. That's not yet something we can do. The plan is to apply the
org-fold feature in several steps, as discussed in earlier messages. So,
I thought that it would just create confusion if I share the gist as is.

Sorry if I was not clear.

Best,
Ihor


Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> Thanks for reporting! I accidentally reintroduced the bug because of
>> mistake when converting org-hide-drawers to new folding library.
>> (:facepalm:).
>>
>> Should be fixed in the gist now.
>
> Can confirm, thanks!
>
> I understand from your answer to Bastien's query that this fix is
> specific to your branch; would it be hard to backport it to Org's maint
> branch?  Otherwise IIUC Org 9.4 will keep this regression, and users
> will have to wait until Org 9.5 for a fix.
>
> Also, just in case there's been a misunderstanding:
>
> Bastien <bzg@gnu.org> writes:
>
>> Can you share this gist as a patch against Org's current master?
>
> Bastien asked for the /gist/ as a patch against master, whereas your
> answer explained why you couldn't share the /fix/ as a patch against
> master.  If Bastien did mean the whole gist, here is the corresponding
> patch against master:
>
> https://gist.githubusercontent.com/yantar92/6447754415457927293acda43a7fcaef/raw/7e43948e6c21220661534b79770bc1a6784b7893/featuredrawertextprop.patch
>
> Apologies if I'm the one misunderstanding, and thank you for all your
> efforts!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]