lin Sun <sunl...@yahoo.com> writes: > Thanks for the comment. > If we switch to the `add-variable-watcher', it seems we'll load the > ob-LANG in the callback immediately. > The previous change can lazyly load the babel languages until the user > tries to evaluate the source block.
Is there any advantage doing the loading lazily? I can only see disadvantages: 1. `setopt' already triggers loading when variable is set. It is just `setq', often used in place of `setopt', that does not trigger loading/unloading. 2. Lazy loading like you proposed will have to be added in a number of places, not just when executing src block: `org-edit-special', `org-src-associate-babel-session', `org-edit-src-code', `pcomplete/org-mode/block-option/src', org-lint, `org-babel-tangle-single-block', `org-babel-exp-src-block', `org-babel-exp-results', and others. 3. We will also have to monitor newly added babel functions to take care about lazy loading. Not to mention third-party code. Admittedly, (2) can be solved by abstracting babel backend queries to API. (I have a WIP code doing exactly this). However, I still see no good reason to make `setq' different from what `setopt' does now. Most people treat them interchangeably and then get surprised by the differences. -- 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>