Subject: Re: bug#51821: 29.0.50; Suggest add variable or frame parameter: line-height

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 15 Nov 2021 06:39:15 +0100

Eli Zaretskii <[email-masked]> writes:

>> I think...  a natural interpretation would be that explicit :height
>> specs would override the line-height variable/parameter?
>
> But line-height is not a variable or parameter, it is just a text
> property, and it needs to be put on a newline to change the height of
> that single line.  So currently this is up to the Lisp program: if it
> puts this property on some line, the visual results is its
> responsibility.

I was talking about the line-height variable only here, not the text
property.

> By contrast, a buffer-local variable or a frame parameter are global:
> they apply to all lines, tall and small alike.  And users will use
> this variable/parameter globally as well.  Thus its effect on lines
> that use smaller fonts is something to be concerned about.
>
> My impression is that this is wanted only for the default face, and
> then only for the ASCII font of that face.  That could be done, I
> think, but (a) it will probably not work with text-scaling and other
> remappings of the default faces, and (b) some faces other than default
> also need this, definitely the mode-line and header-line, but also
> fixed-pitch perhaps?
>
> So I'm stuck trying to figure out what exactly are the requirements
> here.

It has to work across different fonts -- I think that's the real use
case here, that if you're missing different fonts (which you commonly
are when writing with different scripts), then the Emacs display gets
pretty messy (uneven line heights all over the place).

So here's how I think the `line-height' variable should work:

* After redisplay has composed a line, it should check whether the line
height is less than `line-height', and if so, add empty space at the
bottom (or the top, or perhaps both, to center it).

** But -- if the line is composed purely of text with a face with an
   explicit :height property, it should do nothing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no