Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consult-org-heading can feel like wading through molasses #708

Closed
tecosaur opened this issue Jan 5, 2023 · 4 comments
Closed

consult-org-heading can feel like wading through molasses #708

tecosaur opened this issue Jan 5, 2023 · 4 comments

Comments

@tecosaur
Copy link

tecosaur commented Jan 5, 2023

Heyo,

I'm a fan of consult-org-heading as a wonderfully effective way to jump around. Unfortunately, I find it nigh-unusable on my config. After attempting consult-org-heading twice using ELP, I recorded 15 invocations of org-fold-core-get-regions which cause org-fold-core-next-folding-state-change to be called 20,000 times — which takes 18 seconds.

In #563 the idea of a transactional API for org-fold was raised

Yes, as we discussed, such a transactional API would be nice to have but
is probably not necessary for now. If performance issues are observed in
the future, I will revisit this.

I imagine this might count as a motivating example for a transactional API.

In any case, it would be nice to be able to reasonably use consult-org-heading on my config again.

cc: @yantar92

@minad
Copy link
Owner

minad commented Jan 5, 2023

Hi TEC,

thanks for the report. Did the situation get worse due to the org-fold API or was it just as bad before (9.5 vs 9.6)?

@minad
Copy link
Owner

minad commented Jan 5, 2023

Anyway, I don't think we can do anything from the side of Consult - in other words it is not a Consult issue. Consult is designed to work with a transactional API - therefore I made this proposal in the discussion with Ihor. As soon as Org provides such an API, we can use it here and profit from the performance improvements. It is unlikely that I will find time to work myself on a patch for Org. I just took on the new responsibility of maintaining the Compat library. Btw. Compat could be interesting for Org itself. For your use case, I recommend for now to disable automatic preview for consult-org-heading or to configure a delay via consult-customize.

@minad minad closed this as completed Jan 5, 2023
@oantolin
Copy link
Contributor

oantolin commented Jan 5, 2023

I just took on the new responsibility of maintaining the Compat library

You're exactly the person I thought (and wished) might do that! Thank you.

@minad
Copy link
Owner

minad commented Jan 6, 2023

You're exactly the person I thought (and wished) might do that! Thank you.

Thanks, that's good to hear. And I just managed to ensure that Compat compiles down to exactly nothing on Emacs 29. A lot of work for nothing.

minad added a commit that referenced this issue Jan 16, 2023
This may introduce problems if the buffer changes in the meantime but
it should help with slow preview in large Org buffers. See #708 and
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants