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

From: Jake <[email-masked]>
Date: Fri, 31 Jan 2025 11:25:50 +1030

Hi Eli

Thanks for the clarification and the code snippet.  That setting indeed
fixes the underlying motivation for this bug report: with

(setq display-line-numbers-type ‘relative)
(variable-pitch-mode 1)

and the point in the first column, the horizontal position of the point on
the screen no longer changes as point moves from one line to the next.

Thanks again.
Jake

On Wed, 22 Jan 2025 at 1:22 am, Eli Zaretskii <[email-masked]> wrote:

> > 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))
>