Subject: Re: bug#52905: 29.0.50; "fixed-pitch" face doesn't respect the font in "default-frame-alist"

From: Eli Zaretskii <[email-masked]>
Date: Fri, 31 Dec 2021 10:15:40 +0200

> From: Dima Kogan <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 30 Dec 2021 23:34:58 -0800
> 
> I just looked at version control, and the thing that actually made
> things weird in THIS case is the update to org 9.5:
> 
>   https://github.com/emacs-mirror/emacs/commit/bf9ec3d91a79414deac039f7bf83352a9b0a9a85
> 
> It made the org-meta-line face inherit from "fixed-pitch", which is
> fine.

So this is why it stopped to work for you: Org now uses a different
parent face for its faces.  This has nothing to do with how Emacs
selects fonts for faces.

> Yes. That is exactly what it's doing today. But it isn't nice. If emacs
> has a "default" font, and that font happens to be a fixed-pitch font,
> then the "fixed-pitch" face should use that default font.

I respectively disagree.  The fixed-pitch face exists to be able to
specify a different fixed-pitch font for text that needs to have a
distinctly different appearance.  It makes little sense to me to
make it use the same font as the default face.

> Otherwise, the "default" font choice is ignored in arbitrary places,
> creating a poor user experience.

Lisp programs that want to avoid that should not use a different face,
or should tell users to customize the respective faces if they want
the same font as for the default face.

> I think the ways to fix this are:

Thanks, but I don't think we should fix this.  I see no problem to
fix.  The fixed-pitch face is designed to have a distinct font.

>    Is there an easy, reliable way to tell if a given font is fixed or
>    not?

You could apply heuristics based on SPACE-WIDTH and AVERAGE-WIDTH
values returned by font-info.  But basically, I don't think you can
know for sure.