GNU bug report logs - #74091
31.0.50; string-pixel-width in mode line disables region

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Tue, 29 Oct 2024 17:28:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Eshel Yaron <me <at> eshelyaron.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 74091 <at> debbugs.gnu.org
Subject: bug#74091: 31.0.50; string-pixel-width in mode line disables region
Date: Sat, 09 Nov 2024 13:13:52 +0200
> From: Eshel Yaron <me <at> eshelyaron.com>
> Cc: 74091 <at> debbugs.gnu.org
> Date: Wed, 06 Nov 2024 15:12:24 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Eshel Yaron <me <at> eshelyaron.com>
> >> Cc: 74091 <at> debbugs.gnu.org
> >> 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.
> 
> Yes, this reasoning is perfectly understandable.  However, the current
> way of killing all permanent-local variables has bad consequences that
> that author, naturally, did not expect.  So my suggestion is to avoid
> (kill-all-local-variables t) here and elsewhere.
> 
> For string-pixel-width specifically, we take care to clear variables
> that may affect width calculation.  If other variables may interfere, we
> should just clear those too.

Let's see what Stefan (CC'ed) thinks about these issues.




This bug report was last modified 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.