jingtaozf / literate-elisp

Load Emacs Lisp code blocks from Org files
45 stars 6 forks source link

loading with lexical-binding #6

Open jaor opened 3 years ago

jaor commented 3 years ago

Hi. I was trying to load a literate org file with lexical-binding set to t, but the obvious

(let ((lexical-binding t))
  (literate-elisp-load-file "file.org"))

still seems to be evaluating the elisp in file.org with lexical binding disabled. Is there any way of accomplishing this?

By the way, thanks a lot for this project: it's made me finally embrace literate programming for elisp in earnest! :)

jingtaozf commented 3 years ago

Emacs original load will try to reset this variable by reading the first line of file: https://github.com/emacs-mirror/emacs/blob/master/src/lread.c#L1290

A patch should fix it later, thanks for your report.

arkhan commented 2 years ago

Regards, is there any way to use lexical-binding? Greetings

jingtaozf commented 2 years ago

Not yet, a patch is welcome.

jingtaozf commented 2 years ago

A workaround for now, put the following line in the beginning of the file

(setq lexical-binding t)

I mean, in the first code block for an org file or a first line for an elisp file.