all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dima Kogan <dima@secretsauce.net>
Cc: 52905@debbugs.gnu.org
Subject: bug#52905: 29.0.50; "fixed-pitch" face doesn't respect the font in "default-frame-alist"
Date: Fri, 31 Dec 2021 09:26:44 +0200	[thread overview]
Message-ID: <83v8z5grpn.fsf@gnu.org> (raw)
In-Reply-To: <87a6ghc0ev.fsf@secretsauce.net> (message from Dima Kogan on Thu,  30 Dec 2021 12:17:44 -0800)

> From: Dima Kogan <dima@secretsauce.net>
> Date: Thu, 30 Dec 2021 12:17:44 -0800
> 
> In the last few months I've been observing some font handling updates in
> emacs that cause an inconsistency with the way things are displayed. As
> suggested by the emacs documentation, I set the font I want by touching
> default-frame-alist. The docs are here:
> 
>   https://www.gnu.org/software/emacs/manual/html_node/emacs/Fonts.html
> 
> I've had this setting in my .emacs for many years. Today this isn't
> respected everywhere. A recipe:
> 
>   emacs -Q --eval \
>   "(progn
>      (setf (alist-get 'font default-frame-alist)
>        \"-adobe-courier-medium-r-*-*-14-*-*-*-*-*-iso8859-*\")
>    (org-mode)
>    (insert \"abc\\n#+begin_\"))"
> 
> Here I start up emacs without .emacs, but with some default-frame-alist
> setting. I enter org-mode and insert some text.
> 
> Invoking C-u C-x = on any of "abc" tells me that no particular face is
> active there, and that my default font is being used.
> 
> Invoking C-u C-x = on any of "#+begin_" tells me that the org-meta-line
> face is active there. This face ultimately derives from the fixed-pitch
> face, which uses a different monospace font: ftcrhb:-Bits-Bitstream Vera
> Sans Mono-regular-normal-normal-*-14-*-*-*-m-0-iso10646-1.
> 
> But I already selected a monospaced font in default-frame-alist, so I
> expect to get the same font here, which was the case for many years. The
> fixed-pitch face is defined like this in faces.el:
> 
>   (defface fixed-pitch
>     '((t :family "Monospace"))
>     "The basic fixed-pitch face."
>     :group 'basic-faces)
> 
> I can "fix" this by resetting the fixed-pitch face to use the default:
> 
>   (defface fixed-pitch
>     '((t))
>     "The basic fixed-pitch face."
>     :group 'basic-faces)
> 
> 
> So is this a "bug"? Is this a documentation problem? Setting the default
> font to a monospace font, as described by the emacs docs should end up
> being picked up by the fixed-pitch face.

You seem to assume that the default face's font is also the font
used by the fixed-pitch face?  There's no basis for this assumption:
as long as a face defines :font or :family attributes, the font for
that face is selected independently.  The "Monospace" family
doesn't stand for "the monospace font selected fro thedefault face",
it stands for some font that belongs to the "Monospace" family.  What
exactly does that family include depends on your font back-end and the
fonts installed on your system, but Vera Sans Mono doesn't sound like
it shouldn't be in that family, it sounds right to me.

So, given the data you presented, I don't yet see any bug, but a
well-documented and expected behavior.  If you want the same font for
the fixed-pitch face, you should customize that face as well, e.g. by
using set-face-attribute, to set its font attribute, or by using
set-face-font directly.






  reply	other threads:[~2021-12-31  7:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 20:17 bug#52905: 29.0.50; "fixed-pitch" face doesn't respect the font in "default-frame-alist" Dima Kogan
2021-12-31  7:26 ` Eli Zaretskii [this message]
2021-12-31  7:34   ` Dima Kogan
2021-12-31  8:15     ` Eli Zaretskii
2021-12-31  8:24       ` Dima Kogan
2021-12-31 13:10         ` Eli Zaretskii
2022-01-01 19:07           ` Dima Kogan
2022-01-01 20:28             ` Eli Zaretskii
2022-01-01 20:32               ` Dima Kogan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83v8z5grpn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=52905@debbugs.gnu.org \
    --cc=dima@secretsauce.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.