emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding refactoring capabilities to Emacs


From: Stefan Monnier
Subject: Re: Adding refactoring capabilities to Emacs
Date: Thu, 07 Sep 2023 13:06:56 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

>> Going back from there to the actual source code can be a fair bit more
>> tricky,
> Exactly.
>> but Alan's symbols-with-positions should provide just what we need.
> Great! but how?
> Some years ago I presented a full source-tracking reader for Common Lisp
> with just Lisp to a conference ;-) Needs a programmable reader though :-(
> As you may remember, I then paired it with a full code walker to create
> a stepper.

We do have a "full source-tracking reader" writen in ELisp inside `edebug.el`.
It's not 100% faithful to `lread.c`, but it seems to work well enough
that we haven't heard too many bug reports about it over the years.

Still, can't be used with `cconv` because the the "sexp with
source-tracking info" don't have the shape expected by macros.

> Is lread.c used for symbols-with-positions, or is code read in some
> other completely new way?

Yes, the symbols-with-positions thingy was done by extending `lread.c`.
It keeps track of the source position only for symbols rather than for
all Lisp objects, but it does it in a way which can survive
macro-expansion.

It's what's used in the byte-compiler to provide position info in
the warnings.

> Of course, but I don't understand the "tho",

Yeah, it was probably not a correct usage.  Please ignore it.

> since that's exactly what I described.

Yes, we agree.


        Stefan




reply via email to

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