GNU bug report logs - #65015
29.1; align-to on wrapped line regression

Previous Next

Package: emacs;

Reported by: Axel Forsman <axelsfor <at> gmail.com>

Date: Wed, 2 Aug 2023 13:23:01 UTC

Severity: normal

Tags: notabug, wontfix

Merged with 65018, 65019, 65020, 65021, 66167

Found in version 29.1

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: Axel Forsman <axelsfor <at> gmail.com>
Cc: 65015 <at> debbugs.gnu.org
Subject: bug#65015: 29.1; align-to on wrapped line regression
Date: Wed, 02 Aug 2023 17:40:13 +0300
> From: Axel Forsman <axelsfor <at> gmail.com>
> Date: Wed, 2 Aug 2023 15:22:35 +0200
> 
> I noticed that the interpretation of the hpos given to the :align-to
> space specification property changed in Emacs 29.1 compared to 28.2,
> without it being documented anywhere. In version 28 it counts relative
> to the visual start of the line, whereas in version 29 it starts at the
> logical start of the line.
> 
> That is, the following MWE exhibits different visual behavior in Emacs
> 28 contra 29:
> 
>     (insert
>      (concat
>       "\n"
>       (make-string (round (* 1.25 (window-text-width))) ?x)
>       (propertize " " 'display `(space :align-to ,(round
> (window-text-width) 2)))
>       "foo\n\n"))
> 
> (In 28 the text "foo" is centered correctly by the space. In 29 the
> space has zero-width and no effect.)
> 
> The previous behavior makes more sense in the context of section 41.16.3
> Pixel Specification for Spaces in the Emacs manual, and it would be
> quite the breaking change so I am hoping it was unintentional.

It was intentional, since :align-to counts columns, and columns in
Emacs continue being counted in continuation lines, they don't start
from zero again at the point where the line wraps.  Cf current-column
and move-to-column.  What you seem to expect would make it impossible
to wrap lines with :align-to space display specs without losing the
alignment when the line wraps.

So this change fixed a bug, and it is therefore here to stay.  That is
also the reason why it is not in NEWS: we don't include bug fixes
there.




This bug report was last modified 1 year and 298 days ago.

Previous Next


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