unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
	"Eli Zaretskii" <eliz@gnu.org>,
	61962@debbugs.gnu.org
Subject: bug#61962: 30.0.50; New trouble with symbols with positions
Date: Mon, 6 Mar 2023 13:22:31 +0000	[thread overview]
Message-ID: <ZAXpFzXGj8li+53+@ACM> (raw)
In-Reply-To: <877cvv0yv7.fsf@web.de>

Hello, Michael.

On Sun, Mar 05, 2023 at 20:41:48 +0100, Michael Heerdegen wrote:
> Alan Mackenzie <acm@muc.de> 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).





  reply	other threads:[~2023-03-06 13:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04 16:18 bug#61962: 30.0.50; New trouble with symbols with positions Michael Heerdegen
2023-03-04 16:34 ` Eli Zaretskii
2023-03-04 21:39   ` Mattias Engdegård
2023-03-04 21:53     ` Michael Heerdegen
2023-03-05 16:04     ` Michael Heerdegen
2023-03-05 18:39       ` Alan Mackenzie
2023-03-05 19:41         ` Michael Heerdegen
2023-03-06 13:22           ` Alan Mackenzie [this message]
2023-03-07  0:29             ` Michael Heerdegen
2023-03-07 10:24               ` Alan Mackenzie
2023-03-07 13:13                 ` Eli Zaretskii
2023-03-07 13:51                   ` Robert Pluim
2023-03-07 15:46                     ` Alan Mackenzie
2023-03-12 17:30                       ` Mattias Engdegård
2023-03-12 20:42                         ` Alan Mackenzie
2023-03-13 14:50                           ` Eli Zaretskii
2023-03-14 12:31                           ` Mattias Engdegård
2023-03-07 15:42                   ` Alan Mackenzie
2023-03-07 15:15                 ` Michael Heerdegen
2023-03-04 16:36 ` Eli Zaretskii
2023-03-04 16:47   ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAXpFzXGj8li+53+@ACM \
    --to=acm@muc.de \
    --cc=61962@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=mattiase@acm.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).