From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp10.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id +HIWJB+LR2RM5wAASxT56A
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 25 Apr 2023 10:11:11 +0200
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp10.migadu.com with LMTPS
	id iDY3Ix+LR2Q5QQEAG6o9tA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Tue, 25 Apr 2023 10:11:11 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 10DE1166F8
	for <larch@yhetil.org>; Tue, 25 Apr 2023 10:11:11 +0200 (CEST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1prDko-00053I-M0; Tue, 25 Apr 2023 04:10:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1prDkl-000530-J5
 for emacs-orgmode@gnu.org; Tue, 25 Apr 2023 04:10:24 -0400
Received: from mout01.posteo.de ([185.67.36.65])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@posteo.net>)
 id 1prDkh-0002MA-Or
 for emacs-orgmode@gnu.org; Tue, 25 Apr 2023 04:10:23 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 9C7032402A3
 for <emacs-orgmode@gnu.org>; Tue, 25 Apr 2023 10:10:15 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1682410215; bh=Idm6JkjQ1j4osx9/xqwDM4ZGwLlnBTI4voXVneG2UMs=;
 h=From:To:Cc:Subject:Date:From;
 b=rs/qZJoaQdjtR+QP9xGQqB0y+CPFG6I41lPaiTsxbeP2Hz8ENHXPCDKQuAd8LNgBY
 2q5yvod27AHGw7rj2ulRzGxzQxb46RcdGf3Itd32Lzo0mBO8sx5cH87bbI6xiHPi2x
 wvfBLBb4m+eL9YiO35nowx/FB6AzhtbfpRgBuKqmQ2kzR7syzDiM6TciBYsWYY3ChA
 +wy7ihSLYHtpB2JvkZ3xau7w7sJLghQCm+s5gjvPlkEE44ePTxV/5IVeUzclNJUINM
 r1e+txNReye1E/vRg/MgwcRNFXRsXfW0IvigbzpJ6SlXiHSm56CDA+KWtEWzIsJ3BP
 qBD3axGLnC25Q==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Q5F6b0PH3z6tvc;
 Tue, 25 Apr 2023 10:10:15 +0200 (CEST)
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
In-Reply-To: <CABCREdpM3wxJEzNwsUg+xv4sfOg3hN25Oyzq0a_Qe9QcGuOmyQ@mail.gmail.com>
References: <388850760.3644614.1634354740816.ref@mail.yahoo.com>
 <388850760.3644614.1634354740816@mail.yahoo.com>
 <87k0h5gbad.fsf@gmail.com>
 <1410400175.3014347.1637221629433@mail.yahoo.com>
 <147485378.6546620.1638236479358@mail.yahoo.com>
 <87czmiqnmh.fsf@gmail.com>
 <115088871.6596146.1638252307206@mail.yahoo.com>
 <CABCREdpPK0kARbigXDmuxQ+Hjgc5+QeErSdjvCaSFyV1iU0Zxw@mail.gmail.com>
 <877d5sszc2.fsf@localhost>
 <CABCREdrenxEZXHzx8doYY__U+SMAdUb+RtfLrBYYKfV1WA6wiw@mail.gmail.com>
 <CABCREdr+XevsNnc1YsiHubXS=QO28-SHEhRLFnwxntKo-XOZcw@mail.gmail.com>
 <87354suluu.fsf@localhost>
 <CABCREdoxPNi4PBqZNqCv4cXP6BayKzhJgJqB94=sWPguoMjPMw@mail.gmail.com>
 <87cz3vhwj7.fsf@localhost>
 <CABCREdpM3wxJEzNwsUg+xv4sfOg3hN25Oyzq0a_Qe9QcGuOmyQ@mail.gmail.com>
Date: Tue, 25 Apr 2023 08:12:57 +0000
Message-ID: <87zg6ws7li.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682410271; a=rsa-sha256; cv=none;
	b=rCM1xrz8hr8ytgfQiOYN5PoCpC3AHnKWPDfStLy8unOM4VU0wulWiW+FFVZrYYwZF9+c08
	fuKnPPzY9HnPsS5TWn6/pjN2jK9jQn8zmpk9/APHJLIeMOllJWH/DXCy19pYB43gN2VtQp
	HPMFa1kju0MhzS73lmk164GpA2ACHIl05YjabGprqZ+gKJibMFRmYtQGCu1uvcoLmt1r75
	MtDcQqZpRa7Wg1Klo8NUbTqrnLD/lKhem9BMVvIb3QvmGt3sKNH23Eej/F83rV/8y9whSL
	0k5jhJEY2XUJZPhKnHhzmoslHCaduzRcInKq0RdXc3hTnH408c6n8+yUwJHJew==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b="rs/qZJoa";
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1682410271;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=B9+DgqNl9tdUDI6xmU7dLkT66tsx3hy0/H2T7huJJQg=;
	b=GMlcL0EwCuCyAQj1XS4Wge9Bz/7RI13ad9AhBLlV/BdUVF7Namv2KgFfoTUD/AOuLZpBOa
	aRnOrkwTWNFv0FfdFESLOiSMRjMkSsJJBe7CQIJrgy5aDKe3QyaHk/EiBBqFahlqjmM+f+
	Sms5w1DI5zUmO+D36iFIWUFv+TJlojhLPuHdharVKSoMcFZxU8Fo6q3tgQn+P3R9TQodvg
	Lbpds3kPxARKILVBW9ZwRP7/CnJkQG8Y2FkrWjlEhkwXc4Pkjdrz69/NHxUUkdtFrs67fF
	stA666R2NDQFiqFVIvIhw8lBlRgtls/1uQ5vXjz7IFR9zlrI/qzqvMhEPrg4XQ==
X-Migadu-Spam-Score: -4.70
X-Spam-Score: -4.70
X-Migadu-Queue-Id: 10DE1166F8
X-Migadu-Scanner: scn0.migadu.com
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=posteo.net header.s=2017 header.b="rs/qZJoa";
	dmarc=pass (policy=none) header.from=posteo.net;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"
X-TUID: 2eTcBtSDhE/5

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>