[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG?][PATCH] Should the `lexical-binding' variable be bound during src
From: |
No Wayman |
Subject: |
[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: |
Thu, 09 Sep 2021 18:58:23 -0400 |
User-agent: |
mu4e 1.5.14; emacs 28.0.50 |
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?
Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X
toolkit, cairo version 1.17.4, Xaw3d scroll bars)
of 2021-09-04
Package: Org mode version 9.4.6 (9.4.6-ga451f9 @
/home/n/.emacs.d/straight/build/org/)
0001-ob-emacs-lisp-bind-lexical-binding-for-lexical-t-src.patch
Description: org-babel-execute-bind-lexical-binding-var
- [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/)],
No Wayman <=