From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Can emacsclient send environment variables even if it doesn't create a frame? Date: Sat, 01 Apr 2023 18:40:31 +0300 Message-ID: <83mt3ry5jk.fsf@gnu.org> References: <83bkkb7e6s.fsf@gnu.org> <83ttxzyafp.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Yoichi Nakayama Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 01 17:41:28 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pidM8-000AVQ-If for ged-emacs-devel@m.gmane-mx.org; Sat, 01 Apr 2023 17:41:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pidLD-0002UM-9Q; Sat, 01 Apr 2023 11:40:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pidL2-0002QA-FJ for emacs-devel@gnu.org; Sat, 01 Apr 2023 11:40:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pidKx-00020v-Ev; Sat, 01 Apr 2023 11:40:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VdNKkPxchqP3n49/nano268SLx9AYQ1ZcHW0Sx4fteU=; b=CwFQgTuCAHUV oZA0TwWQSuryRsQEI0SAELlUTlKi4JmmWlus2Mxl+e1ryeTcSz4uwKWLMDzI/pjZiUP5nK8sbhpEx bUxQR0KVH1gyBRzIA0jY8e8ZQAaAXXgUR971OI43M973x58Q4Oz2BrFUrmaLxIL0qzTiVZdxSVa48 IZ2dHhkjw2sWlgOOXufScoN7yDctfxsauJpWG3jEZtE7EK2cxZrUp3HLfg93W7pOmMUkXeLKbBfg+ nkh5Eq6eOzonIMHmuuJmGf3TOxCI5phvvQZgycH2c8sGOnARYPRa5HKu+jJZjouA02C/2VBqoGPez 1ZIYBWEZHzpRp6MDYTZsLQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pidKw-0006gO-N8; Sat, 01 Apr 2023 11:40:15 -0400 In-Reply-To: (message from Yoichi Nakayama on Sat, 1 Apr 2023 23:54:05 +0900) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305016 Archived-At: > From: Yoichi Nakayama > Date: Sat, 1 Apr 2023 23:54:05 +0900 > Cc: emacs-devel@gnu.org > > > That's because we currently refrain from changing the 'environment' > > frame parameter -- we tried at some point, and it caused problems we > > decided to defer to later. But it is still an option to do that at > > some point, and so I don't want to block that possibility for trhe > > benefit of this use case. > > I understand the situation. > However, I would like there to be a way to propagate the client's > environment variables without updating the frame's environment. > Because users of emacsclient don't necessarily want to affect the > entire frame. The server-buffer-clients element has a 1:1 > correspondence with clients, so I think it makes sense to always > store client information there. I find it strange that the > server-buffer-clients element doesn't have environment variables > when we don't create a frame. We could perhaps add a new feature, whereby a single environment variable, or an explicit list of several variables, are passed to the server and stored in some special variable or a property of the client process. But doing this implicitly for the entire environment is dangerous, unless this is per frame, because if we do this even when a new frame is not created, the environment variables of the later client will override those of the former in the 'environment' frame parameter. (Your testing indicates that it doesn't, but only because we currently put the environment into the frame's parameters when we create a frame. However, keeping the environment in the process's property and letting applications access them via the property is not something I'd like to encourage.)