[Top][All Lists]

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

Re: What is a default font?

From: martin rudalics
Subject: Re: What is a default font?
Date: Thu, 5 Dec 2019 08:50:46 +0100

> Indeed, FWIW I've been bitten by this recently, too, and have been
> meaning to submit the patch attached, although now seeing this
> discussion, more clarification (and from a more knowledgeable person)
> might be needed. I simply corrected what seemed to be obvious errors,
> but maybe it can at least serve as another evidence of the confusion.

I think I got the idea now.  Many parts of the display engine don't
care about reality - this is one of them.  You have only to trick her
into believing that an arbitrary buffer is displayed in the selected
window of the selected frame and she will start to work on it.  So

(let ((buffer (current-buffer)))
  (with-selected-window window
    (with-current-buffer buffer

should get her telling us the default font, including remapping, for
the current buffer if it were displayed in WINDOW.  If WINDOW doesn't
exist yet, some workaround could be used to pass 'face-font' a t FRAME

But the innards of 'face-font' are, in fact, irrelevant: This function
just takes whatever has been set up by the caller, regardless of
whether the current buffer is shown in the selected window or not.
The problem is, that this concept contrasts with that of other Emacs
functions that require, for example, that a buffer is really a
window's buffer in order to work correctly.

And it strikes back when the display engine shows her innards, for
example, when she temporarily selects a window for drawing its mode
line and the user has no idea what the "really selected window" is.


reply via email to

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