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 aMbWLDifnGJFBgEAbAwnHQ (envelope-from ) for ; Sun, 05 Jun 2022 14:19:04 +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 kCXNLDifnGJv2QAAauVa8A (envelope-from ) for ; Sun, 05 Jun 2022 14:19:04 +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 6889336BC8 for ; Sun, 5 Jun 2022 14:19:04 +0200 (CEST) Received: from localhost ([::1]:49332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxpDj-0008Az-EH for larch@yhetil.org; Sun, 05 Jun 2022 08:19:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxpCU-0008Ap-72 for emacs-orgmode@gnu.org; Sun, 05 Jun 2022 08:17:46 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:45806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxpCS-0008Qp-Lu for emacs-orgmode@gnu.org; Sun, 05 Jun 2022 08:17:45 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 7so10027274pga.12 for ; Sun, 05 Jun 2022 05:17:44 -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; bh=m+1goGGaH0feebWm3ZEZgHnWg7EsQUvb1t8wmp/qlgs=; b=bK21lOvnnPb0hRlcHTQvRlJYx5i7PEQ2f/xSryvgqQz+iSXZy0F63Hp0z0xlRYK19U VnwRmkr1nTzRuZOii9ML9oUYabS/w64WbMMDbUcRNx94bgnuQNHCkEy0ISz5uTI5chlC czh/0JBEEttyZQKN/H2FJfPKVC+vsrz/FwsvcOPVFjC85IoseHhK+Xx3YqegvbPZECAC Zfkn4BnW+LkccQlLIJE975wRdC8xPs2EM9ePIunGst24VW99nGKgboD5uRKc70GrSvoy WExRWQ9quhEprUbGVEEDbu8I3fEuppDASOTHACaPaqUQt07Wn6g2k3LJ3NQiZek9swnW R4jA== 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; bh=m+1goGGaH0feebWm3ZEZgHnWg7EsQUvb1t8wmp/qlgs=; b=cFLo0SR2Gt8qdHssF02wiqAuTnNBdX2UwsTZm2eWnKpyQpIez/6QdcK0zZI/zOmGYh I0yJfsPAQlMzsiSWxJY/uBy4sYW6wWbUQPW96iw/d7rz6CuQdSo9V6HV5Hbkzjzds+rq o1lU1J3zZ+WeF6a9XUY2XHGWOYUfobujXLMQfuIZtoATkEva8DcwlwpdioZ3ZwDdA4I6 dvfb7OJMZOOHCOGW5nsHJusNfjYzOiwsHyx9hSJ7CuMKFeehmmUOvsx+qJbL7j4UmxqA toezZsB581s2awpq1jgKgRCBRPdsse+yp8PzP5DqcpJYk3xF74XbD2yjFXnpWj85z3mw uEew== X-Gm-Message-State: AOAM530Pam860v9c3CwaM38wgqi7HA1eTI6JSzoEHBAmGCmBEqQZrmro jEXq9FDjjwezr04s5pqRXJA= X-Google-Smtp-Source: ABdhPJyh6NTNH7oWpazKO74okPoc8aN4803bVDFT5FrVKlsFHCh+/ptRM8K/LbIdpkK3/xq3FTVdCw== X-Received: by 2002:a63:5a21:0:b0:3fd:41e4:f833 with SMTP id o33-20020a635a21000000b003fd41e4f833mr8495826pgb.409.1654431463259; Sun, 05 Jun 2022 05:17:43 -0700 (PDT) Received: from localhost ([208.115.232.2]) by smtp.gmail.com with ESMTPSA id e63-20020a621e42000000b0051bbb661782sm7945171pfe.192.2022.06.05.05.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 05:17:42 -0700 (PDT) From: Ihor Radchenko To: Matt Huszagh Cc: "emacs-orgmode@gnu.org" Subject: Re: [PATCH] Fix behavior of lambda default header arg vars In-Reply-To: <87o87abjm5.fsf@gmail.com> References: <87o87abjm5.fsf@gmail.com> Date: Sun, 05 Jun 2022 20:18:18 +0800 Message-ID: <87ee035mnp.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.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=1654431544; 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=m+1goGGaH0feebWm3ZEZgHnWg7EsQUvb1t8wmp/qlgs=; b=ZjCGiWTBFfgyLTdKOaUSNCzsZQo1rNcdPEitL8j+zrPuO1MU/+VxlIiExzRUzjsQjmSM+U I9HHn1rSa+rvmhtWtyMi3PKi9pRUVBwfliTq5jNVLiDDWTjr1ytz9qcO16hTQib+wDP4F+ eD0OKFESDUOWcmOu6oWHvO4vBLVtLUAIc/CWCcieumIayIAtoKVt0rlurn4aj3qRafOY47 RXE3YTexN+dDCMHkfPyZGHu58quN0gD5kgdDS+j4qyKhSFOH7pxg6eRDU3jAQJh9EGsPsa 1qjXdr6V/CH6tgFimFgsDxwq7Ylxs+hkFQp0+W7Fja9lmHq4s/eS+48XhIsyTA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654431544; a=rsa-sha256; cv=none; b=XlKQ2uBQ+mEKZuYLRQkPZRbjlwQykiF0bJcZemU8Fx597TUUcNvaUoKRkVgygt5PCuKFTa q5bkNEceALERUDOvqkJYGMqrgect9uwHukcz1OBww/ymbmQrocc8XXJm2c7YIYMC4hjZNp ye4vGaS6QNkLJEuZTYkGZt6jTEpBbmCqdsfK+UJQ46n0Nr55odY0jJers4wT3qs4S8uVIx FuvU45yENLiTlGmVP+bZgRNwgYSU1YCwPc2RhPURx0OSRn2Bcmrj6InxfEp4+Cx3Or+xiu 9nxtYnJJHWy+fLlG8M4q+WxbO/8fHaXyxhHEZiRsg/Ga4ZCw3HifbLLB4lwLIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bK21lOvn; 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: -4.31 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bK21lOvn; 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: 6889336BC8 X-Spam-Score: -4.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: POOKmL3GcCtt Matt Huszagh writes: > :var header arguments can be provided multiple times. This is supported > directly at the source block and through the default header argument > facility. However, this was not handled correctly when the var was > evaluated from a closure in a default header argument (only the last var > was taken). This patch fixes that. I've also added documentation > explaining how to set multiple vars in the default header argument > facility. Thanks for the patch and sorry for the late reply. > -arbitrary function symbol (e.g. 'some-func), since org uses > -lexical binding. To achieve the same functionality, call the > -function within a closure (e.g. (lambda () (some-func))). > +evaluates to a string. Some header arguments (e.g., :var for > +some language backends) can be provided multiple times for a > +source block. This functionality is also supported for default > +header arguments by providing the header argument multiple times > +in the alist. For example: > + > +'((:var . \"foo=\\\"bar\\\"\") > + (:var . \"bar=\\\"foo\\\"\")) > + > +A closure is evaluated when the source block is being > +evaluated (e.g. during execution or export), with point at the > +source block. It is not possible to use an arbitrary function > +symbol (e.g. 'some-func), since org uses lexical binding. To > +achieve the same functionality, call the function within a > +closure (e.g. (lambda () (some-func))). The new docstring is confusing. The same paragraph is talking about closures, then multiple header args, and gives an example without closures. It would help if closure part and multi-variable part were split into separate paragraphs. Also, the example is not helpful here. Are you saying that _only some_ backends support multiple vars? Are there backends that do not support? Or are you talking about multiple assignments to the same variable? Best, Ihor