GNU bug report logs - #76008
31.0.50; visual-wrap-prefix-mode miscalculates prefix width when scaling text

Previous Next

Package: emacs;

Reported by: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>

Date: Sun, 2 Feb 2025 12:04:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76008: closed (31.0.50; visual-wrap-prefix-mode miscalculates
 prefix width when scaling text)
Date: Tue, 04 Feb 2025 17:31:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 4 Feb 2025 09:30:29 -0800
with message-id <af427eca-23b2-c540-a00f-96a2cf56b95d <at> gmail.com>
and subject line Re: bug#76008: 31.0.50; visual-wrap-prefix-mode miscalculates prefix width when scaling text
has caused the debbugs.gnu.org bug report #76008,
regarding 31.0.50; visual-wrap-prefix-mode miscalculates prefix width when scaling text
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76008: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76008
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; visual-wrap-prefix-mode miscalculates prefix width when
 scaling text
Date: Sun, 02 Feb 2025 13:03:16 +0100
[Message part 3 (text/plain, inline)]
Heya!

Steps to reproduce from emacs -Q:

    C-x C-f repro.rst
    C-x C-+ + [+…]                  ; until e.g. "+6"
    - words
    M-x visual-wrap-prefix-mode

Expectation: no visual change.
Observation: the "- " prefix is propertized with…

    There are text properties here:
      display              (min-width ((6 . width)))
      face                 rst-block
      fontified            t
      wrap-prefix          (space :align-to (6 . width))

… which makes the text look like this:

    -     words

I believe the cause lies in visual-wrap--content-prefix; empirically the
attached patch shows good results on this reproducer, but I landed on it
more by trial-and-error than by rational analysis, so it may be
incorrect or suboptimal (e.g. there may be better text-scale or
string-width APIs to use).

Thanks for your time (& for the love & care visual-wrap has been
receiving lately).


[Message part 4 (text/x-patch, attachment)]
[Message part 5 (text/plain, inline)]
Configured using:
 'configure --prefix=/home/peniblec/apps/.emacs.2025-01-18 --with-cairo
 --with-native-compilation=no --with-sqlite3 --with-xinput2'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix
[Message part 6 (message/rfc822, inline)]
From: Jim Porter <jporterbugs <at> gmail.com>
To: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
Cc: 76008-done <at> debbugs.gnu.org
Subject: Re: bug#76008: 31.0.50; visual-wrap-prefix-mode miscalculates prefix
 width when scaling text
Date: Tue, 4 Feb 2025 09:30:29 -0800
On 2/3/2025 10:50 PM, Kévin Le Gouguec wrote:
> It does fix the reproducer, thanks!

Thanks for checking. Merged to the master branch (with an additional bit 
of cleanup for shr.el) as 68424155774. Closing this now.


This bug report was last modified 106 days ago.

Previous Next


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