[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: More use of lexical-binding in ox.el
From: |
Nicolas Goaziou |
Subject: |
Re: More use of lexical-binding in ox.el |
Date: |
Tue, 27 Apr 2021 23:12:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hello,
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Here's another patch to remove some more use of the old dynamically
> scoped dialect of ELisp.
>
> Stefan
>
>
> * lisp/ox.el: Fix various uses of the non-lexical-binding ELisp dialect.
> (org-export--get-global-options, org-export-insert-default-template):
> Use lexical-binding.
> (org-export--generate-copy-script): Return a closure rather than
> list starting with `lambda`.
> (org-export-async-start): Turn it into a function (there seems to be
> no reason this was a macro). Use `write-region` rather than
> `with-temp-file`. Always use `utf-8-emacs-unix` coding system since
> it's more efficient and is guaranteed to handle all chars.
> Use lexical-binding in the temp file as well.
> Actually set `debug-on-error` if `org-export-async-debug` says so.
> (org-export-to-buffer, org-export-to-file): Pass a closure rather than
> list starting with `lambda` to `org-export-async-start`.
Thank you!
It looks great but it introduces a test failure, however.
`org-export-expand-include-keyword' is called from within
`org-export-with-buffer-copy'.
At the very beginning of `org-export-expand-include-keyword', there is
(buffer-file-name (buffer-base-buffer))
Before the patch, it returned the source file name. After the patch it
returns nil.
Actually I'm a bit surprised it used to work, since we're evaluating
this from a new buffer, not an existing one. But hey, it worked!
Do you know what could cause this?
Regards,
--
Nicolas Goaziou