From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 WJXTETS4G2Pw2gAAbAwnHQ (envelope-from ) for ; Sat, 10 Sep 2022 00:03:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QGrGETS4G2NLvAAAauVa8A (envelope-from ) for ; Sat, 10 Sep 2022 00:03:32 +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 DE69C3E89A for ; Sat, 10 Sep 2022 00:03:29 +0200 (CEST) Received: from localhost ([::1]:48124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWm5v-00078L-Us for larch@yhetil.org; Fri, 09 Sep 2022 18:03:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43906) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWm5T-000788-Aw for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 18:02:59 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:36601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWm5R-0005F9-A4 for emacs-orgmode@gnu.org; Fri, 09 Sep 2022 18:02:58 -0400 Received: by mail-pl1-x630.google.com with SMTP id c2so3017260plo.3 for ; Fri, 09 Sep 2022 15:02:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date; bh=2CucFn/lAt4Lij/xkKIS3unRVF15bamA6y1sgoDxUpg=; b=hcZfakLggSy4576L97D4uQXRL+NOz7zEeMB8/Eghl9b5HK7bnYr/RUoLSrnyOqEPF2 vJ65MU4b+GddpFAPFC4IAd7exLciSvsaBdG7IJya56qQF6VzHEu8hbG9Y8TKPWmH111J XhfrEBt4XyF3DhBt0D3J51ab4r9cC4cLmFlmjzP1R7pg8B5yI9kd5shZsyt2oo9O+XYe t4YlKIEq2uCn74GNYi+GZbn16afVCwtiXhn1P1K5ejArOooSKx0iWFUkxYAQcSFdRS+9 yKcUnqiLAGxvqec2E51b2D8K0k9dHzLeYXzkdivFFdEaA1kHq6B3MtTRlt5tdwERpsnE O7cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date; bh=2CucFn/lAt4Lij/xkKIS3unRVF15bamA6y1sgoDxUpg=; b=oKh1AJ8CH+mYJU6z4+hj0cjR4pV5YbpCYcA6+ilal9Qfi0ElGtzP8J+kJ15xPsF9LO GY3GybXnAVYHOMq3vcjzcuSdd9ZM5l6iKUvEVlw+M6mxvwzpik/BLdmk8/PcRDrbOtw5 VhUU5Eo8B4Yc0IKOaC7ChUwgpw7V9c/Ir7HKNFrI5xUsZ/mIuCwtcLnSsNN/xzfKOqIo hotdajuvl/mPuirF3HpkuTkl/5kWF7FkVdgZ11OUz+Wfc+XVV9jBPBsqa+SkSl4b3LSy ovQDv5LsHc24+yNNQngm2earDfSJjLX6blqt8YE4FVeddU1cjFWbrZy7jXh2mMgDFfcL OClg== X-Gm-Message-State: ACgBeo1McAtDZy5pYCxwtHVc68qXl1Tn+9qSzLjXduLXLpWSCnP/nXG1 71U9CzV/0lI4MBXB8KsKA+GrkglpaIg= X-Google-Smtp-Source: AA6agR66s9zI8mefqY7I5G5ShbG7sUu/F9C/FnHqkqvrpUl6k7OHvk9UCNm+gBw8O/ozABgX1RMLlQ== X-Received: by 2002:a17:902:f68d:b0:174:471b:4794 with SMTP id l13-20020a170902f68d00b00174471b4794mr15561209plg.156.1662760975019; Fri, 09 Sep 2022 15:02:55 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-842a-7361-87c7-2662.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:842a:7361:87c7:2662]) by smtp.gmail.com with ESMTPSA id y15-20020a17090264cf00b00176a47e5840sm856505pli.298.2022.09.09.15.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 15:02:54 -0700 (PDT) References: <86fsh61a3u.fsf@gmail.com> <877d2ivxpa.fsf@localhost> <86bkru0xim.fsf@gmail.com> <87illzaj8t.fsf@localhost> <8635d3nhjf.fsf@gmail.com> <871qsk3i3k.fsf@localhost> User-agent: mu4e 1.9.0; emacs 29.0.50 From: Tim Cross To: Ihor Radchenko Cc: Org-mode Subject: Re: org-babel-load-languages usability issue Date: Sat, 10 Sep 2022 07:56:00 +1000 In-reply-to: <871qsk3i3k.fsf@localhost> Message-ID: <86zgf8jjee.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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=1662761011; 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=2CucFn/lAt4Lij/xkKIS3unRVF15bamA6y1sgoDxUpg=; b=NMTF0X8tdEfu7xQyZ1VZ2TkYzl+pi1hWqSGNTdm4OyAiYGGOK4DlEgCSIuqRw5w0JH5xxi D8MziFSt5xFfOGt+gQUn9S78dL2Ky7HPJKjwJbEegulCiQEMh5Qm6N2iAqKTHYebgJxQWe pYe8o4iqhmh3AIiEmgejNLpJrzvYhDxqK62r5DJe6LoJuB7iUB/khaH4d3CrwiuhCta1ZR m1V9FeIcm5Jk4AvnVQ6jP/+BQqPjhOQv42QUjeZ+MUNMBn6DhTFbN5DwxF/gVekqv5xj+V jO0AGzFqHSDNBfc6I473y9AdjZYLyJ7EU0mpHWAqJrEP1Kd70D0/NY+6VAUcBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662761011; a=rsa-sha256; cv=none; b=NCx1dINaeSr8OP8N1tPEdhLRgpa49h5iBa7OoBRP02k4MzbbaxYYSSgXGc5g2dSp+arYnD zsURLlrh8JgYmgSfnEiPcqAMr9MTuALtG6SeJbRp6sfq8RCzYsdA/lyh5DHBie8Pkw7xeD N0uj9VI269N6BXn2DEtzvqlk+9BK6kkllDWHXAuUraEyAUtKGQkIkNaS2W5jZ+kZk1b9g4 Dyen9t8nJCifPdjINylvZO7QRXPiYbNn5nm1gJ2gfhcV4DZbyCKH6Hmob19hSW1UV5F4Hk etJ/ZMFY54QVDSATJXDj/uZhUdA/rkmwG26do0pjf0DQKEZG/Zn3rOvaDPXYzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hcZfakLg; 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: -2.29 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=hcZfakLg; 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: DE69C3E89A X-Spam-Score: -2.29 X-Migadu-Scanner: scn1.migadu.com X-TUID: 33DivTvDizQt Ihor Radchenko writes: > 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 > Excellent. Thanks. >>>> 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. > Agreed. >> 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. OK, fair enough. The point regarding (lang . nil) being supposed to deny loding LANG is my main point. I would hope it is exactly the same as not listening LANG. Originally, my thought was it would be easier for the user from a usability perspective if they could just look at the value of this variable and immediately see not only the languages currently enabled, but also those languages which could be trivially enabled because they are bundled with Emacs - for example, 'shell', 'eshell' and possibly others which tend to have the runtime installed in most cases and where Emacs has a built in mode. At any rate, the changes made are a good start and I'm happy if things are left there for now.