-
Notifications
You must be signed in to change notification settings - Fork 42
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
Conversation
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.
Joseph Turner ***@***.***> writes:
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.
Please, don't. Org mode's caching relies upon modification hooks to function.
…--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
|
Thank you for the review @yantar92 !!! |
Joseph Turner ***@***.***> writes:
Thank you for the review @yantar92 !!!
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.
For example, see
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-element.el#n594
…--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
|
@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. |
@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... |
The
org-transclusion-with-inhibit-read-only' macro can be replaced with
with-silent-modifications', which also brings a performance benefit by also settingbuffer-undo-list' and
inhibit-modification-hooks' to nil.Potentially relevant to #106.