From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wKhIJoO/OmErQQAAgWs5BA (envelope-from ) for ; Fri, 10 Sep 2021 04:14:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qDbNIYO/OmE2aAAAB5/wlQ (envelope-from ) for ; Fri, 10 Sep 2021 02:14:27 +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 F3B1C1FC8 for ; Fri, 10 Sep 2021 04:14:26 +0200 (CEST) Received: from localhost ([::1]:36366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOW3d-0005FR-9R for larch@yhetil.org; Thu, 09 Sep 2021 22:14:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOW3F-0005FJ-L1 for emacs-orgmode@gnu.org; Thu, 09 Sep 2021 22:14:01 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:37627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOW3E-0005Fj-Aj for emacs-orgmode@gnu.org; Thu, 09 Sep 2021 22:14:01 -0400 Received: by mail-pg1-x52c.google.com with SMTP id 17so454711pgp.4 for ; Thu, 09 Sep 2021 19:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=XFrOZOaLz9AnLWkpQxX7xw4p58QGs+qoyUFURHbK0Ls=; b=O4oJEqS3CbPtvCwHFdo9sc1X6E3kEVJGYf2QYtKii/c8wQNrGYgtt96h+mK7z47e9v WmxPSb6dLeaOIkwJUDZBzO5ad5wrHm8hcDbL7T9oonS5RStam8MahmzVLah0gUZAfwfl UQSq6LUXZhhbfDjMzGubaDI4Qhf7DZ8qXJG+XDWkXcIBCB4eG5aI29n3B91AggBQ8J2q CVj0liFqtZAZ98A9Y6MTiVxMZwCtKQX/2Qvdpk1YbHCobSPBMkklvnJ9hc0BeS5tvN7E WMmYf6FS4EKWL+3WOPTpXyRQaEM+zpKhUlelcF9mPIyYvKsY3N5ZOMs2RWgvT8VAqJX9 A45w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=XFrOZOaLz9AnLWkpQxX7xw4p58QGs+qoyUFURHbK0Ls=; b=O3hoEQqG9EXJN21rH38i6ae97nDSIF/IgK/XltwFC8sf1hee4iUgS+sKZpehn3+CI9 ew40LQcjp5+uTwrYdrGafEQB5hs+qzYnw7tlAVAKLUitFdQxxKYC75nXiH54G6I/5HJ4 X8ZX5SWdobQSBInLCQyMGY/JPB3AdHjrhUEUg/clNkfX2TakkPIwuZbpcn52aaFUu4Ra ZqXdL3z3Z2uCCHyR9KWqCHiE+gKRZYdEkR2+ahagbn85OkEqC12r+xybx74TrWl/aU+8 JGjQt/roYjjcIvo1oXLYn8Mg+5AJXHOf+hNlMPvjwycYE6MXe2vBA2vx3lRc76J9a6ZL dWMw== X-Gm-Message-State: AOAM532byfDDHNSfu6KL1jL8EaFtoh2sm+EnlCKfvUgJCfxE05GOtiNM 4cCEJEF2Lm8fRPcV8Fa7RGgpaMNmKU0= X-Google-Smtp-Source: ABdhPJxMIu8V88xpwThph1tLXBnEpq7N+X+fKa6pReZN7vNgDOEcvsMMku/vyPHISmY8FJJX59C3sw== X-Received: by 2002:a63:4303:: with SMTP id q3mr5254452pga.375.1631240038152; Thu, 09 Sep 2021 19:13:58 -0700 (PDT) Received: from tim-desktop (106-69-87-220.dyn.iinet.net.au. [106.69.87.220]) by smtp.gmail.com with ESMTPSA id u9sm3508489pgp.83.2021.09.09.19.13.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 19:13:57 -0700 (PDT) References: <87tuit73ij.fsf@gmail.com> User-agent: mu4e 1.7.0; emacs 27.2.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: [BUG?][PATCH] Should the `lexical-binding' variable be bound during src block with :lexical t? [9.4.6 (9.4.6-ga451f9 @ /home/n/.emacs.d/straight/build/org/)] Date: Fri, 10 Sep 2021 11:53:39 +1000 In-reply-to: <87tuit73ij.fsf@gmail.com> Message-ID: <871r5xfa8t.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x52c.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.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631240067; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=XFrOZOaLz9AnLWkpQxX7xw4p58QGs+qoyUFURHbK0Ls=; b=bQ8BnyBdspxx3YPtuZ/xNqw0yuGVntt0mrquQA4QVj/c89q7MX3bIdCef3mXM+Xy/SfNbR Y8BEh764zYQBfnu2JfFPRlJlythb2pK4DUwNT9wpYe2ged/5iA1BlGLchxShMo22AAfX/D RwX0a4M2znOue96doJOrtQrZ+l7zZThYeTcLi7BYlqW30ALITJHGrSBI0Y4XHV0/inJt5L 5fvQnuNHGCynqdYvZyXf/9+Xhwcd7IVZcSJMm1oqlfSg/G9LDH/XYekUoem3RCy8GNXPcY jI04SfpgXVXd4YPkATahErk8F09Qoo5XwtEYDqaRMs3JCxiGPqLg1SYu/vIjkg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631240067; a=rsa-sha256; cv=none; b=oH/DJPYi90/Y4cwm9zCNU9loEkQJDVW27PuO4wTZ960Ce1CyP+iy+0lofWdEiAHjDIyHcM jijBh50Y8jPfhjL5KU526aCojnCHHsJDUNFipCu10FcXGWZf0c1ZF2uhQchOF6b45JSr4z z6nwuhK3M3z4h05O6PNPDYjY/LizOkWZATO4knAxGRVdg9Y50fAObTW8qGEAS9RUWcw1ml 4pY0S3gLRBWRxvsWX7hEYoMAhkplx81vJcUrUeykJ1kZsWaMVCBvWfAeuIdQQORvQHIy8l yhfur0nvClOiXWJTRAC46Max0WjOkicaD55AY9G1b28J6YII9kAzyo78YAJ7ew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O4oJEqS3; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=O4oJEqS3; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: F3B1C1FC8 X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: vIdhTSo6+ctP No Wayman writes: > I ran into this with some code I'm writing which checks against > `lexical-binding'. > Should the following result in "lexical binding enabled" or > "lexical binding disabled"?: > > #+begin_src emacs-lisp :lexical t > (message "lexical binding %sabled" (if lexical-binding "en" > "dis")) > #+end_src > > Currently the `lexical-binding' variable is not bound because > `org-babel-execute:emacs-lisp' > passes t to `eval', which enables lexical binding, but does not > bind the `lexical-binding' variable. > The attached patch binds the variable in the lexical environment. > It's a matter of whether or not this is the right thing to do. > Thoughts? > > My thoughts on this would be that if lexical-bindings is supposed to be bound to t, it should be done by eval when it gets a non-nil value for it's optional argument. If I execute (eval FORM t) in an emacs lisp buffer, it looks like lexical-bind is not set either, so I don't think it should be in org either. To set it means we could get the same code behaving differently depending on whether the source block is 'tangled' and then evaluated or evaluated within org, which doesn't feel right. Might be worth asking on emacs-devel why (eval FORM t) does not set this variable?