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: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: 76008 <at> debbugs.gnu.org
Cc: Jim Porter <jporterbugs <at> gmail.com>
Subject: bug#76008: 31.0.50; visual-wrap-prefix-mode miscalculates prefix width when scaling text
Date: Sun, 02 Feb 2025 13:03:16 +0100
[Message part 1 (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 2 (text/x-patch, attachment)]
[Message part 3 (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

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.