From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: gmane.emacs.devel
Subject: Re: How does one find out what file a library has been loaded from?
Date: Thu, 21 Jul 2022 13:52:43 -0400
Message-ID: <jwvzgh2fjn2.fsf-monnier+emacs@gnu.org>
References: <YtaM2N5sIH1YXvPx@ACM> <83bktlnuog.fsf@gnu.org>
 <YtbHOGta+SWoXeaf@ACM> <83sfmxm79z.fsf@gnu.org> <YtbkvUeMhKGyOIb4@ACM>
 <83fsiwncem.fsf@gnu.org> <YtfrP84c5Q2hl2og@ACM> <YthmvWi7lIFfGAGR@ACM>
 <83mtd3ngcw.fsf@gnu.org> <YtmOz+0n1Ah9kTse@ACM>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="17680"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
To: Alan Mackenzie <acm@muc.de>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jul 21 19:54:00 2022
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1oEaN5-0004JK-Q4
	for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jul 2022 19:54:00 +0200
Original-Received: from localhost ([::1]:52570 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>)
	id 1oEaN4-00089a-Cn
	for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jul 2022 13:53:58 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38786)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@iro.umontreal.ca>)
 id 1oEaM4-0007PH-Jr
 for emacs-devel@gnu.org; Thu, 21 Jul 2022 13:52:56 -0400
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22105)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <monnier@iro.umontreal.ca>)
 id 1oEaM2-0003rg-Dq; Thu, 21 Jul 2022 13:52:55 -0400
Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 733F9440C2E;
 Thu, 21 Jul 2022 13:52:52 -0400 (EDT)
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D000B441163;
 Thu, 21 Jul 2022 13:52:50 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1658425970;
 bh=GUbmXGlOWsusOB1c6lgBDzgQPAgpLzp/hoPog3Ze2CU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=cWRE8HOOlYQvKLCFji5J7oQ0YVkwgPAAXzeKUI+TvJFUYI5YZifUzz/lA2S4t9e4n
 nPzONoyq5uKNKV2I3m92WBWfkJy034kwmutSgrmQhrAF8wSOiIVP3dkTKfbdIv+dbu
 kl0wMomD/evPlqixNrHa9tJXud4ICjplG093QCMWuUcvNXvipKCnD45P26F+Cj6jjj
 ygYcbH5Kw3YYWWZKkyJYMHe6vYv7jvixDGPfeIbzEAk5wzcCwfBRAwcb2VE8XyANf8
 QwtZcw5kua1juNptJIxwYdRX9CQ7+NxgilRRcW390NLqBWJQqDDXtFCBnzgfeAQM94
 hr7VJwIUhsstA==
Original-Received: from pastel (unknown [45.72.195.111])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 787A31201B0;
 Thu, 21 Jul 2022 13:52:50 -0400 (EDT)
In-Reply-To: <YtmOz+0n1Ah9kTse@ACM> (Alan Mackenzie's message of "Thu, 21 Jul
 2022 17:37:19 +0000")
Received-SPF: pass client-ip=132.204.25.50;
 envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca
X-Spam_score_int: -42
X-Spam_score: -4.3
X-Spam_bar: ----
X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
 <mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org
Original-Sender: "Emacs-devel"
 <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>
Xref: news.gmane.io gmane.emacs.devel:292388
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/292388>

> 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: 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 matter (ELisp code shouldn't need to know
and end-users shouldn't need to know either (barring bugs or curiosity
of course)).

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`.


        Stefan