Subject: Re: bug#75728: Line-number face unaffected by text-scale-adjust when it inherits from fixed-pitch

From: Eli Zaretskii <[email-masked]>
Date: Tue, 21 Jan 2025 16:52:12 +0200

> From: Jake <[email-masked]>
> Date: Tue, 21 Jan 2025 14:08:56 +0000
> 
> When line-number face inherits from fixed-pitch face, it is not affected by text-scale-adjust.
> 
> The following example demonstrates how this behaviour is unique to line-number face; we observe that
> font-lock-comment-face has the expected behaviour of responding to text-scale-adjust.
> 
> emacs -Q --eval "(progn (set-face-attribute 'line-number nil :inherit 'fixed-pitch) (set-face-attribute
> 'font-lock-comment-face nil :inherit 'fixed-pitch) (display-line-numbers-mode 1))"
> M-x text-scale-adjust, or C-x C-=
> 
> Observe that the font size of the line numbers does not change, whereas the font size of
> font-lock-comment-face does.

This is actually a feature: the faces used by
display-line-numbers-mode don't automatically follow the text faces.
So if you really want that, you need to do something special with
these faces, if you want them both to inherit and to scale with the
text:

  (set-face-attribute 'line-number nil
		      :inherit '(fixed-pitch default))