GNU bug report logs - #43506
26.1; line-height sometimes has no effect on the line height

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sat, 19 Sep 2020 07:22:01 UTC

Severity: normal

Tags: notabug

Found in version 26.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Markus Triska <triska <at> metalevel.at>
Cc: 43506 <at> debbugs.gnu.org
Subject: Re: bug#43506: 26.1;
 line-height sometimes has no effect on the line height
Date: Sat, 19 Sep 2020 11:45:06 +0300
tags 43506 notabug
thanks

> From: Markus Triska <triska <at> metalevel.at>
> Date: Sat, 19 Sep 2020 09:21:38 +0200
> 
>     (progn
>       (goto-char (point-max))
>       (insert "\n")
>       (insert (propertize "\n" 'line-height 3))
>       (forward-line -1)
>       (line-pixel-height))
> 
> In my case, the minibuffer then states "17". The expected result is 3,
> because documentation states:
> 
>        A newline can have a ‘line-height’ text or overlay property that
>     controls the total height of the display line ending in that newline.

That's not all the documentation says about 'line-height'.  It also
says this (in the "Line Height" node referenced from the place you
cite):

     There are several ways to explicitly specify a larger line height,
  either by specifying an absolute height for the display line, or by
  specifying vertical space.  However, no matter what you specify, the
  actual line height can never be less than the default.
  [...]
     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.

IOW, this property can only enlarge the line's height, which is
confirmed by the fact that using 300 in your example does work as
expected.

This is not a bug.  This property exists so a Lisp program could
produce higher lines than the default.

To produce lower lines, you can use a face with a low :height
attribute, and arrange for the newline to have that face.  You can
find an example of doing that in log-edit.el.

> If possible, could you please make line-height control the total height
> of the display line also in the original example, or alternatively
> consider changing the documentation to mention all relevant exceptions?

The documentation already mentions the limitations, see above.




This bug report was last modified 159 days ago.

Previous Next


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