all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate
@ 2025-02-02 17:50 Kévin Le Gouguec
  2025-02-03 22:41 ` Jim Porter
  0 siblings, 1 reply; 4+ messages in thread
From: Kévin Le Gouguec @ 2025-02-02 17:50 UTC (permalink / raw)
  To: 76018; +Cc: Jim Porter

Heya!

To reproduce from emacs -Q:

    C-x b repro
    M-x visual-wrap-prefix-mode
    - first line of [words…]
    RET
    RET
    second line of [words…]
    C-o

Expectation: continuation lines for the "second line of [words…]" should
not have any indentation.
Observation: text on that second line has these properties:

    There are text properties here:
      fontified            t
      wrap-prefix          (space :align-to (2 . width))

(NB: "C-o" in the recipe ensures there is a character at point,
otherwise "C-u C-x =" shows nothing on account of being at EOB)

Denoting "hard spaces" (buffer text) with "·" and "visual spaces"
(visual-wrap-prefix-mode decoration) with " ", text thus wraps like
this:

    -·first·line·of·
      words·words

    second·line·of
      words·words

Not sure what the right fix is; having just learned about text property
"stickiness", I can at least work around the issue with…

    (push '(wrap-prefix . t) text-property-default-nonsticky)

… but I have not dogfooded this much yet.

Thanks for your time!


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.2) of 2025-01-18 built on amdahl30
Repository revision: 840057bb1bfc05a52519793c620d729688ea1d8f
Repository branch: master
Windowing system distributor 'SUSE LINUX', version 11.0.12401004
System Description: openSUSE Tumbleweed

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate
  2025-02-02 17:50 bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate Kévin Le Gouguec
@ 2025-02-03 22:41 ` Jim Porter
  2025-02-04  6:57   ` Kévin Le Gouguec
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Porter @ 2025-02-03 22:41 UTC (permalink / raw)
  To: Kévin Le Gouguec, 76018

On 2/2/2025 9:50 AM, Kévin Le Gouguec wrote:
> Expectation: continuation lines for the "second line of [words…]" should
> not have any indentation.
> Observation: text on that second line has these properties:
> 
>      There are text properties here:
>        fontified            t
>        wrap-prefix          (space :align-to (2 . width))

Do you know if this is a recent regression, or if it's been this way 
since visual-wrap-prefix-mode was merged into Emacs? I've made a bunch 
of changes to the mode relatively recently, but the wrap-prefix part is 
mostly the same as before, aside from some different methods to 
calculate the width.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate
  2025-02-03 22:41 ` Jim Porter
@ 2025-02-04  6:57   ` Kévin Le Gouguec
  2025-02-04 19:37     ` Kévin Le Gouguec
  0 siblings, 1 reply; 4+ messages in thread
From: Kévin Le Gouguec @ 2025-02-04  6:57 UTC (permalink / raw)
  To: Jim Porter; +Cc: 76018

Jim Porter <jporterbugs@gmail.com> writes:

> On 2/2/2025 9:50 AM, Kévin Le Gouguec wrote:
>> Expectation: continuation lines for the "second line of [words…]" should
>> not have any indentation.
>> Observation: text on that second line has these properties:
>>      There are text properties here:
>>        fontified            t
>>        wrap-prefix          (space :align-to (2 . width))
>
> Do you know if this is a recent regression, or if it's been this way since visual-wrap-prefix-mode was merged into Emacs? I've made a bunch of changes to the mode relatively recently, but the wrap-prefix part is mostly the same as before, aside from some different methods to calculate the width.

Barring methodological errors, a smoketest using adaptive-wrap (0.8)
suggests that it did not have this bug; the text properties on the
second line are:

    There are text properties here:
      fontified            t
      wrap-prefix          ""

That's all I have for now; can try to bisect later!





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate
  2025-02-04  6:57   ` Kévin Le Gouguec
@ 2025-02-04 19:37     ` Kévin Le Gouguec
  0 siblings, 0 replies; 4+ messages in thread
From: Kévin Le Gouguec @ 2025-02-04 19:37 UTC (permalink / raw)
  To: Jim Porter; +Cc: 76018

