From: Ihor Radchenko <yantar92@posteo.net>
To: lin Sun <sunlin7@yahoo.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
Timothy <tecosaur@gmail.com>, Bastien Guerry <bzg@gnu.org>
Subject: Re: [PATCH] before emit an error message, try to load the babel language
Date: Tue, 25 Apr 2023 08:12:57 +0000 [thread overview]
Message-ID: <87zg6ws7li.fsf@localhost> (raw)
In-Reply-To: <CABCREdpM3wxJEzNwsUg+xv4sfOg3hN25Oyzq0a_Qe9QcGuOmyQ@mail.gmail.com>
lin Sun <sunlin7@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>
next prev parent reply other threads:[~2023-04-25 8:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <388850760.3644614.1634354740816.ref@mail.yahoo.com>
2021-10-16 3:25 ` Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html Sun Lin
2021-10-18 1:39 ` Sun Lin
2021-10-18 5:07 ` Bastien Guerry
2021-10-20 12:02 ` Sun Lin
2021-11-18 5:42 ` Sun Lin
2021-11-18 7:38 ` Timothy
2021-11-18 7:47 ` Sun Lin
2021-11-30 1:41 ` Sun Lin
2021-11-30 4:18 ` Timothy
2021-11-30 6:05 ` Sun Lin
2022-06-07 5:48 ` lin Sun via General discussions about Org-mode.
2022-06-07 6:34 ` Dr. Arne Babenhauserheide
2022-06-07 14:49 ` Max Nikulin
2022-06-07 15:30 ` lin Sun
2022-06-08 1:45 ` Ihor Radchenko
2022-06-08 4:35 ` lin Sun
2023-04-22 7:21 ` [PATCH] before emit an error message, try to load the babel language lin Sun
2023-04-22 8:25 ` Ruijie Yu via General discussions about Org-mode.
2023-04-22 12:45 ` Ihor Radchenko
2023-04-23 6:19 ` lin Sun
2023-04-23 7:45 ` Ihor Radchenko
2023-04-25 2:50 ` lin Sun
2023-04-25 8:12 ` Ihor Radchenko [this message]
2023-04-25 14:30 ` Ruijie Yu via General discussions about Org-mode.
2023-04-25 14:48 ` Ihor Radchenko
2023-04-26 2:33 ` Ruijie Yu via General discussions about Org-mode.
2023-04-26 4:15 ` lin Sun
2023-04-26 7:00 ` Ihor Radchenko
2023-04-26 16:43 ` lin Sun
2023-04-26 16:59 ` Ihor Radchenko
2023-04-26 6:59 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg6ws7li.fsf@localhost \
--to=yantar92@posteo.net \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=sunlin7@yahoo.com \
--cc=tecosaur@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.