[Top][All Lists]

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

Re: How does one find out what file a library has been loaded from?

From: Alan Mackenzie
Subject: Re: How does one find out what file a library has been loaded from?
Date: Thu, 21 Jul 2022 18:24:17 +0000

Hello, Stefan.

On Thu, Jul 21, 2022 at 13:52:43 -0400, Stefan Monnier wrote:
> > It's accurate, though.  The current text is not accurate.  The situation
> > it is describing is vague and confusing.

> > Would this strategy be an improvement: "This function returns a file
> > name.  When the file from which the function was loaded was a source
> > file or byte compiled file .......  When that file was a native compiled
> > file ......."?

> BTW, the design of the native code compiler is that it aims to be
> transparent, a bit like a JIT compiler would be transparent:

I think the word you should be using is not "transparent", but "opaque".

> whether the native code comes from a .eln file or was generated
> on-the-fly or combined from several .eln files (or any other option
> you can come up with) should ideally not matterd.

That is a gross departure from long valued Emacs philosophy - that there
should be nothing "transparent" (i.e. opaque) to the user, and that it's
not for us maintainers to predict what users want to do in their hacking
(and thus restrict Emacs to just doing those predicted things).

For crying out loud, you can even get the position of the gap in Emacs
Lisp.  That is surely a candidate for being "transparent" (i.e. opaque)
if ever there were one.

> (ELisp code shouldn't need to know and end-users shouldn't need to
> know either (barring bugs or curiosity of course))

For those reasons, amongs others, there shouldn't be these transparent (i.e.
opaque) things.

> Clearly we do want to make that info visible somehow (e.g. for debugging
> purposes, but also because we can never make something really
> transparent), but it's very different from `load-history` which keeps
> track of information that is relevant: whether /usr/share/.../org.el, or
> usr/share/.../org.elc, or ~/.emacs.d/elpa/.../org.el, or ... was loaded
> can result in different outcomes even if there's no bug anywhere.
> Those 4 files do not have the same semantics., e.g. because it's not the
> same version of Org, or because of the `eval-when-compile` in `org.el`.

I think we've violently in agreement, here.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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