From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66912: With `require', the byte compiler reports the wrong file for errors. Date: Wed, 06 Nov 2024 13:51:05 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19045"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 66912@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 19:52:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 ) id 1t8l8k-0004kI-Qt for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 19:52:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8l8P-0004Kz-Tj; Wed, 06 Nov 2024 13:52:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t8l8N-0004KQ-5G for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 13:52:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8l8M-0002Ok-H0 for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 13:52:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=FuOLuyetNg4O8LFzdW4U6zFBrfr4zkTZENYxyd4K5Lc=; b=JVRG1boZc6kfm8Pc9xZD4+BmkU/i3G1KVe5eh55zB9ITdwQJ0OaS5vgXO2cmyIa/qmYGMCCS9dbULARCGIr1LEuu3o0wYkrEPG6S54tb1OHvuP4ue0auoG2fzVEF5EuILKqTeoaEU9/wpDYtI5FCJrVycLA5EtkZi/MrOT/NVxij0vNlq+WR8dJf1N7p+IgEF6jWK8iV8IletDHmYRq95IbJx8n/hjXyG4mb6DcBMzGHDZpfFsg84TTVFJV6vFnV5ppGUIr/7NouttT9uvctkWxwGiXR82lJs1x2OeAWygFBDKeBBGKzv+sRHXtiurkLdy2nFstqAKqMwgCtKjj3Ng==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8l8M-0006i8-Bg for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 13:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 18:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66912 X-GNU-PR-Package: emacs Original-Received: via spool by 66912-submit@debbugs.gnu.org id=B66912.173091908425745 (code B ref 66912); Wed, 06 Nov 2024 18:52:02 +0000 Original-Received: (at 66912) by debbugs.gnu.org; 6 Nov 2024 18:51:24 +0000 Original-Received: from localhost ([127.0.0.1]:45431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8l7j-0006hB-Nv for submit@debbugs.gnu.org; Wed, 06 Nov 2024 13:51:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8l7h-0006gy-HP for 66912@debbugs.gnu.org; Wed, 06 Nov 2024 13:51:22 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6C70280A48; Wed, 6 Nov 2024 13:51:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1730919074; bh=p6mlQ3h+4LyMLyh5MyT/xMrvVdWnOK8O+mXK7jEfHKo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=BlSH12d2FGCHLVFtMuAizXgDr8zYdCl3JvvS3f6VYZK40bRyZe+77qj/uZr5fcWpU tUM2BCctO14fOHu2hRM9/nmEMOxE7bx9kMqyGxnrjt7wBYEq6A/NlmFP0pzD/W+b5i lXmaF6llZn+De4vMbaqU2yyeGONcRWB0Mtqah6MAN91tpqM1k8yFskWUrVOy/9yoxq HHsi5jwbmE8VIMacnROt6MayEkT9hJv/5fFmB/lGR4i/RdXsRfWxLYCuDOxEBZW74/ 6MsIdt1Niw40KaZfi3eXSfeZKDkV3RZ0FLSoZ+dGNKCJHsdW+RIjaRECTDBl9Tw8Ar IvzY3tqF5xrlA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 91B1E8056D; Wed, 6 Nov 2024 13:51:14 -0500 (EST) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 81285120312; Wed, 6 Nov 2024 13:51:14 -0500 (EST) In-Reply-To: (Alan Mackenzie's message of "Wed, 6 Nov 2024 16:23:53 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:294977 Archived-At: >> I was thinking we wouldn't bother, just like the we don't bother >> emptying the match-data after we used it. > I'm getting problems when debug-on-error is non-nil, and a *Backtrace* > is on the screen. At this stage, Vloads_in_progress is still non-nil. Right, because we're still in the process of loading those files. > So when another error occurs, even a trivial one like "next-line: End of > buffer", its error message gets prefixed by the "While loading ..." > strings. Of course. This is an instance of the problem I described as follows: But I don't think it would be correct in all cases: if file A loads file B which compiles file C which loads file D which signals an error we want the compiler error message to say "error in D loaded from C" and not "error in D loaded from C loaded from B loaded from A". > This is a Bad Thing. Do you have any suggestions for a fix? Other than changing to another approach (e.g. one that incrementally adds the context info via `handler-bind`s so you only get the context that found "between" the error and the place where we actually handle the error), I think the easy solution is to consider not the whole `Vloads_in_progress_of_last_error` but only the part which is not still present in `Vloads_in_progress`. Something like (while (not (equal Vloads_in_progress_of_last_error Vloads_in_progress)) (setq msg (concat msg " while loading " (pop Vloads_in_progress_of_last_error)))) > I've tried it, and the above problem seems definitely to make it less > simple than the approach I originally took (which currently works). AFAIK, your previous approach suffered from the exact same problem, tho maybe in fewer cases. Stefan