From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mOfOBl0SsWRc8gAASxT56A (envelope-from ) for ; Fri, 14 Jul 2023 11:16:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OJZ2Bl0SsWSLIQEAauVa8A (envelope-from ) for ; Fri, 14 Jul 2023 11:16:13 +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 EF42352BB1 for ; Fri, 14 Jul 2023 11:16:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKEtA-0004Ql-74; Fri, 14 Jul 2023 05:15:00 -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 1qKEt8-0004Q1-Pl for emacs-orgmode@gnu.org; Fri, 14 Jul 2023 05:14:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKEt6-0006JZ-Ek for emacs-orgmode@gnu.org; Fri, 14 Jul 2023 05:14:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 84939240029 for ; Fri, 14 Jul 2023 11:14:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1689326093; bh=RTrmSG2a8O5cy8zEmOuz44Gica8UVXKW2wDFmuMIveg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=nmA5nlBR0SmfKWjpdMzOUkTPm1LUd7s4eg6SWfZa8uxz3mrj9BW3PvQxtktoThpJC GQBKm4XfYmlBzpEzTVUt7qdXHp9O+K0HXqxcc/7JiTqW97j8h9V8l8CHsH4jbBcleJ VYYl6b/n5XWa0HzvV3NpScmVJuzl32L0UH5pdFugKQpCj1DelpgO4PAl4GlVQRhcCN 4RoC2MU7ODfCUzWrY6cyVGNLnCZ/Meut4+AmVc/+aSFmbnZPZFUEgswcNjyHVANvlp 3B2qHqAO1Zlb3yafedQx+Hwd5CE9rbFhkqjtXYo4BCaZ5qH+FcXZBl0CpKGjKP+Hwn wzU5SeE4k3O7Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4R2QmD5nNkz9rxF; Fri, 14 Jul 2023 11:14:52 +0200 (CEST) From: Ihor Radchenko To: Evgenii Klimov Cc: "emacs-orgmode@gnu.org" Subject: Re: [Pre-PATCH v2] Add the capability to specify lexical scope in tangled files (was: Add new :lexical header argument) In-Reply-To: <87zg3zbegv.fsf@lipklim.org> References: <874jm7d5ou.fsf@lipklim.org> <87351rd58c.fsf@localhost> <87zg3zbegv.fsf@lipklim.org> Date: Fri, 14 Jul 2023 09:15:00 +0000 Message-ID: <87jzv2j1m3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -4.00 X-Spam-Score: -4.00 X-Migadu-Queue-Id: EF42352BB1 X-TUID: S7G5hFMGX4Mm Evgenii Klimov writes: > diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS > index a4725ae8c..c632c4814 100644 > --- a/etc/ORG-NEWS > +++ b/etc/ORG-NEWS > @@ -284,6 +284,13 @@ setting the ~STYLE~ property for each sub-task. > The change is breaking when ~org-use-property-inheritance~ is set to ~t~. > > ** New and changed options > +*** =:lexical= header argument now influences tangled files > + > +When extracting an Elisp src block, the target's file > +~lexical-binding~ variable is set according to the src block's > +=:lexical= parameter. If at least one block is set to lexical scope, > +then the whole file will be with lexical scope. I am not sure if I like this approach. I have 2 problems with the patch: 1. Previous users of :lexical header arg might be surprised. Though it is an OK breaking change since people who used :lexical argument and expected it to be ignored in the tangled file probably did something wrong. 2. More importantly, we are adding ob-emacs-lisp-specific handling into generic ob-tangle. What about generalizing the idea and providing a way to set Emacs buffer-local variables in the tangled files? Can be something like: #+begin_src elisp :file-locals (lexical-binding t eval (line-number-mode)) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at