From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30419: tramp-sh-process-file: effect of tramp-remote-process-environment vs non-top level value of process-environment Date: Sun, 11 Feb 2018 09:28:09 -0500 Message-ID: <876073bnye.fsf@users.sourceforge.net> References: <87d11cb7ig.fsf@users.sourceforge.net> <877erjj298.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1518359262 13615 195.159.176.226 (11 Feb 2018 14:27:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Feb 2018 14:27:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 30419@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 11 15:27:37 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eksb8-000256-NC for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 15:27:18 +0100 Original-Received: from localhost ([::1]:44397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eksd8-0003Bd-P7 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Feb 2018 09:29:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ekscs-00039M-Tf for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 09:29:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ekscp-0003mq-2I for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 09:29:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eksco-0003md-Sp for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 09:29:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eksco-0006d6-H0 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2018 09:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Feb 2018 14:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30419 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30419-submit@debbugs.gnu.org id=B30419.151835930125435 (code B ref 30419); Sun, 11 Feb 2018 14:29:02 +0000 Original-Received: (at 30419) by debbugs.gnu.org; 11 Feb 2018 14:28:21 +0000 Original-Received: from localhost ([127.0.0.1]:37692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eksc8-0006c6-Tz for submit@debbugs.gnu.org; Sun, 11 Feb 2018 09:28:21 -0500 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:51561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eksc6-0006bn-MP; Sun, 11 Feb 2018 09:28:19 -0500 Original-Received: by mail-it0-f44.google.com with SMTP id 193so922594iti.1; Sun, 11 Feb 2018 06:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jRBo20d0ZndNHTvZiTF4c3ys3pqfyZiaMK5IBke7bF8=; b=kz3F5bLxJIdZB3NAXkILlWsviOYsFelS7rsaDCCPWPCb4f2SBJ5hyKLzesgfz+ef7k xmx9oZbt+zGAsJRjvEDRSi2lXAIXICtUdPjgYTQGyQhpW/IcwMtNHe7La/jjh9L08mw9 yB2ydzrduAtCYkEcdUeJs3ngpS5L3g1qlZqYtrKErbk4Xx5CifQmMDZL3G6A5qilIGXa 2S2bdQWdhFkFqsUS8dY/XGSdNaymHKnXb5UfY4eMTfgHAlZEWvDe3JuAfUqoD3etdmNc a6ImZM1YUx5j4pwVr4JMScYMUIz0WYduX39MBbUwEPf8tufVMLnp1XT/BEWhjpk2FhXA Mi5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jRBo20d0ZndNHTvZiTF4c3ys3pqfyZiaMK5IBke7bF8=; b=anYeISp93ANJ6T5LHQBSII+ykPLoTEXH/SDQ8EvtVyyb5FeymLqbNTl1aB64Y1ApM9 F+6KK/Ek8kB5U17XaFU41p/9VK+tBoOJtnfQ0VGJLCCQ9eOtXitehsQ/Tl3LO+K49ngJ E2AiQWL46OFcIIrSkIzpuKKuG/4EpVllqqQekXb4lbUezW2Bf+E6p4pP3C4b6Vwf56Ji 8xm1hWPnz3C8LVTHOPggFr9uAqzsEbrx9UAS+0ZKyOrw3jIpqdsu7IM+DJPiqNNxC9sj WKxzmEeHZbkQJ8401jejy1QtIMHLHvoPUsO3wq0oAXtfD9B+pPNJ4hWifI1xMNA2O8N9 ZToQ== X-Gm-Message-State: APf1xPAQbWjZ5kmfgBHVIzHY3WQj15pvkcX1WWiRxwvntzvEQVjfoF1w k749NYiD9Ejd9foZpPN7Wl2dxQ== X-Google-Smtp-Source: AH8x227dJCgoiIWC0KJXqPi1U6n7tzuJsgmxo/cu4VoRBr52vb9fU88FXJVQLCdLxkT+FQoqNZR55g== X-Received: by 10.36.128.212 with SMTP id g203mr1890181itd.80.1518359292675; Sun, 11 Feb 2018 06:28:12 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e18sm4156995itc.4.2018.02.11.06.28.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Feb 2018 06:28:10 -0800 (PST) In-Reply-To: <877erjj298.fsf@gmx.de> (Michael Albinus's message of "Sun, 11 Feb 2018 10:37:23 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143135 Archived-At: --=-=-= Content-Type: text/plain tags 30419 + patch quit Michael Albinus writes: > `tramp-remote-process-environment' is still in play. The let-bound > environment variables from `process-environment' are taken additionally, > and afterwards. So they would have precedence. > > See bug#18940. The major reasoning is, that other packages do not want > to preload Tramp in order to set `tramp-remote-process-environment', > even if Tramp isn't used ever. Thanks, I propose the following patch to the manual to clarify this: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Clarify-TRAMP-process-environment-interaction-Bug.patch Content-Description: patch >From 9cafeec6027947e28e3f54ffc7f975a4845227de Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 11 Feb 2018 09:20:29 -0500 Subject: [PATCH v1] Clarify TRAMP process-environment interaction (Bug#30419) * doc/misc/tramp.texi (Remote processes): Index the tramp-remote-process-environment description. Clarify the effects of let-binding process-environment and the motivation for that behavior. --- doc/misc/tramp.texi | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 25ae8ae3e8..4723547419 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2596,6 +2596,7 @@ Remote processes @end group @end lisp +@vindex tramp-remote-process-environment Customize user option @option{tramp-remote-process-environment} to suit the remote program's environment for the remote host. @option{tramp-remote-process-environment} is a list of strings @@ -2641,11 +2642,13 @@ Remote processes @end group @end lisp -@value{tramp} does not use the defaults specified in -@code{process-environment} for running @code{process-file} or -@code{start-file-process} on remote hosts. When values from -@code{process-environment} are needed for remote processes, then set -them as follows: +In addition to @option{tramp-remote-process-environment}, you can set +environment variables for invidivual remote process calls by +let-binding @code{process-environment}. @value{tramp} will apply any +entries which are not present in the global default value of +@code{process-environment} (overriding +@option{tramp-remote-process-environment} settings, if they conflict). +For example: @lisp @group @@ -2654,8 +2657,10 @@ Remote processes @end group @end lisp -This works only for environment variables not already set in the -@code{process-environment}. +Let-binding in this way works regardless of whether the process to be +called is local or remote, since @value{tramp} would add just the +@code{HGPLAIN} setting and local processes would take whole value of +@code{process-environment} along with the new value of @code{HGPLAIN}. For integrating other Emacs packages so @value{tramp} can execute remotely, please file a bug report. @xref{Bug Reports}. -- 2.11.0 --=-=-=--