GNU bug report logs - #47806
28.0.50; `make-frame` frame should probably clone the `environment` parameter into the new frame

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Thibault Polge <thibault@HIDDEN>; dated Thu, 15 Apr 2021 18:30:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 47806 <at> debbugs.gnu.org:


Received: (at 47806) by debbugs.gnu.org; 15 Apr 2021 19:54:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 15 15:54:45 2021
Received: from localhost ([127.0.0.1]:39300 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lX84a-0004cE-Ql
	for submit <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:54:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60960)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1lX84V-0004bq-No
 for 47806 <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:54:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:43513)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1lX84P-00014c-TI; Thu, 15 Apr 2021 15:54:33 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2712
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1lX84P-0000Xh-8r; Thu, 15 Apr 2021 15:54:33 -0400
Date: Thu, 15 Apr 2021 22:54:27 +0300
Message-Id: <835z0nxr0s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Thibault Polge <thibault@HIDDEN>
In-Reply-To: <877dl3ib4a.fsf@HIDDEN> (message from Thibault Polge on Thu, 15
 Apr 2021 21:47:01 +0200)
Subject: Re: bug#47806: 28.0.50; `make-frame` frame should probably clone
 the `environment` parameter into the new frame
References: <87k0p39zbo.fsf@HIDDEN> <838s5jxt55.fsf@HIDDEN>
 <877dl3ib4a.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 47806
Cc: 47806 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> From: Thibault Polge <thibault@HIDDEN>
> Cc: 47806 <at> debbugs.gnu.org
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47806; Package emacs. Full text available.

Message received at 47806 <at> debbugs.gnu.org:


Received: (at 47806) by debbugs.gnu.org; 15 Apr 2021 19:47:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 15 15:47:11 2021
Received: from localhost ([127.0.0.1]:39293 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lX7xG-00046M-VB
	for submit <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:47:11 -0400
Received: from 1.mo69.mail-out.ovh.net ([178.33.251.173]:33091)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thibault@HIDDEN>) id 1lX7xE-00043L-KV
 for 47806 <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:47:10 -0400
Received: from player762.ha.ovh.net (unknown [10.110.115.215])
 by mo69.mail-out.ovh.net (Postfix) with ESMTP id CDCDFB5654
 for <47806 <at> debbugs.gnu.org>; Thu, 15 Apr 2021 21:47:06 +0200 (CEST)
Received: from thb.lt (lfbn-idf3-1-671-78.w86-252.abo.wanadoo.fr
 [86.252.240.78]) (Authenticated sender: thibault@HIDDEN)
 by player762.ha.ovh.net (Postfix) with ESMTPSA id 91CF21D25B027;
 Thu, 15 Apr 2021 19:47:04 +0000 (UTC)
Authentication-Results: garm.ovh; auth=pass
 (GARM-100R003deab95d1-b974-4494-a81a-fc8f4991014c,
 8127DD0FE29B0B358ABE5681D102921DC21EF8EB) smtp.auth=thibault@HIDDEN
X-OVh-ClientIp: 86.252.240.78
From: Thibault Polge <thibault@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#47806: 28.0.50; `make-frame` frame should probably clone
 the `environment` parameter into the new frame
