From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 15 14:08:18 2021 Received: (at submit) by debbugs.gnu.org; 15 Sep 2021 18:08:18 +0000 Received: from localhost ([127.0.0.1]:53187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQZKU-0005wt-H1 for submit@debbugs.gnu.org; Wed, 15 Sep 2021 14:08:18 -0400 Received: from lists.gnu.org ([209.51.188.17]:34298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQZKQ-0005wi-16 for submit@debbugs.gnu.org; Wed, 15 Sep 2021 14:08:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQZKP-0001ur-S8 for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 14:08:13 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:46022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mQZKO-0001I8-34 for bug-gnu-emacs@gnu.org; Wed, 15 Sep 2021 14:08:13 -0400 Received: by mail-wm1-x32e.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so2661478wms.4 for ; Wed, 15 Sep 2021 11:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=/8Ie6moEuQGZrGdPXK4jXttX+pFQycrtan92ZXT4s8s=; b=e7QvKLAmgwpEJy6DlkX84o/MCpsXCd86xCCkNgowVIl0KF8S2MPooIOgmHTDuypc+G n+D0rvDGaN5jbtyrXzr1SXuI9sehmXuZOORudU402T5BKi+1wpK1ycDbzrE6HTke4w/z kAN2LnnPw0SjrZlY04Ztc4p5oryaw460XYeSdbx6gD686R5UtPMmAx4rYR1nCOmUButl QpZtRPa9eYHWnoa7qBL+SruVsGiR2pPU4Q1LIW5gKTLgO/OuiUKTtMx5mRb3qOm846kZ WhcXsCjK+lvvvBDTctFgLdXYnKviodS0prTXCiQOxXcoa69vwN3iPWvlnr5qbRDTaoUM 5L0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=/8Ie6moEuQGZrGdPXK4jXttX+pFQycrtan92ZXT4s8s=; b=XK+0+klSbJGIPQF1ARnUcbJQQNU2281+Tzcw1kEjVbudRTD684NHHkIsjAvgp4VL+D GpV+6hMvK29aSinEptUSeG3riLKLxRS0DSIaoUztXLzp/7U1HR2UECb374jb1CMKrW5H vCGgIT8/iBiz41Qu1UFMT6vb/UNnMnF6MB5HL8QM7SGEs+yX+VMrnnsGHuqf1dBz/Vzr oiCG+WoUCdS1T0THcFQ2ngQpJtIh1JUqa4Wup/RFuKg0iZoTpo+2Wtt67hEvJFXTOV0t BliR/8wBatPgi2/ut2mKotUiDkP67VjR60xdzLWMTKr06Ws7u2JstyFA/UTEGXBOe9tb u4Mg== X-Gm-Message-State: AOAM533NjExxI/QOAoDB/ezwU/JnkmPV8mwYdjj9UAzop5M4F6oVGUBX sNo89/poaEOiJj8wHxIDoAMLP0hCjyc= X-Google-Smtp-Source: ABdhPJxgLSe3WhWM/t8RPTtUbTWAky/3DdnqLH2lGM7g8xTAcWYeDb6AOhI3XleS5D//toUgZ++G6w== X-Received: by 2002:a05:600c:3203:: with SMTP id r3mr5868478wmp.175.1631729289809; Wed, 15 Sep 2021 11:08:09 -0700 (PDT) Received: from ars3 ([2a02:8109:8ac0:56d0::3c3e]) by smtp.gmail.com with ESMTPSA id e2sm737541wra.40.2021.09.15.11.08.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Sep 2021 11:08:09 -0700 (PDT) From: Augusto Stoffel To: bug-gnu-emacs@gnu.org Subject: 28.0.50; 'M-x compile' misbehaves if 'process-environment' is buffer-local Date: Wed, 15 Sep 2021 20:08:07 +0200 Message-ID: <87h7el4sqg.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=arstoffel@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain This has already been discussed on email-devel but didn't come to a conclusion. I don't want to linger on it, but I would like the problem to get assigned a bug number, so it has a chance of being addressed in the future. A summary of the problem: suppose buffer A has a buffer-local value of 'process-environment' containing an extra directory in the PATH, and that a given 'program' is only available on that directory. Then 'M-x compile RET program RET' will not find 'program', because the *compilation* buffer will not "inherit" the PATH from A. For the reasons why one would want/need such a setup, see https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg01380.html and other messages in that thread. Finally, I attach my proposed patch. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Make-compile-respect-buffer-local-process-environmen.patch >From a104e1eae100f01585587df30f49866f3b038785 Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 29 Apr 2021 12:45:04 +0200 Subject: [PATCH] Make 'compile' respect buffer-local process environment * lisp/progmodes/compile.el (compilation-start): Use `process-environment' from original buffer in the compilation process. --- lisp/progmodes/compile.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index af7b8292b7..bdf20a3f51 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1783,6 +1783,8 @@ compilation-start (replace-regexp-in-string "-mode\\'" "" (symbol-name mode)))) (thisdir default-directory) (thisenv compilation-environment) + (bufferpath (when (local-variable-p 'exec-path) exec-path)) + (bufferenv (when (local-variable-p 'process-environment) process-environment)) outwin outbuf) (with-current-buffer (setq outbuf @@ -1850,6 +1852,12 @@ compilation-start ;; NB: must be done after (funcall mode) as that resets local variables (setq-local compilation-directory thisdir) (setq-local compilation-environment thisenv) + (if bufferpath + (setq-local exec-path bufferpath) + (kill-local-variable 'exec-path)) + (if bufferenv + (setq-local process-environment bufferenv) + (kill-local-variable 'process-environment)) (if highlight-regexp (setq-local compilation-highlight-regexp highlight-regexp)) (if (or compilation-auto-jump-to-first-error -- 2.31.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 16 10:07:03 2021 Received: (at 50607) by debbugs.gnu.org; 16 Sep 2021 14:07:03 +0000 Received: from localhost ([127.0.0.1]:56140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQs2Z-0005bi-Bi for submit@debbugs.gnu.org; Thu, 16 Sep 2021 10:07:03 -0400 Received: from quimby.gnus.org ([95.216.78.240]:36944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQs2X-0005bB-1R for 50607@debbugs.gnu.org; Thu, 16 Sep 2021 10:07:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=IxvK8KhKBAB1EO5Coeynhh7ynk1d88MbV6akdCbBxmA=; b=nkuqoQ1XiudO9QN9m8jEWxa4sU /QeMdzvcLrxcw4F9RKukYqHGYb6mCAxWQ9sO98lcDyLgH3IegZjsf+lSJanc4yQalrtOS6d6IyNNG XjD7JA73Fc8eBAlX7pTNq1XgsVMJgdJWkDhmIFGbacfAD3vDLlJwA+LrZiOo5WXnBAzM=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQs2P-0005IK-6N; Thu, 16 Sep 2021 16:06:55 +0200 From: Lars Ingebrigtsen To: Augusto Stoffel Subject: Re: bug#50607: 28.0.50; 'M-x compile' misbehaves if 'process-environment' is buffer-local References: <87h7el4sqg.fsf@gmail.com> Date: Thu, 16 Sep 2021 16:06:52 +0200 In-Reply-To: <87h7el4sqg.fsf@gmail.com> (Augusto Stoffel's message of "Wed, 15 Sep 2021 20:08:07 +0200") Message-ID: <877dfg1uo3.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Augusto Stoffel writes: > Finally, I attach my proposed patch. Makes sense to me, so I've pushed this to Emacs 28 (with some minor stylistic changes). Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50607 Cc: 50607@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Augusto Stoffel writes: > Finally, I attach my proposed patch. Makes sense to me, so I've pushed this to Emacs 28 (with some minor stylistic changes). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 16 10:07:08 2021 Received: (at control) by debbugs.gnu.org; 16 Sep 2021 14:07:08 +0000 Received: from localhost ([127.0.0.1]:56143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQs2e-0005c1-Hp for submit@debbugs.gnu.org; Thu, 16 Sep 2021 10:07:08 -0400 Received: from quimby.gnus.org ([95.216.78.240]:36960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQs2c-0005bJ-HY for control@debbugs.gnu.org; Thu, 16 Sep 2021 10:07:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=djKoCJyJvHV4N3Y+oajdyBzJtKzCRg7kwx92HDpn9aY=; b=DSCmRPVkgQSW5JFq5NcLBUmCdP sLPNTQmwHOlFqpV8RXT4LrPeif78mJGQ5h8g/e0xJYWNd+B5GhLxkoMxCGUy0vaQKTGTjhMUC201A /EdUtHS3abcsZYScXcsUtKWPLESVm4Fu6V+BQqlrg9tiC4qTNfr/WE6OhH4f18Z//n3o=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQs2V-0005IU-24 for control@debbugs.gnu.org; Thu, 16 Sep 2021 16:07:01 +0200 Date: Thu, 16 Sep 2021 16:06:58 +0200 Message-Id: <875yv01unx.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #50607 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 50607 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 50607 28.1 quit From unknown Sun Jun 15 01:08:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 15 Oct 2021 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator