Subject: bug#74091: 31.0.50; string-pixel-width in mode line disables region

From: Eli Zaretskii <[email-masked]>
Date: Wed, 06 Nov 2024 14:49:46 +0200

> From: Eshel Yaron <[email-masked]>
> Cc: [email-masked]
> Date: Wed, 06 Nov 2024 09:01:16 +0100
> 
> FYI after spending a bit more time on this issue, I concluded that
> (kill-all-local-variables t) is inherently problematic: it breaks
> assumptions that Emacs relies on.  (See bug#73005 for another example.)
> 
> It doesn't seem like killing permanent-local variables in the work
> buffers is necessary ATM, so the fix I'm using is the following:

Can't _any_ variable become permanent-local, by virtue of some Lisp
program or the user giving it a permanent-local property?

More generally, how do we know that there are no permanent-local
variables out there that affect layout, and thus affect the results of
this function?

I believe these considerations were those which led the author to use
kill-all-local-variables like this: we want to be sure that nothing
will dupe string-pixel-width into producing unexpected results.