From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: What is a default font? Date: Sat, 07 Dec 2019 12:24:57 +0200 Message-ID: <834kycfn5y.fsf@gnu.org> References: <4c86b07f-175d-f6cf-171a-b58474ab717a@gmx.at> <83tv6ghxxk.fsf@gnu.org> <36fc3581-f8b9-cfbb-7455-eaccf9fe3c4a@gmx.at> <83y2vqhcnp.fsf@gnu.org> <0fb8540a-5edd-53ee-a02f-51960af2821b@gmx.at> <83v9quhahx.fsf@gnu.org> <2e7821ab-0ebc-fe80-8faa-faebf36dec82@gmx.at> <83tv6eh9fv.fsf@gnu.org> <835zith4eo.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="120096"; mail-complaints-to="usenet@blaine.gmane.org" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 07 11:25:53 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idXHd-000V2I-JD for ged-emacs-devel@m.gmane.org; Sat, 07 Dec 2019 11:25:53 +0100 Original-Received: from localhost ([::1]:49292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idXHc-0003RO-Ff for ged-emacs-devel@m.gmane.org; Sat, 07 Dec 2019 05:25:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35256) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idXGx-0003RF-JD for emacs-devel@gnu.org; Sat, 07 Dec 2019 05:25:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idXGw-0007tN-QO; Sat, 07 Dec 2019 05:25:10 -0500 Original-Received: from [176.228.60.248] (port=2790 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1idXGv-0000Cv-Qh; Sat, 07 Dec 2019 05:25:10 -0500 In-reply-to: (message from martin rudalics on Sat, 7 Dec 2019 10:39:00 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243212 Archived-At: > Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org > From: martin rudalics > Date: Sat, 7 Dec 2019 10:39:00 +0100 > > >> (not (string-equal (frame-parameter frame 'font) default-font))) > >> (aref (font-info default-font frame) 3)) > > > > Not sure I get the logic here: you use default-font if the frame's > > font is NOT the default-font? > > I simply reused the specification from 'default-font-height' here with > FRAME specifying some frame, not necessarily the selected one. > > ;; Avoid calling font-info if the frame's default font was > ;; not changed since the frame was created. That's because > ;; font-info is expensive for some fonts, see bug #14838. > (not (string= (frame-parameter nil 'font) default-font))) > (aref (font-info default-font) 3)) Please also "reuse" the comment there. Assuming the function you are working on is likely to be used frequently and from places that need to work fast, that is, since this is just an optimization. > > The commentary at the beginning of xfaces.c says: > > > > There is also a global face alist `Vface_new_frame_defaults'. Face > > definitions from this list are used to initialize faces of newly > > created frames. > > > > If this is unclear, please ask more specific questions. > > This variable has 258 x 21 elements all of them unspecified starting > like this here: Right, that's what happens by default. > So the specific question I ask is whether it makes sense to maintain > such a large variable that apparently never provides anything useful. It does provide some useful things: . It provides the list of faces to be created for each new frame. . If any Lisp calls internal-set-lisp-face-attribute with the 4th argument t, the corresponding attribute will be set in this list, thus providing a non-unspecified value for new frames.