Subject: bug#68793: 29.2; Visual line mode line spacing text property

From: Eli Zaretskii <[email-masked]>
Date: Mon, 29 Jan 2024 14:30:16 +0200

tags 68793 notabug
thanks

> From: Psionic K <[email-masked]>
> Date: Mon, 29 Jan 2024 15:23:33 +0900
> 
> In visual line mode, setting `line-spacing' and `line-height' text
> property on whole lines only correctly displays lines terminating in a
> newline
> 
> Steps to reproduce:
> 
> 1. open a buffer in fundamental mode
> 2. M-x visual line mode
> 3. Write a bunch of text with no newlines
> 4. Evaluate (add-text-properties (mark) (point) '(line-spacing 2.0))
> 5. Press RET somewhere in the paragraph or at the end
> 
> Observe that only the line that terminates in newline respects the
> property and that this does not respect user intent with
> visual-line-mode.

This is the documented behavior.  From the ELisp manual:

     Finally, a newline can have a ‘line-spacing’ text or overlay property
  that can enlarge the default frame line spacing and the buffer local
  ‘line-spacing’ variable: if its value is larger than the buffer or frame
  defaults, that larger value is used instead, for the display line ending
  in that newline                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ^^^^^^^^^^^^^^^

Note the part I underlined.  Only the last display line
(a.k.a. "screen line") preceding the newline is affected.  The same
happens without visual-line-mode, btw: only the last continuation line
has the line-spacing applied to it.

This is not a bug, surprising as it might be.