From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YFOTBKrThl9lbwAA0tVLHw (envelope-from ) for ; Wed, 14 Oct 2020 10:32:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MMKFAKrThl/LCgAA1q6Kng (envelope-from ) for ; Wed, 14 Oct 2020 10:32:10 +0000 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 E3EEA9404CA for ; Wed, 14 Oct 2020 10:32:07 +0000 (UTC) Received: from localhost ([::1]:36388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSe4j-0007y3-A7 for larch@yhetil.org; Wed, 14 Oct 2020 06:32:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSe3t-0007xo-IK for emacs-orgmode@gnu.org; Wed, 14 Oct 2020 06:31:13 -0400 Received: from smtp-out-6.univ-rouen.fr ([193.52.152.101]:47639 helo=mailhoc.univ-rouen.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSe3r-0007By-58; Wed, 14 Oct 2020 06:31:13 -0400 Received: from IRED-15-19C0 (89-80-224-241.abo.bbox.fr [89.80.224.241]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailhoc.univ-rouen.fr (Postfix) with ESMTPSA id 5E3361B66; Wed, 14 Oct 2020 12:31:05 +0200 (CEST) Message-ID: Subject: Re: babel default header args as functions From: rey-coyrehourcq To: Tom Gillespie , Matt Huszagh Date: Wed, 14 Oct 2020 12:31:04 +0200 In-Reply-To: References: <87ftflikkc.fsf@gmail.com> <871rjqprdu.fsf@gmail.com> <875z8wxis3.fsf@gmail.com> <87k0x8dy3s.fsf@gnu.org> <87y2lizs63.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-vz7dRLlzVvjxFNDFVNIv" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Received-SPF: pass client-ip=193.52.152.101; envelope-from=sebastien.rey-coyrehourcq@univ-rouen.fr; helo=mailhoc.univ-rouen.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/14 06:31:05 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_BL=0.001, RCVD_IN_MSPIKE_L3=0.001, SPF_HELO_PASS=-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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastien , "emacs-orgmode@gnu.org" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: jgKZAu/jkiC/ --=-vz7dRLlzVvjxFNDFVNIv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi there, I'm interested by this functionality, do you know if it was merged or i nee= d to apply patch locally ? Thanks Matt for your work, Best=20 SR Le mercredi 09 septembre 2020 =C3=A0 12:33 -0700, Tom Gillespie a =C3=A9cri= t : > Hi Matt, > Looking good here. Thanks! > Tom >=20 > On Wed, Sep 9, 2020 at 12:06 PM Matt Huszagh wrot= e: > > Tom Gillespie writes: > >=20 > > > [...] I have a number of use > > > cases that I can imagine would benefit greatly from being able to > > > define a :header-args: :header (lambda () "yay!") property as a > > > closure (and actually I assumed that it would just work that way if I > > > tried to do it, clearly not though). I can't tell for sure if the > > > patch enables this behavior though or whether I would still get a > > > Wrong type argument error. > >=20 > > This should work. Do you have reason for believing it might not? >=20 > With the patch applied this is working on my end. >=20 > * test header > :PROPERTIES: > :header-args:bash: :tangle (lambda () "./from-header.sh") > :END: >=20 > #+begin_src bash :shebang "#!/usr/bin/env bash" > echo yes > #+end_src >=20 > > > [...] Looking > > > at the patch it seems that it preserves the behavior of performing th= e > > > evaluation of the closures at the source block, but I'm not 100% sure= . > >=20 > > I'm not sure I completely understand what you mean here. However, the > > closures are evaluated when point is at the source block, during the > > source block evaluation, not when the default headers are declared. Thi= s > > allows the closures to use context-dependent functionality (e.g. you ca= n > > call `org-element-at-point' inside the closure and retrieve whatever > > information you want). Does this address your concern? Please clarify i= f > > I've missed your point. >=20 > Yep, you've got it. >=20 > > > If the default header closures are being evaluated before checking > > > whether they have been superseded by the headers on a block then that > > > is incorrect and they should not be evaluated until it is clear that > > > they are the value of the header for that block and have not been > > > superseded. > >=20 > > I've fixed my patch (attached) so that now closures are only evaluated > > when they are used as part of the final set of headers. >=20 > Great. >=20 --=-vz7dRLlzVvjxFNDFVNIv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEQdBRWS1ZqcB6tN8l3FXLa3BDQW4FAl+G02gACgkQ3FXLa3BD QW4IRRAAm21SdREYaooRwFCDrY0tEjR4CcOhUNI6Sl1Qgh8qpJhcaFsaZBHq6i4j SZXb4Cf7AFfSPnc8JOSaEJooR+8ucuZxbQg4537N+V8hNTG4GQRxkuSWR3Pso3d8 8d5EWF776RDq8uEMyfo18sfeiUoFqgX8c0uqhyXVIU8JkN39b3WKyDPZ9rjVWm5V X3zjH67HvR73jLOX0+qXGK/9Z5mQWeBmELGnOWrPqvUf8jXxeCcOhTDCDdb9FZpu nLBSxXJHu35GhS0jupCsyXhYboC8XWJoKs+1LfOsVo7sFT3sQ6nD1KG3MtUm/OZA jcI+IGfbgK2QPOarjXgRX4YIR3kggHzL32xUWoKg0BAfx1C297L0eGEQLr3KWlZc XgOASPwwDiCyjiBFBL+POaT6ayAixW/MYYu8I1BGdQFggsqv9QWwD01Z8o7dzMJk ImAS72Yp+z4/hNcLqKpZgvr4J6x+i5scZ2Ylq22bhFbu/fdo/T/f0RRor6IDIbwn EwI0KRESw6XlYiDVw/EsAdx0ETU6Ow/2DlB3vBb2Hzf0tqAATcoRo13q0oQRqFz6 +7PWuLHXmuhO90V94+J3cSlWgm12b00LXeadXXqzmzSMM7JWRbGFnBRF+W7ZuhrR /BStMeHN1AhgaPPbLElX67fJvuFimR2rOgCMxgKrtc1TaINC808= =yz7S -----END PGP SIGNATURE----- --=-vz7dRLlzVvjxFNDFVNIv--