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:49:18 +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="40465"; 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:50:23 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 1n9379-000ANg-Fu for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 11:50:23 +0100 Original-Received: from localhost ([::1]:50206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9376-0007WS-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 05:50:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n936o-0007Vq-FC for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n936o-0006nK-5s for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n936o-0005Go-4I for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 05:50: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:50: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.164233017720217 (code B ref 52178); Sun, 16 Jan 2022 10:50:02 +0000 Original-Received: (at 52178) by debbugs.gnu.org; 16 Jan 2022 10:49:37 +0000 Original-Received: from localhost ([127.0.0.1]:42562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n936P-0005G0-8W for submit@debbugs.gnu.org; Sun, 16 Jan 2022 05:49:37 -0500 Original-Received: from mail-yb1-f175.google.com ([209.85.219.175]:35777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n936N-0005Fl-LH for 52178@debbugs.gnu.org; Sun, 16 Jan 2022 05:49:36 -0500 Original-Received: by mail-yb1-f175.google.com with SMTP id c10so37220593ybb.2 for <52178@debbugs.gnu.org>; Sun, 16 Jan 2022 02:49:35 -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=ODYcJ4VtXAfF6c2H5kUESUN83Idsv4QxF0DvCi1zsNU=; b=1DKXXMQ+7IMabJRRM9zibFSXbYOh8l83Lo2tMAplhZW+fFM9po0ZbQzr/L9MMrJ7q2 Qk+hfdHsoBGLPghKlJ5qHS2hBbJ4CKO3kqU64/0KVG985jx4MvrdDRymNx0XMWvj6dEM NWUoyPcdEoX1kXvGDvmK8DXvbSmdvHPFbRHlaAiDneptltYrEj+rypWhQntU125XVgO9 X30KUaUTgB9i2MUV4FRtYkHVbDoqREyHSrs+p/8iz9h0iRmvAxQvItApUp55mlwldKq8 Nxbr9evU4hIq9E9HpJDy7T7sn6L3nLhWjSbX1DbqgFgYIiT0AG/NYPSSomD2cLYgH7WZ LT2Q== X-Gm-Message-State: AOAM531wYeYN95w6OEyj0wfylEsSN553ZxDTXypoE2sxgEBsTo8wQDfx hrGrQRuXmqVIxXzDMZZngHo7nKNbYK00+cNHTUw= X-Google-Smtp-Source: ABdhPJyIktH+HrHOGrrLqbIPo/7MIOmHZG+l0rbswMEHoO0e1qPWdVbuHMWgmFn8zNWtSuvt52rVu2jREjKuRBzEgXM= X-Received: by 2002:a25:3f46:: with SMTP id m67mr20165399yba.656.1642330170012; Sun, 16 Jan 2022 02:49:30 -0800 (PST) In-Reply-To: <87bl0c65ld.fsf@web.de> 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:224376 Archived-At: 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 pro= blem: ``` (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. --=20 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.