In-Reply-To: <838s5jxt55.fsf@HIDDEN>
References: <87k0p39zbo.fsf@HIDDEN> <838s5jxt55.fsf@HIDDEN>
Date: Thu, 15 Apr 2021 21:47:01 +0200
Message-ID: <877dl3ib4a.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Ovh-Tracer-Id: 10969079845033658803
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: -100
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedgudegiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpefvhhhisggruhhlthcurfholhhgvgcuoehthhhisggruhhlthesthhhsgdrlhhtqeenucggtffrrghtthgvrhhnpeefudduvddvudduuddvvdejfefhlefguedtvdfgjefhgeetieehhfeigfevffdvffenucfkpheptddrtddrtddrtddpkeeirddvhedvrddvgedtrdejkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdqohhuthdphhgvlhhopehplhgrhigvrhejiedvrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepthhhihgsrghulhhtsehthhgsrdhlthdprhgtphhtthhopeegjeektdeiseguvggssghughhsrdhgnhhurdhorhhg
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 47806
Cc: 47806 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> 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`).

> 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.  I'm not
too clear on the various execution contexts of Emacs Lisp, but couldn't
something similar to:

(when (called-interactively-p) ; I assume this implies there's a frame
                               ; this is being called "from".
  (set-frame-property TARGET 'environment
                      (frame-property SOURCE 'environment')))

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. If my understanding is correct,
it makes sense that further frames share these values, even when not
created directly from `emacsclient`.

Best regards,
Thibault




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47806; Package emacs. Full text available.

Message received at 47806 <at> debbugs.gnu.org:


Received: (at 47806) by debbugs.gnu.org; 15 Apr 2021 19:09:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 15 15:09:02 2021
Received: from localhost ([127.0.0.1]:39243 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lX7ML-0001Nn-SV
	for submit <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:09:02 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49710)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1lX7MJ-0001NW-Si
 for 47806 <at> debbugs.gnu.org; Thu, 15 Apr 2021 15:09:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42840)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <eliz@HIDDEN>)
 id 1lX7MB-0000Ye-GV; Thu, 15 Apr 2021 15:08:52 -0400
Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3862
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1lX7M6-0008EP-SY; Thu, 15 Apr 2021 15:08:49 -0400
Date: Thu, 15 Apr 2021 22:08:38 +0300
Message-Id: <838s5jxt55.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Thibault Polge <thibault@HIDDEN>
In-Reply-To: <87k0p39zbo.fsf@HIDDEN> (message from Thibault Polge on Thu, 15
 Apr 2021 20:28:59 +0200)
Subject: Re: bug#47806: 28.0.50;
 `make-frame` frame should probably clone the `environment` parameter
 into the new frame
References: <87k0p39zbo.fsf@HIDDEN>
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 47806
Cc: 47806 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> From: Thibault Polge <thibault@HIDDEN>
> Date: Thu, 15 Apr 2021 20:28:59 +0200
> 
> Frames created by `emacsclient` get a copy of the caller's environment
> variables in the `environment` frame property.  But frames created from
> other frames (with C-x 5 2, `make-frame`, `make-frame-command`, and so
> on) don't get a copy of those variables (they don't have an
> `environment` frame parameter at all). I believe they should.

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?

> My use case is talking to the WM, and without this parameter I believe
> it's impossible to distinguish between, eg, frames managed by different
> X servers on the same daemon.

Doesn't the 'display' parameter fit the bill?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#47806; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 Apr 2021 18:29:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 15 14:29:14 2021
Received: from localhost ([127.0.0.1]:39168 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1lX6jp-0000Lo-6e
	for submit <at> debbugs.gnu.org; Thu, 15 Apr 2021 14:29:14 -0400
Received: from lists.gnu.org ([209.51.188.17]:54912)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <thibault@HIDDEN>) id 1lX6jn-0000Lg-Fg
 for submit <at> debbugs.gnu.org; Thu, 15 Apr 2021 14:29:12 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51778)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <thibault@HIDDEN>) id 1lX6jn-0003hR-6b
 for bug-gnu-emacs@HIDDEN; Thu, 15 Apr 2021 14:29:11 -0400
Received: from 4.mo3.mail-out.ovh.net ([178.33.46.10]:33289)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <thibault@HIDDEN>) id 1lX6jk-0003Gl-CP
 for bug-gnu-emacs@HIDDEN; Thu, 15 Apr 2021 14:29:10 -0400
Received: from player798.ha.ovh.net (unknown [10.108.20.204])
 by mo3.mail-out.ovh.net (Postfix) with ESMTP id 19035285850
 for <bug-gnu-emacs@HIDDEN>; Thu, 15 Apr 2021 20:29:02 +0200 (CEST)
Received: from thb.lt (lfbn-idf3-1-671-78.w86-252.abo.wanadoo.fr
 [86.252.240.78]) (Authenticated sender: thibault@HIDDEN)
 by player798.ha.ovh.net (Postfix) with ESMTPSA id 6C1771D3D887D
 for <bug-gnu-emacs@HIDDEN>; Thu, 15 Apr 2021 18:29:02 +0000 (UTC)
Authentication-Results: garm.ovh; auth=pass
 (GARM-105G00653afe0c4-7495-49d7-a23e-37d811962108,
 8127DD0FE29B0B358ABE5681D102921DC21EF8EB) smtp.auth=thibault@HIDDEN
X-OVh-ClientIp: 86.252.240.78
From: Thibault Polge <thibault@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; `make-frame` frame should probably clone the `environment`
 parameter into the new frame
Date: Thu, 15 Apr 2021 20:28:59 +0200
Message-ID: <87k0p39zbo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Ovh-Tracer-Id: 9650651051786488075
X-VR-SPAMSTATE: OK
X-VR-SPAMSCORE: 0
X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedgudeftdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvufffkfggtgesthdtredttddttdenucfhrhhomhepvfhhihgsrghulhhtucfrohhlghgvuceothhhihgsrghulhhtsehthhgsrdhltheqnecuggftrfgrthhtvghrnhepieekgfeuvdehkeegjefgffekiefgffekhfetvdejjedvhfejueetleehvedvhfeunecukfhppedtrddtrddtrddtpdekiedrvdehvddrvdegtddrjeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjeelkedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehthhhisggruhhlthesthhhsgdrlhhtpdhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrgh
Received-SPF: pass client-ip=178.33.46.10; envelope-from=thibault@HIDDEN;
 helo=4.mo3.mail-out.ovh.net
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hello,

Frames created by `emacsclient` get a copy of the caller's environment
variables in the `environment` frame property.  But frames created from
other frames (with C-x 5 2, `make-frame`, `make-frame-command`, and so
on) don't get a copy of those variables (they don't have an
`environment` frame parameter at all). I believe they should.

My use case is talking to the WM, and without this parameter I believe
it's impossible to distinguish between, eg, frames managed by different
X servers on the same daemon.

FWIW, I'm running Emacs from revision
738266240dc1a19911770bf676330aa72352da79 (from April 6th) built with the
Lucid toolkit.

Best regards,
Thibault




Acknowledgement sent to Thibault Polge <thibault@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#47806; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 15 Apr 2021 20:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.