From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.devel
Subject: Re: How does one find out what file a library has been loaded from?
Date: Wed, 03 Aug 2022 17:19:07 +0300
Message-ID: <834jyt5s10.fsf@gnu.org>
References: <YtaM2N5sIH1YXvPx@ACM> <83bktlnuog.fsf@gnu.org>
 <YtbHOGta+SWoXeaf@ACM> <xjfv8rtnmnb.fsf@ma.sdf.org>
 <83ilnmfq9t.fsf@gnu.org> <xjf8roimmjp.fsf@ma.sdf.org>
 <83ilnd4f72.fsf@gnu.org> <xjfczdkl3ly.fsf@ma.sdf.org>
 <xjfy1w7jara.fsf@ma.sdf.org> <83bkt226a7.fsf@gnu.org>
 <xjfr11yka1l.fsf@ma.sdf.org>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="1368"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: acm@muc.de, emacs-devel@gnu.org
To: Andrea Corallo <akrl@sdf.org>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 03 16:21: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 1oJFF5-00006b-Ut
	for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Aug 2022 16:21:00 +0200
Original-Received: from localhost ([::1]:48160 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 1oJFF5-0002zc-2S
	for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Aug 2022 10:20:59 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38038)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>) id 1oJFDO-0001GW-Mo
 for emacs-devel@gnu.org; Wed, 03 Aug 2022 10:19:14 -0400
Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46062)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1oJFDO-0004j3-4Y; Wed, 03 Aug 2022 10:19:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=yeAC0Iwcae/Q2ZDPJb7jI79ChEili5l/0/HHYvuK2T4=; b=YWfxI8jS/M+I
 CLSQhHfC9VeK3TwG6TK4itKxAOFNNgZ57t1ms84Oz0iQk9JriS2BhyNoNSSC7fBm7L0b7D06apYkf
 8DtxlNercOIgX3ev5cmdO1J9olm0lrNslg/nyvTNWRU+mh1s3zLVt0bm1QYoZGUNSxWBd8JHkf+LV
 mwJhQ1V3geioDIdNuzinAMxy09THl7b2DfUm6pxWS4Gn592zt3sYGxtV9Tn4i8SEUd5wCzhhqw4KM
 bPKgA3oWMbV+nRmu6BhkY0lqcQAKgbbnJpCl8A7XFPZKFy9xUgOf/WCeX0lqzg6rV+1oeQwOliHfM
 7Gz0bQ/KgXhjkQqmhUHuYw==;
Original-Received: from [87.69.77.57] (port=4563 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1oJFDN-00009h-5j; Wed, 03 Aug 2022 10:19:13 -0400
In-Reply-To: <xjfr11yka1l.fsf@ma.sdf.org> (message from Andrea Corallo on Tue, 
 02 Aug 2022 14:13:58 +0000)
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:293023
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/293023>

> From: Andrea Corallo <akrl@sdf.org>
> Cc: acm@muc.de, emacs-devel@gnu.org
> Date: Tue, 02 Aug 2022 14:13:58 +0000
> 
> > So in that case, my changes would return the .eln file even
> > though it was not actually loaded.
> 
> Ops that's correct, I miss-read your code sorry.
> 
> > We could document this corner use case, and say that we return the
> > .eln file even if it's outdated, or we could add the timestamp test
> > you suggested, and return the .elc file if the test fails.
> 
> I think would be nicer to have the timestamp test.
> 
> Still if the filesystem state changes the result could be incorrect, ex
> one could even remove the .eln file and even if the definition is coming
> from it we'd return the .elc.  Perhaps we should document this?

OK, thanks.  I added the timestamp test, fixed the typo spotted by
Alan, and installed the changes together with their documentation.