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: Tue, 12 Nov 2024 14:53:56 +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="38387"; 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 Tue Nov 12 15:55:47 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 1tAsJ1-0009nz-0r for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Nov 2024 15:55:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAsIL-0005ru-3h; Tue, 12 Nov 2024 09:55: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 1tAsII-0005pQ-2Q for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2024 09:55:02 -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 1tAsIH-0002Hr-Pa for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2024 09:55:01 -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=xAPFCEC9VJXkOQubz0EVXc6MQlu7kUQ+eZ+zBIrkglY=; b=RusCb0TqTQUVgQxMKKq5Vi3n9GQHtLUfZQdbNtxkgPieD9KsDZpuPqT57iByGK/yAtP39EY+AKr2a5vwYcekC0YDZt8/+hAQiGb/zZT55YMpcB7EWVTea0XlVesqZqsvKlEttYOlkwMghNlpTkeJNmfnueW9kVbRrS5nyC5VZsEa87GSmhMOJgz33OJt23hIzG8cnQHaX8tFB7Jt4ClQEYusf28EWa6qHR/o5n5cfY4Rr5I5k9V0GvzUB3lIfMgMEEYsvqA4gxUUHCW9d1IuBK2dXhksfQniwlsei0XqfEVRXoshGfXh2bfRyBY3OSvXFkBVs9xenZJwfim8IKK8CQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tAsIH-0002x7-K8 for bug-gnu-emacs@gnu.org; Tue, 12 Nov 2024 09:55: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: Tue, 12 Nov 2024 14:55: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.173142324611269 (code B ref 66912); Tue, 12 Nov 2024 14:55:01 +0000 Original-Received: (at 66912) by debbugs.gnu.org; 12 Nov 2024 14:54:06 +0000 Original-Received: from localhost ([127.0.0.1]:33071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAsHO-0002vg-D2 for submit@debbugs.gnu.org; Tue, 12 Nov 2024 09:54:06 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:44827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAsHM-0002v9-Pj for 66912@debbugs.gnu.org; Tue, 12 Nov 2024 09:54:05 -0500 Original-Received: (qmail 36608 invoked by uid 3782); 12 Nov 2024 15:53:57 +0100 Original-Received: from muc.de (p4fe15556.dip0.t-ipconnect.de [79.225.85.86]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 12 Nov 2024 15:53:57 +0100 Original-Received: (qmail 10368 invoked by uid 1000); 12 Nov 2024 14:53:56 -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:295245 Archived-At: Hello, Stefan. On Sun, Nov 10, 2024 at 16:37:26 -0500, Stefan Monnier wrote: > >> Because of my "A => B => compile => C => D" example: the message I want > >> to have depends on the chain from the point where I catch the error > >> (i.e. the `condition-case`) to the point where the error is signaled. > >> And I don't really care about the debugger case. > > That is no explanation as to WHY you think it's the right thing. > > The point in that chain where we catch the error is an internal > > implementation detail, of no interest to the user. > Not at all. In the above example, the error message goes to the > compilation buffer, and it would be weird for that buffer to say "while > loading A while loading B" whereas the compiled code loads neither. OK, so you were using "the point in the chain where we catch the error", which is of no interest to the user, as a proxy for how and where an error message gets displayed. I thought we were agreed that the "A => B => compile => C => D" was vanishingly rare and probably doesn't occur at all in the Emacs sources. In that case, why are you giving it priority over the other concerns (such as consistency of messages displayed to the user) that I have raised? > > WHY are you so unconcerned about the debugger case? > In the debugger case, I usually have direct access to the problematic > code and usually don't care that much about the further parts of the > context explaining why that code is executed. But other users might like to see this information. I certainly would. The stack of files being loaded is likely to be of interest. Even you imply you would sometimes like to see it. Would you please clarify whether you are opposed to outputting the information (about the stack of files being loaded) in the debugger case, or are merely indifferent about it. If the former, I still don't understand why; I would still appreciate justification. > Occasionally I do, but "loading" is not special in this respect: I will > just as often be interested to know which command was used, in which > buffer, or which hook caused that code to be run. It is true that Emacs error messages are typically poor in the extreme, in that they fail to identify the pertinent command, buffer, hook, or variable. I have been trying to improve this for several years, with mixed success. The thing about loading is that it is frequently recursive, typically by the function `require'. Being told which file the failing Lisp came from is as good as saying which buffer, and likely better in batch mode. > > I think it would be consistent to display "While loading..." the same > > in both cases. > To be honest, I don't see much value in displaying "while loading" in > the echo area in general. To be frank, displaying nothing but Wrong type argument: integer-or-marker-p, nil to the user is insulting. It is nearly content-free, giving the user no clue as to where to start looking for the error. It implies that the users' time is less important than that of Emacs developers, who have failed to implement proper error handling. Informing the user which file the error occurred in, though far from ideal, is significantly better than not doing so. > I'm not opposed to it, but the only case where I know it could be > helpful is during compilation (which I'm mostly interested to see it > in the compilation buffer). In this case, the error message is indeed displayed in *Compile-Log*. > Stefan -- Alan Mackenzie (Nuremberg, Germany).