From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?I=C3=B1igo?= Serna Newsgroups: gmane.emacs.devel Subject: Re: Some environment variables disappeared for getenv Date: Thu, 15 Sep 2022 21:17:32 +0200 Message-ID: <87k064e98c.fsf@gmx.com> References: <87pmfwhoxp.fsf@free.fr> <87czbwhimm.fsf@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8091"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.6; emacs 29.0.50 Cc: emacs-devel@gnu.org To: Julien Cubizolles Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 15 21:22:28 2022 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 1oYuRQ-0001vH-0D for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Sep 2022 21:22:28 +0200 Original-Received: from localhost ([::1]:34584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYuRN-00057x-FA for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Sep 2022 15:22:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYuQS-0004QP-J8 for emacs-devel@gnu.org; Thu, 15 Sep 2022 15:21:28 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:53029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYuQQ-00064l-PJ for emacs-devel@gnu.org; Thu, 15 Sep 2022 15:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1663269683; bh=+aEGTHE5y/1chGZvNUNuslhM2lBmN7rItJ6+AA9USVM=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:Date:In-reply-to; b=SxG7ssZ0U52NXNIXGtCzyGFk4XBpZheTspBoee3qWLxDYOoWd+g74Hc6TEqKee0yD dAkAmOPKZBAq+gQPluUSQI7OvGH06cwZ57VvhP875dXqxYOa4A6Z7nXp9HRe9f4MM9 flSUYo2j+T0sXhM+YfDcR7nUVWNTxxzKqDG8FeVU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from zeus.gmx.com ([93.176.180.142]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MkHQh-1p1KHa0xRp-00kdIq; Thu, 15 Sep 2022 21:21:23 +0200 In-reply-to: <87czbwhimm.fsf@free.fr> X-Provags-ID: V03:K1:ilMZ5w6LNZNgHgElEy+1KxRsKreVitMsSVvcdGCTLbXZRH7USc1 iyWx0nL3VPkzbfXAFtgU9GKpsZwoHOOnxB/yAI/yTXdg+VO88siU/sccdfELkjFbEpuAstf hGxljeeUCL1yk/b18UcaC2Dtk/Wa9REClaGyGyTdjGrJcyrxgbioqTYST/IsfMRK8MKN/AP MyDmqOf0EIwg4TIwEJ/qg== X-UI-Out-Filterresults: notjunk:1;V03:K0:hd4ValsOEnY=:+MI+gs3aBwnFbqDwltWnsT q2r2DEpxGSYq7wS2TIqqXVyA6JSBJofiwqBi9mvnD9DOfS07P3y+HinA3nVVyxQweemfk0SLd 0BUxez46TF2qgdvbKaM+ZJl2FVDCQ+3btDAF1F0mcPRRiJ0AHGQLqb7xGn1WDNZk8atfDEml5 41wflPjtxXZwcsQhTWtWR9GorNuq1WnfkaVGNNP1L1ioiKaUhVdreYuAU3/2Lt4ptisMiYtOB Ugu/35rhT6T6AIriQohwecgPCgFRJiO7aYrD3PCgmzSx8wUobVRgV7yP+I8ja967tIzPUu5FE +UdasYMGy28ILlyEfV5pSBbVej9EPdWBVr6BiWKs3WO+O5jNGrS4nFuCR8bufsOQ/t+1BTuSi +o3shruH6+FnXE95L17Dg9NEM3zNHauB+owbx5xrOyirQrlFra6jly9C969V5wKKRU3IIpr5K VmK6rca6BDEc92d8hpRunW6XIlVCiq0Lsjscc7MHItahMbIjOtqRmoiPE4urXZ0LLmVTy++up JunWQHKyKtUwS1RbzYv43vQ3obLK3YcoTJQXM1pr5Uh/vqap88pEP9+96LncIXeGJo2KZ76BH Z5qvd8+QgMF93t2XDZFeVw3ffV4fLi8lKw5gaKQ6EbnVJF3SILfsn0Li6OYrYVZH2gEQefiXD jUZBxCSe8TSPmY2dgxW/5BSZLX4Vv6VSmBH+Wot5HLmimkaFtjFiEP6jVKAuzJdk++HQwM4La azGLSSlKhs8QZZWIZmB+SzdUlnGs6SKMKI5MZu+VvswGWQiRqFk6Boewnmw3sW69oi1/j9m7 Received-SPF: pass client-ip=212.227.15.18; envelope-from=inigoserna@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.devel:295446 Archived-At: Hi, > [...] > It's started through a user systemd service that hasn't changed=20 > in > years. You could add more new "Enviroment" lines to your systemd unit=20 file, f.e. Environment=3DXDG_SESSION_TYPE=3Dwayland Best regards, I=C3=B1igo On 15 September 2022 at 15:28 +02, Julien Cubizolles=20 wrote: > writes: > >> On Thu, Sep 15, 2022 at 01:12:02PM +0200, Julien Cubizolles=20 >> wrote: >>> I used to rely on getenv to get the value of=20 >>> $XDG_SESSION_TYPE. I >>> noticed that recently: >>> --8<---------------cut=20 >>> here---------------start------------->8--- >>> (getenv "XDG_SESSION_TYPE") >>> --8<---------------cut=20 >>> here---------------end--------------->8--- >>> returns nil, because this variable isn't in=20 >>> process-environment >>>=20 >>> What is the reason for dropping this particular variable=C2=A0? How=20 >>> can I get >>> the value of this variable from within Emacs=C2=A0? >> >> The process that starts your Emacs has to pass it on (that's=20 >> the idea >> of environment variables). If things changed, this is where you=20 >> have >> to look. >> >> How is your Emacs started? > > It's started through a user systemd service that hasn't changed=20 > in > years. > > --8<---------------cut=20 > here---------------start------------->8--- > [Service] > Type=3Dforking > Environment=3D'XMODIFIERS=3D""' > ExecStart=3D/usr/bin/emacs --daemon > ExecStop=3D/usr/bin/emacsclient --eval "(progn (setq=20 > kill-emacs-hook daemon-kill-emacs-hook) (kill-emacs))" > Restart=3Don-failure > Environment=3D"DISPLAY=3D:%i" > TimeoutStartSec=3D0 > --8<---------------cut=20 > here---------------end--------------->8--- > > In the getenv docstring, there is a mention of variable > process-environment, containing a list of environment variables,=20 > not > refered to in the systemd service file but nonetheless=20 > accessible to > getenv (some are XDG variables like XDG_DATA_DIRS). Maybe > XDG_SESSION_TYPE has been dropped from this list=C2=A0? --=20 I=C3=B1igo Serna