Kévin Le Gouguec <kevin.legouguec@gmail.com> writes:

> Jim Porter <jporterbugs@gmail.com> writes:
>
>> On 2/2/2025 9:50 AM, Kévin Le Gouguec wrote:
>>> Expectation: continuation lines for the "second line of [words…]" should
>>> not have any indentation.
>>> Observation: text on that second line has these properties:
>>>      There are text properties here:
>>>        fontified            t
>>>        wrap-prefix          (space :align-to (2 . width))
>>
>> Do you know if this is a recent regression, or if it's been this way since visual-wrap-prefix-mode was merged into Emacs? I've made a bunch of changes to the mode relatively recently, but the wrap-prefix part is mostly the same as before, aside from some different methods to calculate the width.
>
> Barring methodological errors, a smoketest using adaptive-wrap (0.8)
> suggests that it did not have this bug; the text properties on the
> second line are:
>
>     There are text properties here:
>       fontified            t
>       wrap-prefix          ""
>
> That's all I have for now; can try to bisect later!

After checking that 2024-01-27 "Import ELPA package adaptive-wrap as
visual-wrap" (6667d6c19c3) is "good" too, I got a bisection going -
testing each step after 'make bootstrap'.  Results:

    $ git bisect start HEAD 6667d6c19c3934871ed54d89dc153efc72f947de -- lisp/visual-wrap.el
    Bisecting: 7 revisions left to test after this (roughly 3 steps)
    [b86bc02096c65517b9a29c20635ece100864fc62] Introduce a global variant of visual-wrap-prefix-mode

    $ git bisect good
    Bisecting: 3 revisions left to test after this (roughly 2 steps)
    [55aad592e177dc2c503ebe9ad2a46e227683315e] Improve computation of indent depth in SHR and 'visual-wrap-prefix-mode'

    $ git bisect bad
    Bisecting: 1 revision left to test after this (roughly 1 step)
    [135da3556bb34bb20a01e02b30bc949c1a45b6cd] Be more careful about aligning prefix lines in 'visual-wrap-prefix-mode'

    $ git bisect bad
    Bisecting: 0 revisions left to test after this (roughly 0 steps)
    [f70a6ea0ea86ef461e40d20664a75a92d02679ea] Add support for variable-pitch fonts in 'visual-wrap-prefix-mode'

    $ git bisect bad
    f70a6ea0ea86ef461e40d20664a75a92d02679ea is the first bad commit
    commit f70a6ea0ea86ef461e40d20664a75a92d02679ea (HEAD)
    Author: Jim Porter <jporterbugs@gmail.com>
    Date:   Sat Jul 27 20:48:38 2024 -0700

        Add support for variable-pitch fonts in 'visual-wrap-prefix-mode'

        * lisp/emacs-lisp/subr-x.el (string-pixel-width): Allow passing BUFFER
        to use the face remappings from that buffer when calculating the width.

        * lisp/visual-wrap.el (visual-wrap--prefix): Rename to...
        (visual-wrap--adjust-prefix): ... this, and support PREFIX as a number.
        (visual-wrap-fill-context-prefix): Make obsolete in favor of...
        (visual-wrap--content-prefix): ... this.
        (visual-wrap-prefix-function): Extract inside of loop into...
        (visual-wrap--apply-to-line): ... this.

        * doc/lispref/display.texi (Size of Displayed Text): Update
        documentation for 'string-pixel-width'.

        * etc/NEWS: Announce this change.

     doc/lispref/display.texi  |   6 +++--
     etc/NEWS                  |  12 +++++++++
     lisp/emacs-lisp/subr-x.el |  11 +++++++--
     lisp/visual-wrap.el       | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------
     4 files changed, 102 insertions(+), 40 deletions(-)

Have not delved into the diff yet.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-04 19:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-02 17:50 bug#76018: 31.0.50; wrap-prefix properties from visual-wrap-prefix-mode proliferate Kévin Le Gouguec
2025-02-03 22:41 ` Jim Porter
2025-02-04  6:57   ` Kévin Le Gouguec
2025-02-04 19:37     ` Kévin Le Gouguec

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.