emacs-devel
[Top][All Lists]
Advanced

[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: Mon, 1 Aug 2022 19:31:47 +0000

Hello, Eli.

On Sun, Jul 31, 2022 at 15:52:33 +0300, Eli Zaretskii wrote:
> > From: Andrea Corallo <akrl@sdf.org>
> > Cc: acm@muc.de, emacs-devel@gnu.org
> > Date: Sun, 24 Jul 2022 17:46:02 +0000

> > >> (native-comp-unit-file (subr-native-comp-unit (symbol-function 
> > >> #'find-file)))

> > > Andrea, does anything similar to subr-native-comp-unit exists for
> > > other types of symbols accepted by symbol-file: defvar and defface?

> > No it does not exists.

> > The reason why the compilation unit concept was introduced is to have
> > the GC capable of unloading the eln when possible, this mechanism is
> > only related to functions that are indeed memory mapped from the loaded
> > shared libraries.  Variables etc are just regular variables (tipically
> > defined at eln load time) so they didn't required any new mechanism.

> > > If not, then the only way to produce the same information for them
> > > would be to generate the base name of the .eln file with
> > > comp-el-to-eln-rel-filename, and then look for that file along
> > > native-comp-eln-load-path, right?

> > Yes I think so.

> Andrea and Alan, please review and test the version of symbol-file
> below that I intend to install soon.  TIA.

Sorry to have taken so long.  I've deliberately avoided reading Andrea's
response.

This is brilliant!  It seems to work for me flawlessly.  There's just one
slight mistake:

[ .... ]

> If NATIVE-P is nil, and SYMBOL was loaded from a .eln file, this
> function will return the absolute file name of that .eln file,
> if found.

That should surely read "If NATIVE-P is non-nil, ....".
                                        ^^^^

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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