[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is a default font?

From: Eli Zaretskii
Subject: Re: What is a default font?
Date: Sat, 07 Dec 2019 12:29:51 +0200

> Cc: address@hidden, address@hidden
> From: martin rudalics <address@hidden>
> Date: Sat, 7 Dec 2019 10:39:51 +0100
> Thanks.  But you left the doc-string of 'face-font' alone.  That
> doc-string still says that
>    If FRAME is t, report on the defaults for face FACE (for new frames).
> which is wrong according to Stefan
>    Yes, you can, but only if you know in which frame it will be displayed
>    (or you can approximate it by using a frame "similar" to the one that
>    will be used).
> and you
>    For a frame that was not yet created there are too many unknowns
>    for face-font to be able to help you efficiently.  The best you can do
>    is assume the new frame will have the same faces as the selected one.

This is a misunderstanding.  What I meant to say was that when a new
frame is created, we usually apply frame-parameters from all kinds of
sources, and that is what I referred to as "unknowns".  barring that,
the above line is accurate, albeit you may see it as useless in your
use case.

> What I'm still unsure about is the following paragraph in the Elisp
> manual:
>       If ‘face-remapping-alist’ is buffer-local, its local value takes
>       effect only within that buffer.  If ‘face-remapping-alist’ includes
>       faces applicable only to certain windows, by using the
>       ‘(:filtered (:window PARAM VAL) SPEC)’, that face takes effect only
>       in windows that match the filter conditions (*note Special
>       Properties::).  To turn off face filtering temporarily, bind
>       ‘face-filters-always-match’ to a non-‘nil’ value, then all face
>       filters will match any window.
>  From this I'd conclude that I might have to explicitly select a
> specific window (and not just its frame) before calling any of the
> functions 'default-font-height', 'face-font', ... in order to process
> 'face-remapping-alist' correctly.  Is that conclusion correct?  If so,
> the descriptions of these functions should tell that.

It depends on what you are going to use the results of
default-font-height etc. for.  And I'd consider it a bug, or at least
a misfeature, to have the default face filtered like that anyway.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]