all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: What is a default font?
Date: Sat, 07 Dec 2019 12:24:57 +0200	[thread overview]
Message-ID: <834kycfn5y.fsf@gnu.org> (raw)
In-Reply-To: <c1ceaa4f-0fc6-fe52-f815-6e8974d1439a@gmx.at> (message from martin rudalics on Sat, 7 Dec 2019 10:39:00 +0100)

> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> From: martin rudalics <rudalics@gmx.at>
> 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.



  reply	other threads:[~2019-12-07 10:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 18:36 What is a default font? martin rudalics
2019-12-04 16:12 ` Eli Zaretskii
2019-12-04 18:04   ` martin rudalics
2019-12-04 19:38     ` Štěpán Němec
2019-12-05  7:50       ` martin rudalics
2019-12-05 15:03       ` Eli Zaretskii
2019-12-04 21:21     ` Stefan Monnier
2019-12-05 17:54       ` martin rudalics
2019-12-05 18:04         ` Eli Zaretskii
2019-12-05 18:24           ` martin rudalics
2019-12-05 18:51             ` Eli Zaretskii
2019-12-05 18:59               ` martin rudalics
2019-12-05 19:13                 ` Eli Zaretskii
2019-12-06  8:35                   ` martin rudalics
2019-12-06 15:14                     ` Eli Zaretskii
2019-12-07  9:39                       ` martin rudalics
2019-12-07 10:24                         ` Eli Zaretskii [this message]
2019-12-06 15:45                   ` Eli Zaretskii
2019-12-07  9:39                     ` martin rudalics
2019-12-07 10:29                       ` Eli Zaretskii
2019-12-08  9:03                         ` martin rudalics
2019-12-08 15:39                           ` Eli Zaretskii

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=834kycfn5y.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /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.