From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CkkxNnp+22IzrAAAbAwnHQ (envelope-from ) for ; Sat, 23 Jul 2022 06:52:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IP0HNXp+22LtRwEAauVa8A (envelope-from ) for ; Sat, 23 Jul 2022 06:52:10 +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 B650539ABF for ; Sat, 23 Jul 2022 06:52:09 +0200 (CEST) Received: from localhost ([::1]:50706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oF77Y-0001to-S3 for larch@yhetil.org; Sat, 23 Jul 2022 00:52:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oF76d-0001tg-3f for emacs-orgmode@gnu.org; Sat, 23 Jul 2022 00:51:11 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:36454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oF76b-00068k-Ei for emacs-orgmode@gnu.org; Sat, 23 Jul 2022 00:51:10 -0400 Received: by mail-pj1-x102e.google.com with SMTP id t3-20020a17090a3b4300b001f21eb7e8b0so9172796pjf.1 for ; Fri, 22 Jul 2022 21:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=QlaYMNSukQRUN3FfTt6oL2lxgD0QojZl88Su92jne4s=; b=Z4gQyBjZQQSO/CXBUEjYP+OC8n3vcUWwGSuTX8kxJHL/gLs0+WbnQV4IuOk0jXu+Qp opLt713bfZSgEoDkJDipipTQJIMGursn7+W1y6uLsDSoClkN/fXWZHhbcrXUFW/KXZ6L nsvmtT1EweE5K+DgURV9ZGFVZiiT1qpoU7z6HGbrFOQ7tlOmS07K3A9+YKp27JtZ63uc q1tB5DyB/wTj4b50s9tqh2wpLFO9PjAsKptGw1q9ykRqOo1Fhg6duwpizHSxtv1ed8UU DdxlfiHsNCr98Q6POeMPOh4jGsRklg9tokv+RbUu9aydy5YXqZ6Zdpcf58RmNxRfROqW fzOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=QlaYMNSukQRUN3FfTt6oL2lxgD0QojZl88Su92jne4s=; b=20+8DM7s+L8CWiV7fhcsljb129IF60VooLe6JOAtVnM3DqDdZoFsmKYPTcvEI+bwDB x9rRldm/6WLrX8kVYIYpkRBHtXG8oB/WUb6AfDVOV+EYkvgwe7iIeP0AIwq+Tt6JQnwC wYuj5Dq3hYWksKyJAMdHSzmxqFK44DvBcPpSTqJUL2AWsJVt70RabIPTkXn56VUq7+po XhFIJVF9Z668cGLrTXi7xnDg2V3ouQmTAzCNtr4KviC/2r3efZfXDepW6HHkMqlZKgyR hwKXsGRSn5hv4pXIdvWyo988aqysv8NXeO1K4bCK0j4tvTAcHxYWEZ192HKuzFC1xPdm cHiw== X-Gm-Message-State: AJIora/fbt46Os8yXZBaYIzVjbZNC3UwwCOh/g1aFu7M6cwFsiEwMJ/M lhF5NBV2P+YZOmYTLa1vC9I= X-Google-Smtp-Source: AGRyM1uZ3AQ4xG4HTIsM8VGCNGm6mjsDON+ogJgA/JMt3wFBfJ0YMRk+CW90AYiPBhyJCPpywfiUiQ== X-Received: by 2002:a17:903:11d1:b0:16c:defc:a098 with SMTP id q17-20020a17090311d100b0016cdefca098mr3069021plh.50.1658551867866; Fri, 22 Jul 2022 21:51:07 -0700 (PDT) Received: from localhost ([1.83.155.1]) by smtp.gmail.com with ESMTPSA id e9-20020a656889000000b0040c40b022fbsm4311638pgt.94.2022.07.22.21.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 21:51:07 -0700 (PDT) From: Ihor Radchenko To: sebastien.miquel@posteo.eu Cc: emacs-orgmode , Greg Minshall Subject: Re: [FR] Make :var foo=name-of-src-block assign the source block code instead of currently assigned result of evaluation (was: [PATCH] Add :noweb-prefix and :noweb-trans babel header arguments) In-Reply-To: <635c8e99-ea37-f93a-4eab-e547d2c2ab61@posteo.eu> References: <2dd9630a-c584-0702-62aa-393ad56c621e@posteo.eu> <875ymt8goc.fsf@localhost> <87v8urt8bu.fsf@localhost> <03eb4c66-ecaf-b5f5-c4cc-2195fb6c1a1a@posteo.eu> <87y1yiz3js.fsf@localhost> <7702b511-c289-5688-c64c-fb673324a63a@posteo.eu> <87ilnxe8oz.fsf@localhost> <1869598.1657966650@apollo2.minshall.org> <87k08dxrnc.fsf@localhost> <635c8e99-ea37-f93a-4eab-e547d2c2ab61@posteo.eu> Date: Sat, 23 Jul 2022 12:52:12 +0800 Message-ID: <87sfmsv3b7.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.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=1658551929; 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=QlaYMNSukQRUN3FfTt6oL2lxgD0QojZl88Su92jne4s=; b=m6+9a0kUdsZQ6cWOq+WlP3M6xC6Wmm/q0vw5sweGL/DW1L/uJ13MX+EnA8R/2NYu8Ze9RX kjsZ8y9XpO9zLF7mK9nQyyN2Eg76vCSt5ypZeRhVHNZdmfA9K7pBzADNeZon8VtLC1AkQ4 CZHfhduwhDZbUYvkjnPqQ3mUhCNCP6QuA7CgvfgO2VB7wJJKZyEqyhZPw5ALVCuXtIX6ry 3mZIJpUNElF6ulkWFokni438r7LfBObVVId+r7rhzqjqzF1Sesuo3Ks/aGqdABQk41KZmn GU+yViBcqCOGCjRZDCXNylidcGAUfOU8Nrets6THENOgoV3TDEq8v5FFSbM5Dw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658551929; a=rsa-sha256; cv=none; b=DUPBSm+q40hFVQUyMi1t4oPLj8ZbeGqt+FPpXcH3msheqvqP2BtSqm9pMW2wgz+P3ws7Do 8qLj+HUNubeph8ISFo0BBB9ZMl3dSVKmcmI0PXnP+W7verbIDiYDxJ1eu6S4hJkLUydjrQ tKlHYkPiQcDid+Fa8rusVqeiESb9vS+VP8YvjL5LxFknVXu6RcM/lx1CK6PdsPs+7uJMa9 8yJ8xhWD39n8MpwWGWeF461OTNOCmx0f8kLFaFOl6kE2N1+kuyjCObKf2Qtsin/Q5i5k7t F8EfLuFWJY/kHRNdCw1Pbgtc4SF2uR9LBYbtC4j6PTwwnzqfF1/CSdH9xlcE/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z4gQyBjZ; 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: -8.24 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Z4gQyBjZ; 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: B650539ABF X-Spam-Score: -8.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: TFMDbRkqufrI S=C3=A9bastien Miquel writes: > The uses are maybe too niche to warrant the breaking change. A syntax > extension like > : var=3Dblock-id[] > seems possible, even though brackets are already overloaded. This sounds better. Using brackets will actually make a lot of sense. Currently, we have roughly the following logic in the :var references: - :var x=3Dreference() will execute the reference and assign the returned value - :var x=3Dreference[] will take the reference text representation, possibly process it according to the parameters, and return the processed text *this only works for tables* - :var x=3Dreference will perform some "default" action depending on the reference type. the action may be "execute" or "get text representation" for source blocks and others correspondingly. Extending reference[...] syntax to all the element types will make things consistent and allow future extensions if we decide to provide "index" syntax for non-tables (code lines, function definitions?) > One alternative is to only allow the syntax inside noweb brackets > instead of generic variable arguments. I assume there'd be much less > breakage. It would also makes sense to allow noweb references instead > of block ids. We'd add support for > : <> > and <> would also insert the contents as a > by-product. This would still be a breaking change. And we will introduce inconsistency between resolving noweb references and resolving :var header args. Moreover, resolving references is currently handled by the same code inside :vars and noweb references. Changing this will complicate the source code as well, IMHO increasing the maintenance burden too much. > Do you have any example of use in mind, beyond my original one ? For example, one may convert .el file commentary to Readme.org: #+name: my-library #+begin_src :tangle my-library.el ;; Commentary: ;; A lot of commentary #+end_src #+begin_src :exports results :var commentary=3Dmy-library[] (convert-to-org-headlines commentary) #+end_src Best, Ihor