Closed josephmturner closed 6 months ago
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 settingbuffer-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
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.
@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...
@nobiot Thank you! Please see #210 for the added explanation.
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.