Subject: Re: bug#38143: 27.0.50; Say that before-make-frame-hook & after-make-frame-functions are not invoked for the initial frame

From: Óscar Fuentes <[email-masked]>
Date: Tue, 07 Dec 2021 00:22:50 +0100

Lars Ingebrigtsen <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes:
>
>> The new text is incorrect -- assuming that by "initial frame" the doc
>> strings mean what we usually mean by that: the first frame displayed
>> by a GUI Emacs session (see "Frame Parameters" in the user manual, and
>> cf. initial-frame-alist).
>
> OK; reverted.  Has this changed since the bug was reported?
>
>> Perhaps the bug report was using "initial frame" in another sense: to
>> allude to the frame we create in temacs, which is a terminal frame,
>> normally deleted when a GUI session starts, except in a daemon, which
>> keeps it.  But in that case, these changes will confuse the heck out
>> of the users who will read them and try to figure out how to use this
>> information.  We should in that case explain in the doc strings which
>> "initial frame" we allude to here.
>
> I think we need some input from the bug reported about what they meant
> by "initial frame" here.

I just tested with master and, indeed, the hook is executed. However, to
be effective for all invocations of make-frame the user must add the
function early enough (which means `early-init.el`.) When emacs.el is
processed it is too late as the initial frame (the frame created by
simply invoking emacs without parameters) already exists.

Maybe we could expand the docstrings of the hooks and/or make-frame to
note that you need early-init.el if you want your hooks executed when
the initial frame is created.

Otherwise, this bug can remain closed.