From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MPTgJzbORGSEXAAASxT56A (envelope-from ) for ; Sun, 23 Apr 2023 08:20:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id QM7YJzbORGQnBQAA9RJhRA (envelope-from ) for ; Sun, 23 Apr 2023 08:20:38 +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 46F53353AA for ; Sun, 23 Apr 2023 08:20:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqT4g-0000lW-N0; Sun, 23 Apr 2023 02:19:50 -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 ) id 1pqT4e-0000kg-Pz for emacs-orgmode@gnu.org; Sun, 23 Apr 2023 02:19:48 -0400 Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqT4c-0005nX-M3 for emacs-orgmode@gnu.org; Sun, 23 Apr 2023 02:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1682230783; bh=LdRttpnP57/RYzKkORmJh4Vjq0W5/858VRTC3u8ywOo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From:Subject:Reply-To; b=Px/kGjlNXwghpGMBFTV1z63mgEQxUjgoRaA06NNOTLoP57w8ZDQA1B1W4n/ii6wuch3gLAF3L95IMNnZXxaAe2W9gKZiBGIsFdO5E7C61CMeKaN1myi57RC7qOM/OzAfwCDc/CTwu5kgF7RoC8twki0bWKej8sBYAnOJwQ6fb/J2Mk50ERxEvR+HTp6XCuUcZngcVEyp5e4P64KlyCgBXCjeoYDmbcOZpeo2obEYp+M+zX6oFUDKOe6Fn8A7PxlS6ci2UhP7pm9HYRW2B1qJKkIb/kvwYQT6dL+E6d2NvgSXZRL1ru+7Gldga73pa6s6YNMWdkDnDtrrY/a15q04nQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1682230783; bh=rCo2HS/1yDL9xOWthNzxxtmEY/CiXpBfEghOiQ7l9ks=; h=X-Sonic-MF:From:Date:Subject:To:From:Subject; b=soSfJmJ+RFr6fm6VuKIuswznKx2aPigEDWkeyqHpz4wTfvpZau9vwMb5RJMhxVgUTFlmWQ10i4hUIptpFjfUYm9bA8PW5DrBMi5vPVNW7kaMnzQeVLGBLxShf51GzHG4n7UP23WOMnsG3iDb2Zy+taJ4Dryf91rWEkp5PLQbpzn/znt2n2oxp058bOYZX9SAio4O6+AtwH3/wNeVcqjMHy0oozw685Q/zrCcLC872k7Mh2rEaertWdwYSuFZ1ckwALYVI9/Kt5Nt9nj8zEgrgv815qbl6W+sBzMktCod7gFCAYcD1nkLF2z+xDUyB7ORjP0GIbGEUCoF2tse8iApTA== X-YMail-OSG: mMuu8GoVM1kjCk77JJqZ7_zvGSOnG1uiaIZPViy_pIR5PD6C_eVBW0mPu9slxXh 5PVpHhRsI2XyWWcarad164DqM0uvxi247JGug3T_e0pSZ6KEKEmQWtpc016se5xOByilCysQQGBs VavSic1k3QGw6k7FfiNYzuztRCn3KTeTFmKl2uwKhZ8WjxeNKQxPi7gP6RITEcCm6WbC84nQiymd cYCdXcH7iQUnyvwQqs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ID: e73a4101-fa55-417f-9e4c-ec8f322907d0 Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Sun, 23 Apr 2023 06:19:43 +0000 Received: by hermes--production-ir2-74cd8fc864-db5p9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1b4213a2c7aedfd1f2c5575e0c77963c; Sun, 23 Apr 2023 06:19:40 +0000 (UTC) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-504fce3d7fbso4769280a12.2; Sat, 22 Apr 2023 23:19:40 -0700 (PDT) X-Gm-Message-State: AAQBX9dEUycp/w0ddzJBNu2srGrbRR2g0choXbP419tK0zEDEcjNEjOV ImvGwomt60Sd8qbGxWRVdy8ziHcdM43idTiySEQ= X-Google-Smtp-Source: AKy350ZiABOcAIR2JqHzvcfVYBe4p4PF7LMGySAaVvIp6DbsbusyG3ld4N+HInmNsQz8MDMlO2AJDLQCaMVY1ph3DiQ= X-Received: by 2002:aa7:c316:0:b0:506:c1a6:2771 with SMTP id l22-20020aa7c316000000b00506c1a62771mr9258624edq.39.1682230778973; Sat, 22 Apr 2023 23:19:38 -0700 (PDT) MIME-Version: 1.0 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> <877d5sszc2.fsf@localhost> <87354suluu.fsf@localhost> In-Reply-To: <87354suluu.fsf@localhost> From: lin Sun Date: Sun, 23 Apr 2023 06:19:27 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] before emit an error message, try to load the babel language To: Ihor Radchenko Cc: "emacs-orgmode@gnu.org" , Timothy , Bastien Guerry Content-Type: multipart/mixed; boundary="00000000000002eb4805f9fae097" X-Mailer: WebService/1.1.21365 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.31; envelope-from=sunlin7@yahoo.com; helo=sonic307-56.consmr.mail.ne1.yahoo.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682230838; a=rsa-sha256; cv=none; b=Vk0FDtYE4CoSw0LHmPQl8uUKUKQ5hw90qI3s/gdPRpkCuUgnXm5yeFbuY16i7DKeTBj12s E13GZpc8FKauAnv/xiVnoCUCFO5iy4GAaqEldQfwyvJs0WWacpgegDDwtzinyxgktm0+9Y +ZYEbtr1Xrh0+gLgJs8ZAqAUTrzXK8aFkeIVxsLmLnmnBSZtlPqKU4G6ncqLyzcSa/cv+u u5SA11TurRLJoLsjkXeRNpnsWSzrHNPER+dch5K32XHD5J9K/FLJjOnSGaGHaIbzADAb8s 6rVRdaADU9eK4xstthbebEKmket8DG54Nf0HuFEiF+T0StBU0KP9XvSYrS4UAw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=yahoo.com header.s=s2048 header.b="Px/kGjlN"; dmarc=pass (policy=reject) header.from=yahoo.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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682230838; 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=LdRttpnP57/RYzKkORmJh4Vjq0W5/858VRTC3u8ywOo=; b=AQR24RDuqI+GHwHs8LJQvJbCFkckFR92HZcFHTAwjz+sgl1Lb4GkKK/0k7veRG0M4a9+zx ltYuXcohnU9koqfE2waghI2zFdrHMUpbZincnlDvF/osF9DF/B1+0zOOjgsgDeOnYnkzJM QsQ/4+U46Dz8ZRjZouNaEdRsAQQKZZWrDoLRazQBOUc4Td58gKbRaQ0hYEo0Aczlzc9bNE C4ABsT2jReGM89FiQwJo1/QryUzMMn4VN6gzGAn0PailO+KAereg7N7Dz4q2YliJsufoV9 3tB2mcKL2sQVpOPoNslDUZYAQXNuXf6FdXH75y7P3yi0nz3WpGwX8tOi6jgGjQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=yahoo.com header.s=s2048 header.b="Px/kGjlN"; dmarc=pass (policy=reject) header.from=yahoo.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: -3.84 X-Spam-Score: -3.84 X-Migadu-Queue-Id: 46F53353AA X-TUID: p1pukJbYbgQU --00000000000002eb4805f9fae097 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 22, 2023 at 12:42=E2=80=AFPM Ihor Radchenko wrote: > the cleanest way will be using `add-variable-watcher'. Hi Ihor, The "add-variable-watcher" may not be able to deal with the local/global variable `org-babel-load-languages' correctly. On Sat, Apr 22, 2023 at 8:33=E2=80=AFAM Ruijie Yu wrote: > Instead of that, I think you should have some sort of conditional in the > `unless' condition. Something like: > --8<---------------cut here---------------start------------->8--- > (unless (or (fboundp cmd) > (ignore (and (alist-get lang org-babel-load-languages) > (require (intern (concat "ob-" lang))))) > (fboundp cmd)) > (error "... %s" lang)) > --8<---------------cut here---------------end--------------->8--- The logic in the patch will follow the function `org-babel-do-load-languages' to load the ob-LANG without capturing the error. I changed the patch to follow your comments. Please review the new patch I attached. Thanks. --00000000000002eb4805f9fae097 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-lisp-ob-core.el-load-lang-in-org-babel-execute-src-b.patch" Content-Disposition: attachment; filename="0001-lisp-ob-core.el-load-lang-in-org-babel-execute-src-b.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_lgt0rhu90 RnJvbSBhY2M3MmY5ZjQyMTIwZDA3Y2M3MjhlZWViYjlkZDk3NmI0NTY4YzFmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaW4gU3VuIDxzdW5saW43QGhvdG1haWwuY29tPgpEYXRlOiBT YXQsIDIyIEFwciAyMDIzIDAwOjAwOjM5ICswMDAwClN1YmplY3Q6IFtQQVRDSF0gKmxpc3Avb2It Y29yZS5lbDogbG9hZCBsYW5nIGluIChvcmctYmFiZWwtZXhlY3V0ZS1zcmMtYmxvY2spCgotLS0K IGxpc3Avb2ItY29yZS5lbCB8IDggKysrKystLS0KIDEgZmlsZSBjaGFuZ2VkLCA1IGluc2VydGlv bnMoKyksIDMgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9vYi1jb3JlLmVsIGIvbGlz cC9vYi1jb3JlLmVsCmluZGV4IDQ3MTg4N2EzYS4uMGZjNGN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