From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EJtuIm5tVWDJFAAA0tVLHw (envelope-from ) for ; Sat, 20 Mar 2021 03:35:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6DooHm5tVWA3TgAAB5/wlQ (envelope-from ) for ; Sat, 20 Mar 2021 03:35: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 DABC919C05 for ; Sat, 20 Mar 2021 04:35:09 +0100 (CET) Received: from localhost ([::1]:52146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNSOJ-0004x7-D3 for larch@yhetil.org; Fri, 19 Mar 2021 23:35:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNSNe-0004wb-1P for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 23:34:26 -0400 Received: from hiwela.pair.com ([209.68.5.201]:21305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNSNc-00017C-9q for emacs-orgmode@gnu.org; Fri, 19 Mar 2021 23:34:25 -0400 Received: from hiwela.pair.com (localhost [127.0.0.1]) by hiwela.pair.com (Postfix) with ESMTP id D5BFB980570; Fri, 19 Mar 2021 23:34:22 -0400 (EDT) Received: from minshall-entroware-apollo.cliq.com (unknown [88.253.115.125]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by hiwela.pair.com (Postfix) with ESMTPSA id A2FBF8F095A; Fri, 19 Mar 2021 23:34:22 -0400 (EDT) Received: from apollo2.minshall.org (localhost [IPv6:::1]) by minshall-entroware-apollo.cliq.com (Postfix) with ESMTP id 063FB63034; Sat, 20 Mar 2021 06:34:20 +0300 (+03) From: Greg Minshall To: Kyle Meyer , Marco Wahl , emacs-orgmode@gnu.org, Stefan Monnier Subject: Re: Using lexical-binding In-reply-to: Your message of "Fri, 19 Mar 2021 19:23:32 +0300." <352069.1616171012@apollo2.minshall.org> X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 27.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <536058.1616211259.1@apollo2.minshall.org> Date: Sat, 20 Mar 2021 06:34:19 +0300 Message-ID: <536059.1616211259@apollo2.minshall.org> Received-SPF: softfail client-ip=209.68.5.201; envelope-from=minshall@umich.edu; helo=hiwela.pair.com X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no 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=1616211310; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Yb0vqfdA2qHFjAX1ia6NusON7OL2IziLzNaWo1mqZTE=; b=mAw4W26IeVUDbOv2KTbLzIMs7yGQTpm0jSCyBVw7q9e+U7lKxSpKpfgsm7TjoP8Q4Ail10 X+z69dxIVqUpr5UDgc+V7TZq3Yyzznz7Nod3HE+nr0N1SwytonwMLuX6gHMHmn9aUahrMd 9HWde91TAVYnA6/+HmITHpaLDbS6iRsObfpKUcW128mq2Di9ESKqT6RgyU+DXkh9bt/30B x2igbRtna6K4EpgiWhhADzqNTA4QiSJVPXDXtagADzWgeqkCnA9UdY0LWx57HQ2b3Buj5R lxSzjWKvscn59ZPoswg1c0VxRTxArAXX1SozAh30LmpE9/jI8aZ7imJ40bns0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616211310; a=rsa-sha256; cv=none; b=DnmMUYqZiYOdbsZ4V5Yld7jCsCpsj57N2yU8CopblB/cC4jbuhGEO2dcL2+/S3nxLA6lhQ mH7CDei0NtVce31sFAXzUOC3dst9gtDmBb4wPMU69Zye+BdxJgQvBX1ORyQ/XOGcCHkw/B BuayntfPVZhQg9xmFx3pH2KR9pDKEG0oGBsYrzdSDHgzTI5BjMQI2MtME8FKffqqzlfvml /xkBXcUsFtqBwIrFeLJEU168lncc1Ge/5+Y8FbsEpcqfD8jRt9ndIqVedmsANqDjvrV8Ch ZQF/Y4nBT5e2qIoSDMuOmp9jLd04rFKTazaKh0wyDVN2er8Zplm6tOHAIkX7Dw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=umich.edu (policy=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-Migadu-Spam-Score: -2.31 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=umich.edu (policy=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-Migadu-Queue-Id: DABC919C05 X-Spam-Score: -2.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: +IVG2n6NA7db > but, iiuc, that relies on dynamic binding. so, as =lexical-binding= is > =t=, i don't have access to those appealing variables. from reading the elisp manual, it seems that one could define those variables to be "special variables", and, iiuc, one can achieve this by using a =defvar= without a value, previous to the =let= where values are assigned. something like (for just full-block): diff --git a/lisp/ob-core.el b/lisp/ob-core.el index af2c9912e..a0528bb06 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1121,6 +1121,7 @@ end-body --------- point at the end of the body" (while (re-search-forward org-babel-src-block-regexp nil t) (when (org-babel-active-location-p) (goto-char (match-beginning 0)) + (defvar full-block) (let ((full-block (match-string 0)) (beg-block (match-beginning 0)) (end-block (match-end 0)) i could do a patch in this style, for all these variables. cheers, Greg