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#61962: 30.0.50; New trouble with symbols with positions Date: Mon, 6 Mar 2023 13:22:31 +0000 Message-ID: References: <87o7p8v6ak.fsf@web.de> <83ilfga322.fsf@gnu.org> <877cvvqj5v.fsf@web.de> <877cvv0yv7.fsf@web.de> 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="39911"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= , Eli Zaretskii , 61962@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 06 14:23:33 2023 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 1pZAoO-000ACQ-Tg for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Mar 2023 14:23:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZAnx-0002nd-HV; Mon, 06 Mar 2023 08:23: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 1pZAnu-0002jl-N3 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZAnu-0005le-96 for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZAnu-0005oZ-4R for bug-gnu-emacs@gnu.org; Mon, 06 Mar 2023 08:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Mar 2023 13:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61962 X-GNU-PR-Package: emacs Original-Received: via spool by 61962-submit@debbugs.gnu.org id=B61962.167810896022303 (code B ref 61962); Mon, 06 Mar 2023 13:23:02 +0000 Original-Received: (at 61962) by debbugs.gnu.org; 6 Mar 2023 13:22:40 +0000 Original-Received: from localhost ([127.0.0.1]:41684 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZAnX-0005nf-Vs for submit@debbugs.gnu.org; Mon, 06 Mar 2023 08:22:40 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]:46013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZAnW-0005nQ-FE for 61962@debbugs.gnu.org; Mon, 06 Mar 2023 08:22:39 -0500 Original-Received: (qmail 51013 invoked by uid 3782); 6 Mar 2023 14:22:32 +0100 Original-Received: from acm.muc.de (pd953adf5.dip0.t-ipconnect.de [217.83.173.245]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 06 Mar 2023 14:22:32 +0100 Original-Received: (qmail 7980 invoked by uid 1000); 6 Mar 2023 13:22:31 -0000 Content-Disposition: inline In-Reply-To: <877cvv0yv7.fsf@web.de> 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:257391 Archived-At: Hello, Michael. On Sun, Mar 05, 2023 at 20:41:48 +0100, Michael Heerdegen wrote: > Alan Mackenzie writes: > > I disagree with your concept here. Warning positions are not accurate > > or inaccurate (they cannot be +- 2%, for example), they are either > > correct or they are wrong. A lot of effort was put into making them > > correct, although it is clear from this bug that that project is as yet > > incomplete. > This was not intended to sound like it did to you. I see the > exact compiler warning positions as a big improvement. Sorry, I overreacted there. > > Please don't revert that commit from 2023-02-17. I will look into > > this and try to fix the bug properly. > I wanted to spare others from seeing these hard to interpret errors > this commit introduces. Anyway, take your time, a few days won't hurt. I think I now understand what's going on. It's all to do with stripping symbol positions in eval-and-compile forms. Before the patch of ~two weeks ago, the positions were stripped in e-and-c. After the patch, they weren't stripped. I think the correct thing to do is to strip the symbol positions in the `eval' part of eval-and-compile, but leave them alone in the `compile' part. This is actually quite tricky, since byte-run-strip-symbol-positions works destructively. So I need to copy the code first, and there is no suitable function to do this. copy-tree is close, but can't handle circular lists. So I will have to write a safe version of copy tree. In the mean time, could you try out the following patch which uses copy-tree as a first approximation. I think it fixes the problem, apart from the above. Thanks! diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 6f3d7a70903..30f58eeb731 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -533,7 +533,9 @@ byte-compile-initial-macro-environment (macroexpand--all-toplevel form macroexpand-all-environment))) - (eval expanded lexical-binding) + (eval (byte-run-strip-symbol-positions + (copy-tree expanded)) + lexical-binding) expanded))))) (with-suppressed-warnings . ,(lambda (warnings &rest body) > Michael. -- Alan Mackenzie (Nuremberg, Germany).