emacs-devel
[Top][All Lists]
Advanced

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

Re: News from the lexical world


From: Stefan Monnier
Subject: Re: News from the lexical world
Date: Sat, 10 Apr 2021 17:32:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier [2021-02-12 11:23:13] wrote:
> Sorry to interrupt your great keybindings discussion, but I'll just
> point out that we have now converted to lexical-binding a bit over 80%
> of Emacs's ELisp files.

Things have progressed a bit since.  We're now down to:

      1 lisp/org/
      1 lisp/progmodes/

    2 / 2019 = 0.099058940069341253%

I.e. there are only 2 files left in Emacs's ELisp codebase which come
without the `lexical-binding:t` cookie.  These are `org-agenda.el`
(which has already been converted upstream, so we're just waiting for
that code to make its way to an Org release and then to Emacs's
`master`) and `verilog-mode.el` (where the situation is a good bit more
delicate: verilog-mode can be used with Verilog files written
specifically for verilog-mode, with embedded ELisp snippets run via
`eval`, and those snippets tend to use "arbitrary" variables which
happened to be bound at that time, so we're still working on
a satisfactory solution, which will likely involve documenting which of
those variables can be used that way, along with what they mean).

This doesn't quite mean that all of Emacs's ELisp code is now using the
new dialect.  The old non-lexbind dialect is still used in a few cases:

- There are still a fair number of calls to `eval` with a nil (or, more
  often, absent) second argument.

- There is also still some code which builds lambda expressions "by
  hand" (typically via backquote or otherwise embedded inside a larger
  quoted piece of data) and without passing the resulting "source code
  expression" to `eval` (or to the byte-compiler) to turn it into
  a "function value".  In the dynbind world those two were one and the
  same, but not so in the lexbind world, and a value that starts with
  a `lambda` will see its body evaluated using the old ELisp dialect.

I welcome help updating those cases.


        Stefan




reply via email to

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