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

refactor: Use built-in with-silent-modifications #207

Closed

Conversation

josephmturner
Copy link
Contributor

The org-transclusion-with-inhibit-read-only' macro can be replaced with with-silent-modifications', which also brings a performance benefit by also setting buffer-undo-list' and inhibit-modification-hooks' to nil.

Potentially relevant to #106.

The `org-transclusion-with-inhibit-read-only' macro can be replaced
with `with-silent-modifications', which also brings a performance
benefit by also setting `buffer-undo-list' and
`inhibit-modification-hooks' to nil.

Potentially relevant to nobiot#106.
@yantar92
Copy link

yantar92 commented Dec 24, 2023 via email

@josephmturner
Copy link
Contributor Author

Thank you for the review @yantar92 !!!

@josephmturner josephmturner deleted the with-silent-modifications branch December 25, 2023 10:35
@yantar92
Copy link

yantar92 commented Dec 25, 2023 via email

@nobiot
Copy link
Owner

nobiot commented Dec 25, 2023

If you want to address #106, the problem is not with modification hooks,
but with loading org-mode in temporary buffers - loading takes time.
The common technique you can use to avoid this problem is having a
temporary Org mode buffer that you do not close (thus keeping Org mode
loaded) but erase, inserting new contents every time you need to.

@yantar92 , thank you for this advice. I have tried caching with hash table because Org-transclusion parses the same Org buffer multiple times. This only had inconsistent results for performance gain at the time I tried. I think I can revisit the performance issue with the method you mention.

@nobiot
Copy link
Owner

nobiot commented Dec 25, 2023

@josephmturner , thank you for the PR and trying to improve Org-transclusion. I will try to add why it is the way it is in the source comment next time I update...

@josephmturner
Copy link
Contributor Author

@nobiot Thank you! Please see #210 for the added explanation.

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

Successfully merging this pull request may close these issues.

None yet

3 participants