Subject: bug#79083: 31.0.50; Inconsistencies wrt fixed-pitch face

From: Sean Whitton <[email-masked]>
Date: Wed, 23 Jul 2025 15:27:14 +0100

X-debbugs-cc: [email-masked], [email-masked], [email-masked], [email-masked]

Hello,

There are a couple of related issues I would like to resolve with the
fixed-pitch face.

(1)
I had assumed that the purpose of this face was solely to be fixed pitch
even when the default face uses a variable pitch font.  A Lisp program
could use this face when something really must display as fixed pitch.

But in [1] Eli writes:
> Did you expect the fixed-pitch face to have the same font as the
> default face?  If so, it's a wrong expectation: we deliberately
> defined the fixed-pitch face to have a different typeface, so that it
> stands out.

This is not incompatible with being a face that's always fixed pitch no
matter whether the default face is fixed pitch, but it does mean that
themes, or the user, shouldn't usually customise default and fixed-pitch
to use the same typeface.  If this is the idea, then it should be
documented, and I would propose to do so as follows:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/faces.el b/lisp/faces.el
index cf81013118b..ad5b467b9e2 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2463,7 +2463,11 @@ underline
 
 (defface fixed-pitch
   '((t :family "Monospace"))
-  "The basic fixed-pitch face."
+  "The basic fixed-pitch face.
+This face is intended to be visually distinct from the `default' face on
+graphical frames, even when the `default' face also uses a fixed-pitch
+typeface.  In practice this means that this face should always use a
+different typeface to the `default' face's typeface."
   :group 'basic-faces)
 
 (defface fixed-pitch-serif
--8<---------------cut here---------------end--------------->8---

(2)
The faces are not in fact visually distinct by default on GNU/Linux,
though they are on the non-free macOS and MS-Windows platforms.  This
should be fixed.  I am not sure where to look in the code base, though
-- the different typefaces for default and fixed-pitch on MS-Windows,
for example, aren't defined in faces.el, but presumably somewhere in C.
Could I have a hint?

[1]  https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00396.html

-- 
Sean Whitton