From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Merenne Newsgroups: gmane.emacs.bugs Subject: bug#52178: 29.0.50; process-environment not used in async-shell-command Date: Sun, 16 Jan 2022 10:51:58 +0000 Message-ID: References: <8735nf3zvf.fsf@workstation.lan> <87zgpnxc17.fsf@gnus.org> <87zgnxtae0.fsf@gnus.org> <87bl0c65ld.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12744"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52178@debbugs.gnu.org, Lars Ingebrigtsen To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 16 11:53:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1n939r-00037g-2F for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 11:53:11 +0100 Original-Received: from localhost ([::1]:50898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n939p-0008AU-Re for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 05:53:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n939i-00089s-Hc for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:53:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n939i-0007V2-7y for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n939i-0005Lj-7r for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Damien Merenne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jan 2022 10:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 52178-submit@debbugs.gnu.org id=B52178.164233033620491 (code B ref 52178); Sun, 16 Jan 2022 10:53:02 +0000 Original-Received: (at 52178) by debbugs.gnu.org; 16 Jan 2022 10:52:16 +0000 Original-Received: from localhost ([127.0.0.1]:42573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n938x-0005KR-Ik for submit@debbugs.gnu.org; Sun, 16 Jan 2022 05:52:15 -0500 Original-Received: from mail-yb1-f178.google.com ([209.85.219.178]:44005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n938w-0005KE-Pv for 52178@debbugs.gnu.org; Sun, 16 Jan 2022 05:52:15 -0500 Original-Received: by mail-yb1-f178.google.com with SMTP id g81so37136084ybg.10 for <52178@debbugs.gnu.org>; Sun, 16 Jan 2022 02:52:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=dGtGPfUHrGUj+OkTCx9cLCw0FqWdbV/0gt1B+jeklGE=; b=6HowlF+vvPHZPZBpKC5GBETZsVhUG+1IA4lc8URHLahke80UB91r22uoUBUB+oIx85 ZuFFrsXFX4/YUb9qQSLB6y7lreEwk9pTDbznVbTDxuscsgAeiGk7PJ1sV0El+SDh3wo5 1BLsi1JzXTymhAdSfoANAfxM0kbiSQvLcH4av2ASaf/bpjeAye2yFIOLyZx2GmsMVMBl EnRU9Z/NGA/TbKXwsH2duPTIH6RlANq2HLKB4UjNt5++vuVPiq8nRO8U0XYN2u1sHiVf QZXQQjWPGAWMERkxhfSk0Ia+HVP1ZlrP3XwJ4Pc9o7wnAeJcV2WTjUxA4/nwFUnsC8DO JRRA== X-Gm-Message-State: AOAM531UZn41RmCsV4tFatu6NdSJQB4aGRxatgjlVoHaFg/dZ9fLvL7O 2SZ8xAA1//izpZI9gQMjkuvKSmZAnaYxjI/cVFg= X-Google-Smtp-Source: ABdhPJw/TUD0OyhqXRekTNeV0COJbcdVGKZaZiTKaGkTDQkX9Bcw4hIxiOhZg4kPwstXZA4+513zpeM2IBJ+KdCa6QQ= X-Received: by 2002:a05:6902:1145:: with SMTP id p5mr7492639ybu.332.1642330329312; Sun, 16 Jan 2022 02:52:09 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224377 Archived-At: But still, the envrc use case for making process-environment buffer local for some buffer is still valid and I think the original problem should be fixed. --=20 Damien MERENNE Le dim. 16 janv. 2022 =C3=A0 10:49, Damien Merenne a =C3= =A9crit : > > Thanks for the reminder and the pointer to the watcher! I finally > found that it happens due to the `envrc` package. > That package is meant to set `process-environment` buffer local for > some buffers. Somehow it sets > process-environment globally local but only when emacs is started as a > daemon from the systemd unit. Running > it normally or with --fg-daemon from a terminal does not set the > variable globally local. I'll check with the envrc > maintainer why that would be but there is still something strange > going on, I would not expect Emacs behaviour to > change when started in systemd. > > For people stumbling upon this, here is the code I used to pinpoint the p= roblem: > ``` > (defvar pltraces (list (cons "early-init.el" (local-variable-p > 'process-environment)))) > (add-hook 'after-load-functions > (lambda (fn) > (setq pltraces (cons (cons fn (local-variable-p > 'process-environment)) pltraces)))) > (add-variable-watcher 'process-environment > (lambda (symbol newval operation where) > (when where > (setq pltraces (cons (cons (buffer-name > where) (local-variable-p 'process-environment)) pltraces))))) > ``` > It records the place where the variable is set and its local status in > the `pltraces` variable. > > -- > Damien MERENNE > > Le sam. 15 janv. 2022 =C3=A0 21:39, Michael Heerdegen > a =C3=A9crit : > > > > Lars Ingebrigtsen writes: > > > > > Damien Merenne writes: > > > > > > > I'll try to find what's triggering it but its not obvious. > > > > > > Did you make any progress here? > > > > Damien, maybe using a variable watcher: > > > > (info "(elisp) Watching Variables") > > > > could help to understand what's going on? They are able to notice > > changes in buffer-localness. > > > > Michael.