Subject: bug#70784: Abolish string resizing

From: Mattias Engdegård <[email-masked]>
Date: Sun, 5 May 2024 22:24:42 +0200

5 maj 2024 kl. 20.09 skrev Stefan Monnier <[email-masked]>:

> If the warning is too annoying, we could do like I did there, i.e. only
> emit the warning when running in a non-release Emacs (i.e. when
> `emacs-version` has 2 dots), and offer a variable to control whether to
> emit the warning or not.

Thanks, I hadn't seen your work. My approach (attached) is more an instance of outsider art: I didn't know how these things are normally done and just made it up as I went.

The backtrace is included in the message here because it's kind of essential for diagnosing the warning correctly, and it uses the very compact form repurposed from the profiler for brevity and because we probably don't need more to establish the source of the problem. Your idea to stuff stack traces in a variable for later scrutiny is probably more robust.

(Prefer raising actual errors though -- some people will inevitably suppress the warning to avoid fixing the code.)