emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-orgmode@gnu.org
Subject: Re: More use of lexical-binding in ox.el
Date: Tue, 27 Apr 2021 23:12:46 +0200	[thread overview]
Message-ID: <87wnsnig8h.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <jwvk0oxr5ut.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 19 Apr 2021 23:37:50 -0400")

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


  reply	other threads:[~2021-04-27 21:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20  3:37 More use of lexical-binding in ox.el Stefan Monnier
2021-04-27 21:12 ` Nicolas Goaziou [this message]
2021-04-27 22:51   ` Stefan Monnier
2021-04-28  8:45     ` Nicolas Goaziou
2021-04-28 14:15       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnsnig8h.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).