GNU bug report logs - #51821
29.0.50; Suggest add variable or frame parameter: line-height

Previous Next

Package: emacs;

Reported by: "Feng Shu" <tumashu <at> 163.com>

Date: Sat, 13 Nov 2021 23:30:03 UTC

Severity: wishlist

Found in version 29.0.50

Full log


View this message in rfc822 format

From: "Feng Shu" <tumashu <at> 163.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 51821 <at> debbugs.gnu.org
Subject: bug#51821: 29.0.50; Suggest add variable or frame parameter: line-height
Date: Mon, 15 Nov 2021 06:37:23 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: "Feng Shu" <tumashu <at> 163.com>
>> 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?

-- 





This bug report was last modified 3 years and 207 days ago.

Previous Next


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