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

From: "Feng Shu" <[email-masked]>
Date: Mon, 15 Nov 2021 06:37:23 +0800

Eli Zaretskii <[email-masked]> writes:

>> From: "Feng Shu" <[email-masked]>
>> Date: Sun, 14 Nov 2021 07:28:46 +0800
>> 
>> I have try the below code, and it work
>>  
>>    (insert (propertize "\n" 'line-height 1.4))
>>  
>> But how to apply line-height global and let line-height work with
>> mode/header/tab-bar?  
>> 
>> Maybe we should add a variable or frame parameter: line-height
>
> Adding a variable is easy, but what would be its semantics?  Emacs can
> display different faces in the same window, and some of those faces
> can have smaller height.  If the line of text in a window uses the
> smaller faces, that line's height will be smaller as well.
>
> For example, evaluate the following:
>
>   (defface small
>     '((t :height 0.6))
>     "")
>
> Then visit some file, and do this:
>
>   M-x font-lock-mode RET
>   M-x load-library RET facemenu RET
>   C-SPC
>   C-n
>   C-n
>   M-x facemenu-set-face RET small RET
>
> Now you should see 2 lines in a smaller font; those lines have
> correspondingly smaller height.

I think user should set to (t . RATIO) instead in most case.

Maybe line-height can be a alist ((face1 . RATIO) (face2 .RATIO)).

  ‘(FACE . RATIO)’
     If the height spec is a cons of the format shown, the numeric
     height is RATIO times the height of face FACE.  RATIO can be any
     type of number, or ‘nil’ which means a ratio of 1.  If FACE is ‘t’,
     it refers to the current face.

>
> So if we require all the lines to be at least line-height pixels,
> those smaller lines will also become higher, and that is not what's
> expected, I guess?

If user set line-height to a INTEGER with a variable, I think it
is user expected.

>
> So what would be the correct interpretation of the line-height
> variable or frame parameter, when different faces are being used?

--