emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using lexical-binding


From: Greg Minshall
Subject: Re: Using lexical-binding
Date: Sat, 20 Mar 2021 06:34:19 +0300

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]