Subject: bug#47806: 28.0.50; `make-frame` frame should probably clone the `environment` parameter into the new frame

From: Eli Zaretskii <[email-masked]>
Date: Thu, 15 Apr 2021 22:54:27 +0300

> From: Thibault Polge <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 15 Apr 2021 21:47:01 +0200
> 
> > Doesn't the 'display' parameter fit the bill?
> 
> Not on Wayland, I'm afraid.  I believe all the XWayland instances will
> have the same value for `display`, which may be a non-usable value.  I'm
> also not sure that we can go from `display` to the Wayland server.  (As
> an example, in my case, what I actually need is `SWAYSOCK`).

Are you saying that make-frame-on-display works differently under
Wayland?

> > How do we know whether a particular frame should or shouldn't have the
> > 'environment' frame parameter?  When the frame is created by the
> > server on behalf of a client, we know.  But for a random
> > frame-creation function, how do we know?
> 
> That's a tricky question.  In my understanding, it makes sense in an
> ancestor/child relationship: if the ancestor of FRAME has some distinct
> set of environment variables, we copy them to the new frame.

What is the "ancestor frame"?  We don't have such relationships
between frames.

And if you mean the frame that was the selected on when the other
frame was created, I'm not sure I agree that this is an indication of
whether environment should be copied.

But let's hear what others think about this.

> To clarify all my assumptions, I understand that the `environment`
> property exists because frames of the same daemon or server can appear
> in very different environments, like multiple X or Wayland servers,
> terminals, remote sessions, and so on.

No, it's because starting a client frame is supposed to be similar to
starting an Emacs from the same terminal.