From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#66912: With `require', the byte compiler reports the wrong file for errors. Date: Wed, 6 Nov 2024 16:23:53 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2574"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, Eli Zaretskii , 66912@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 06 17:25:24 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 1t8iqS-0000Tn-8p for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Nov 2024 17:25:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8iq9-0000YB-KC; Wed, 06 Nov 2024 11:25:05 -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 1t8iq7-0000Vx-8J for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 11:25: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 1t8iq6-0000Ll-UI for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 11:25:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:In-Reply-To:MIME-Version:References:Date:To:Subject; bh=JMSTYVi9Yx34VrnfcSKTKRhHkm2m/qkxQFDZqnUjX1U=; b=SstjK7drDP4IflpiM1jNwIDt28VPGModoKGFkjD4QVM1a0kvKLrKvI97tXe256xs17/IhG47KcmShc1Qb1jIoA+UWki67XBE2Bc+/1K/RjjmHKSm13iiP9VNnJkV3TGY1uHI34O4orBStc3elYL3r3jhKRVUrSTII6q+9clrW0/iWO0U543WtJABeu4e8+YJ7d2taK+Wk5PhqlRH3idEl+I3MwhXL6MoTALEVtofwJxlsDjZrIftSeQyDkw+KUpvc8yyZ0v9DPD53/k68aq93eDWbGzgxekf3X0WohfnKOm2x+0Bjrq1vWKXKJBfbzO3C2s9F9mmokrAcliG/7KxuQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t8iq5-0008En-RI for bug-gnu-emacs@gnu.org; Wed, 06 Nov 2024 11:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Nov 2024 16:25:01 +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.173091024731594 (code B ref 66912); Wed, 06 Nov 2024 16:25:01 +0000 Original-Received: (at 66912) by debbugs.gnu.org; 6 Nov 2024 16:24:07 +0000 Original-Received: from localhost ([127.0.0.1]:45235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8ipC-0008DV-Js for submit@debbugs.gnu.org; Wed, 06 Nov 2024 11:24:07 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:59004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t8ip7-0008Cw-Vx for 66912@debbugs.gnu.org; Wed, 06 Nov 2024 11:24:04 -0500 Original-Received: (qmail 85540 invoked by uid 3782); 6 Nov 2024 17:23:55 +0100 Original-Received: from muc.de (p4fe15b0f.dip0.t-ipconnect.de [79.225.91.15]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 06 Nov 2024 17:23:54 +0100 Original-Received: (qmail 32420 invoked by uid 1000); 6 Nov 2024 16:23:53 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:294974 Archived-At: Hello, Stefan. I've implemented your suggestion, and it mostly works. Let me know if you'd like to see the patch (for which I'd have to tidy up the source code). But .... On Tue, Nov 05, 2024 at 18:20:03 -0500, Stefan Monnier wrote: > > There needs to be some mechanism for resetting this variable to Qnil, > > should the error handler fail to access it. > 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. 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. This is a Bad Thing. Do you have any suggestions for a fix? Things like artificially setting or binding Vloads_in_progress to nil don't seem like proper fixes. > > Also, we need to be careful about condition-cases in debuggers, where an > > error, even if handled, might overwrite Vloads_in_progress_of_last_error. > Yes, we may want to locally let-bind the var to preserve it, similarly > to the occasional use of `save-match-data`. I don't think this is a problem any more. I only set Vloads_in_progress_at_error (as I've renamed it as) when there's an actual error, not the handling of a condition-case thing, or the like. > > However, signal_or_quit is supposed to be a general low-level function, > > and it doesn't seem ideal to bloat it out with special purpose tests. > Indeed, which is also why I was pointing out that the thing could be > generalized to other context information, so we don't get fixated on `load`. That wasn't quite the sense I meant it in. ;-) > > Another possible problem with this wild idea is that debuggers, or parts > > of them, might need to be autoloaded. This shouldn't be a problem with > > edebug.el, where the file would be loaded to be able to instrument a > > form, but I don't think anything's loading debug.el before it gets used. > If the let-binding that preserves the new var is performed around the > call to the debugger (rather than being performed inside the debugger > itself), we should be OK. > > I think your idea might be better than my current patch, but I doubt > > it's going to be much simpler. I've tried it, and the above problem seems definitely to make it less simple than the approach I originally took (which currently works). Maybe we should go back to my original working approach. > The thing I like is that it should be a better replacement for > `Vsignaling_function` (which is currently a very low-tech feature which > works only half the time). OK, I haven't looked at that. > >> > I think I would agree, but this would be difficult for .el[cn] files. > >> > How about giving the line number just for .el files, something like: > >> That's what I meant, yes. > > OK, I'll think about that, but after we've got the basics (see above) > > sorted out for this bug. > Yes, there's no hurry. Indeed not. The bug has just passed its 1-year anniversary. > Stefan -- Alan Mackenzie (Nuremberg, Germany).