From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0H1WHysjG2N36AAAbAwnHQ (envelope-from ) for ; Fri, 09 Sep 2022 13:27:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wBpgHysjG2NZFgEA9RJhRA (envelope-from ) for ; Fri, 09 Sep 2022 13:27:39 +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 0025C209C7 for ; Fri, 9 Sep 2022 13:27:38 +0200 (CEST) Received: from localhost ([::1]:44746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWcAb-0004zt-Og for larch@yhetil.org; Fri, 09 Sep 2022 07:27:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWc7Z-0002s6-Pf for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 07:24:30 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:34597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWc7X-0001JB-W5 for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 07:24:29 -0400 Received: by mail-pf1-x42e.google.com with SMTP id e68so1395028pfe.1 for ; Fri, 09 Sep 2022 04:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date; bh=Jgsh1hUlC+G/BZlGXWk1nrTwZznhJb9cbdrADf7bvI8=; b=P6dLswrS6S/451Z8XCMTSJAb9QJfICWaER1vzUDY8JKc2h5skeJqzYQ+OFd78tLOkZ fA06I6ZCCH/OLAqvMvmVz5UyZHrMRYHHpSYX3L7Lg5AFm+/BmXfzMsUnl7VA7CWAp5qd yN5DLGJx8Pk9Zz2M0REyI+YCdxLxSlUEKJxG1n0gI9zcCH6cBPPXXRo/WURHwk3nYG7v ViAxUUC8LAudxHoUefKjfjusmTNesqGq5qdHOsTFEaLoKh4aetaU/iv7ub1DHNMJm18W cPa+yXq8x18wLKWJINNSF9bj7eFUFLJ7eVygLn5BbC7zKp+fMKPFTxQ72U3MLqnun7mv eyYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date; bh=Jgsh1hUlC+G/BZlGXWk1nrTwZznhJb9cbdrADf7bvI8=; b=ww7fb0Zr9b7bLqE9vVNpBIuRxyzstl4acEP9tssqa8ZlIxde9WQXoTbqVIcg8x5EbC lngIYoNqkozWAEHa9eePZgjOiuBNgH0AJ9nDcNIdUfH0PV9txEpYHKhs1BOwBNRanaae WRY7qW7KlfA0zo7Fu6bpB+NpaB+yK0SU09e/EpJKfvkdCrsDHIBg13l84McCOak5tpyq NXyUTiGWlmzLv4Twi8DoSOf84DNC3lUIwCsfANB5RzjmXkLjrF5uiXPo5RTbcT9uTLU9 9zoRnfjnrLZ7KLIoDMNgFAT51Dz2Y8wZhC3rMz56fol1KDEP/N2yLVvyJD6yHfobCnur c2uw== X-Gm-Message-State: ACgBeo1pIVzFOPROGqgQO2h8zYwa/GsVZ7118zcwSdjoqQPnsbaB4wc/ zOhyTwk3oIaQu5pBwz6xy72/dwngMlE= X-Google-Smtp-Source: AA6agR78iAXpwmNnrBzUbabMDTR8FUHl27ubqEF9Ec9DbJzll9BaC4IkgW8I3wVLBe6ZFA6slIv6CQ== X-Received: by 2002:a05:6a00:816:b0:52f:43f9:b644 with SMTP id m22-20020a056a00081600b0052f43f9b644mr13837147pfk.57.1662722666670; Fri, 09 Sep 2022 04:24:26 -0700 (PDT) Received: from localhost ([2409:8a70:2b2:5800:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id l5-20020a170902d34500b0017689960d10sm244650plk.156.2022.09.09.04.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 04:24:26 -0700 (PDT) From: Ihor Radchenko To: Tim Cross Cc: Org-mode Subject: Re: org-babel-load-languages usability issue In-Reply-To: <8635d3nhjf.fsf@gmail.com> References: <86fsh61a3u.fsf@gmail.com> <877d2ivxpa.fsf@localhost> <86bkru0xim.fsf@gmail.com> <87illzaj8t.fsf@localhost> <8635d3nhjf.fsf@gmail.com> Date: Fri, 09 Sep 2022 19:25:19 +0800 Message-ID: <871qsk3i3k.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=yantar92@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662722859; 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=Jgsh1hUlC+G/BZlGXWk1nrTwZznhJb9cbdrADf7bvI8=; b=ixSBwlOJpKvzmVSspwLVImlsvZjZAzHYuF1v+aaXF+VEFSGqZ6PuOm7gu+jvaRVaG0V4HB aDp6bbCdX3GSZhXw4SpzcvQ7q58yTzPUEWdZig/f6s9tuRTVsbwpuE2/kmwBL82kesjz39 s/dzvjwaEiUpIjlcTtSkllbSqQNvR6q9s/XEEVBwawkpR33bD4NRT1wRdBuy1MPvPBMgjm iscaVeg7bWQvM/gaoKJd/uWNHUALLSv+NFS9AfPo34clmAJnBEX4TGn4b+w92qfLELt0yz aIkrdu1DXfkG4/cEkKTDIVm2wcJVrGEcvBMKkr3B0CT0iGqgOoZYu0hI+hZN0A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662722859; a=rsa-sha256; cv=none; b=UTO+rfalVjTX2Wzl4YchqB8sheFt/zEq+1yuIQLFTMgbkcCsLi10yZNgXCELVg//JgHdWa /uFcM0ok/Oj29Hzc2Id7zg8GhvustAeAt+DajXdxQZycsA1JH4XDvO/rsKJkBGTgMxEq6g 0mcPvcAVeX5ZLwGk8cEFzpWF4mRimskdtm+NXSy/cpIKkXVpjFg3wmjLe/WRPv3Dt1y4Eu twQo9UUUbV82Z3csPA6ZI0wQ6Dq8eWztb+p2UNNsOjfbmoKOb3h+rPWcA3vNfRf5RgElLI 7E7kQagUzJJkxrRlgvacNJq/7+P8fo+FOVJuePrqPdAWjUUivKAawgzqJW7HBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P6dLswrS; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -1.80 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=P6dLswrS; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 0025C209C7 X-Spam-Score: -1.80 X-Migadu-Scanner: scn1.migadu.com X-TUID: rn6mRHQ75DKk Tim Cross writes: >> We have [[info:org#Languages]] linking to >> https://orgmode.org/worg/org-contrib/babel/languages/index.html >> I guess we can simply add the manual link to the docstring. Would it be >> sufficient? >> > > Yes, I think so. That was what I was thinking would be reasonable and > would avoid maintenance issues for the doc string when languages are > added/removed. Done. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7c20552ed636d6c058d6be649e19d3d5edc0f62a >>> Would it load them if the default values for all the languages which >>> have bundleed modes in Emacs were set to nil rather than t? >> >> I am not sure if it is a good idea. >> I am now looking at the usage of org-babel-load-languages in the code, >> and I am seeing `org-lint-wrong-header-argument', >> `org-babel-demarcate-block' ignoring difference between (lang . nil) and >> (lang .t). > > OK, so if I understand you correctly, not all of org code honours the > enabled/disabled setting so adding all bundled languages, but setting > them to nil, would result in unexpected or additional processing for > those languages despite them being disabled? Yes, though I am not 100% sure if the impact is significant enough for us to care. > If that is the case, you right and adding them would be > problematic. However, I would also argue this is probably a > bug. Essentially, it means that the value associated with the language > symbol key is sometimes interpreted and sometimes ignored. I think this > is an inconsistency which can potentially cause confusion and could > contribute to subtle bugs. Agree. > One thing I do wonder though wrt the two examples you cited. Could this > be deliberate/intentional for these functions? > > I wondering about the scenario where you want to include blocks for a > certain language, but you do not need to evaluate them, so no need for > babel support. Might this be a case where you would set the language to > nil, but be fine with lint and other checks verifying the block > structure? Provided this isn't also resulting in loading of language > specific babel code, it may not be an issue? I do not think that your example is a valid use-case. (lang . nil), when set during startup, means that (require 'ob-lang) has never been executed (or, at least, we cannot guarantee it). When (lang . nil) is changed from (lang . t) at some point, (require 'ob-lang) is executed, but org-babel-do-load-languages explicitly unloads the babel function that executes the LANG blocks. In general, we cannot assume that any of the ob-lang functions are loaded when there is (lang . nil). No LANG-specific info is available. Also, (lang . nil) is supposed to deny loading LANG. It should be no different compared to not listing LANG at all. -- Ihor Radchenko, 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