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 gCv+LWGr+2OZZQEAbAwnHQ (envelope-from ) for ; Sun, 26 Feb 2023 19:56:33 +0100 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 4CYRLmGr+2OrfwEAauVa8A (envelope-from ) for ; Sun, 26 Feb 2023 19:56:33 +0100 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 8E5101E0B1 for ; Sun, 26 Feb 2023 19:56:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWMBW-0007SC-4B; Sun, 26 Feb 2023 13:55:46 -0500 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 1pWMBM-0007Rg-4b for emacs-orgmode@gnu.org; Sun, 26 Feb 2023 13:55:36 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWMBK-0007WE-Jk for emacs-orgmode@gnu.org; Sun, 26 Feb 2023 13:55:35 -0500 Received: by mail-wr1-x42b.google.com with SMTP id t15so4081878wrz.7 for ; Sun, 26 Feb 2023 10:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=qDoxs7jUGrqu10rtvCim52Ogd2mHicp7Ng4ymU4ohbI=; b=N1Od9GrQnxMPatiWN0+MR6W1ZwekqbuvUUW2urzJjUl1d7ph6IDfkLkasx1CqLqGsJ LbL+ts7/2WGXeGaVWYw/znwBL2KRcNyNubADdVvJIjbIGmVhV8wIVvjbDhCpcxukXaP1 PEWUV9Jv+21jpZFIVr2lu5aHAh3inQO/YqJn7Nja13hoD5vDq8MfnCcJ1hu/uEd7z5Kt iirytmCnMKxfHxWUH8Vvg7pQD3PjysDHbgxwU63Z+/gf30IapUFz4xPeEmi+Tuz9Zasg hkEFz/2wRNsDQAYL8vet7VrCWnJca2ZMWcAzxgA4jcUexxsvUdglBry6Ngm77VV/TQiz 9TEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=qDoxs7jUGrqu10rtvCim52Ogd2mHicp7Ng4ymU4ohbI=; b=Wpimirwne+1MZteEb0i0ApXRgKxAyzB8zHSykE6ZjSsrQCamy7/tU70++IY5I6zUiL 5p+RSJIiuz6QR2M5vZbnhLrXrep6SVicBUy1+JOqjW2HGrPpszR9N3yGOcy3vRYc8sQp 5UoEgU6x5imkhzoEsvn+xupI2Y52Yy/zjkQ1Cgxw6/aohSdwiIolJfwehOgERUmdAwjy GQ7llIOzqnBa5+kcc1pus6JuDoNwMsdvbvTkvEYP8w9QxmvBzRFbiTOivNgnpiMa3umC rd0XcMOEWggjOU4vq6/kWXglhjZaLPMx85koDujaUOJqx3mPcdPfMfshBIZePJuWDdv2 R4ZA== X-Gm-Message-State: AO0yUKVLpXmuHKCLFDYJqXBldPnz1jg5Rr/c2jx+4OgXS7noHd7IfrU8 SbOhRK+LigrJnjcQxThqHUnIjffAZGk= X-Google-Smtp-Source: AK7set+k4iOJ2cfNNOg8cHxIppNu3Z00YILN0l5XpgZ3WE75U2miTSa/nKBovYzTa3t+RDUKtfUz7g== X-Received: by 2002:adf:f1c1:0:b0:2c5:598c:14b0 with SMTP id z1-20020adff1c1000000b002c5598c14b0mr18345272wro.20.1677437730570; Sun, 26 Feb 2023 10:55:30 -0800 (PST) Received: from gazelle.gmail.com (p54accbbc.dip0.t-ipconnect.de. [84.172.203.188]) by smtp.gmail.com with ESMTPSA id h8-20020adff188000000b002c54241b4fesm4989981wro.80.2023.02.26.10.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 10:55:29 -0800 (PST) References: <87pmajxef5.fsf@gmail.com> <875ybwe7qs.fsf@localhost> User-agent: mu4e 1.8.13; emacs 28.2 From: =?utf-8?Q?Th=C3=A9o?= Maxime Tyburn To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Multiple noweb-ref Date: Sun, 26 Feb 2023 19:51:18 +0100 In-reply-to: <875ybwe7qs.fsf@localhost> Message-ID: <87356sl0in.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=theo.tyburn@gmail.com; helo=mail-wr1-x42b.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 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=N1Od9GrQ; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677437793; a=rsa-sha256; cv=none; b=BohH1w2uPgWwIwXwL/DWpWggg8zRVBlY/J5mOdSOjzf3oqj+Ysgqairk7rm58ylYVcsAEz dI0fHika04R7oKzP1JnPErmunLNJ1RKA2gOeWS6JtTPGZodtOy4wf0SUBqQtQ3FlmpsrYr rIkGUThJga+MxSuQXzkdcDWzKGlmkfg/1Qxi8bM9lEy4tYWfcJ9Nu7VUz1iEX8XIFwaxHy 7Gt32hN7OOftqmMb/rMhblj2qXWqX6wrDKIpdvKECHs+PsH0eYlMNRhl0QEXLJ9N/U+Y6z nWMJskXMxcf8k76dWXTekag4RrCHEyQVg99cr1PFD4OnLcb1faZnRGcYK+kdDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677437793; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qDoxs7jUGrqu10rtvCim52Ogd2mHicp7Ng4ymU4ohbI=; b=iJNA39ReD18kCW5lKy93Q+xwwzmKIYIISR2xJipCYNzNxrZKdJfUjrAElcv/qF7nbuMtjn P7IXBTJz4Hb24v8VDjG60Co5H/Lzqc8osAQJh14pkhs+BggS19U7sfA+fl5MYOEy5IvtI1 Vr24Yi7GJljxYnjm7O+pkS+EwThtVt+nLiirfk5X8P70nOQZEURKr+AmJU53EN9JpcKSQ+ tGA+hWPylk+w4G2tpsDgqrrUct/0dcbaEHmWlYp/Ba7yHcyor2Ud4NrPSL1Hv/pMLbGPsA nGQRqzsWp11FyVaRGly3im9G197is4Io8Io1A5BRKqE8sdGy7abj7ndF2w+65g== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=N1Od9GrQ; 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"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.91 X-Spam-Score: -4.91 X-Migadu-Queue-Id: 8E5101E0B1 X-TUID: NdPrTzw0BFZw Hi Ihor, >> Anyway I tried to hack my way trough it. It seems there are two things >> to do : >> 1) Enable noweb-ref to contain multiple references. >> 2) Accumulate references when using header-args+ or use tags to set the >> value of noweb-ref >> >> I came up with a quick patch for 1): >> modified lisp/ob-core.el >> @@ -2910,8 +2910,11 @@ block but are passed literally to the \"example-b= lock\"." >> (if (org-in-commented-heading-p) >> (org-forward-heading-same-level nil t) >> (let* ((info (org-babel-get-src-block-info t)) >> - (ref (cdr (assq :noweb-ref (nth 2 info))))) >> - (push info (gethash ref cache)))))) >> + (refs (cdr (assq :noweb-ref (nth 2 info))))) >> + (if refs >> + (dolist (ref (s-split "+" refs)) >> + (push info (gethash ref cache))) >> + (push info (gethash refs cache))))))) > > + is a bit awkward. > Space would be more logical as separator. > Though I am wondering if people are using noweb reference names with > spaces in the wild. Might be. So maybe we could use another non-alphabetical character? What about "|" ? >> For 2) I didn't check in detail how one could achieve this. I have the >> impression it would be easier to use tags. One could define a >> new variable `org-babel-set-noweb-refs-from-tags` that would be used in >> `org-babel-get-src-block-info` to generate the value of noweb-ref we >> would like to have depending on the tags of the headline of the >> block. I'll try this soonish. > > I do not like the idea of using tags. > > What we might do is: > > 1. Leave :noweb-ref's current behavior of overwriting the parent > parameter values. > 2. Add a new :noweb-ref+ parameter to accumulate multiple noweb > reference names. The relevant function to modify is > `org-babel-merge-params' I like the idea. Thanks for the hint, I'll try that out! Best, Th=C3=A9o