GNU bug report logs - #75728
Line-number face unaffected by text-scale-adjust when it inherits from fixed-pitch

Previous Next

Package: emacs;

Reported by: Jake <jforst.mailman <at> gmail.com>

Date: Tue, 21 Jan 2025 14:10:02 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Jake <jforst.mailman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75728 <at> debbugs.gnu.org
Subject: bug#75728: Line-number face unaffected by text-scale-adjust when it inherits from fixed-pitch
Date: Fri, 31 Jan 2025 11:25:50 +1030
[Message part 1 (text/plain, inline)]
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 <eliz <at> gnu.org> wrote:

> > From: Jake <jforst.mailman <at> gmail.com>
> > 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))
>
[Message part 2 (text/html, inline)]

This bug report was last modified 157 days ago.

Previous Next


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