From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Environment variables for remote processes (was: bug#18940: 24.4; vc-hg does not disable pager, leading to hangs (at least with tramp)) Date: Mon, 17 Nov 2014 19:48:02 +0100 Message-ID: <87h9xxvf31.fsf_-_@gmx.de> References: <030C5AEB-C009-4995-B153-6EECD44802C8@fb.com> <87y4rkhdt6.fsf@gmx.de> <87y4rf2jtx.fsf@gmx.de> <87r3x6eq8w.fsf@gmx.de> <87mw7rtnxg.fsf@gmx.de> <83a93rduz4.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416250139 32553 80.91.229.3 (17 Nov 2014 18:48:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Nov 2014 18:48:59 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org, dpittman@fb.com To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 17 19:48:51 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XqRLz-0004HX-2x for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 19:48:47 +0100 Original-Received: from localhost ([::1]:49697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqRLy-0001BQ-P5 for ged-emacs-devel@m.gmane.org; Mon, 17 Nov 2014 13:48:46 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41354) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqRLY-0000yJ-Ok for emacs-devel@gnu.org; Mon, 17 Nov 2014 13:48:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XqRLS-0007yS-PP for emacs-devel@gnu.org; Mon, 17 Nov 2014 13:48:20 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:57539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XqRLS-0007xb-Fd; Mon, 17 Nov 2014 13:48:14 -0500 Original-Received: from detlef.gmx.de ([87.146.53.41]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0M08ia-1Y71I1182u-00uMjZ; Mon, 17 Nov 2014 19:48:05 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 16 Nov 2014 16:08:47 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:nQZhqGeosXTra5QwNf1/nK87Cz58sGNTnWojGtmRoUE6MnhIrrj kSrJeplB1otuOfX+RZIGJUkbuvergdc6lrAB0iUzAqe1kqYqiAlJ4Zd9YiezD3IVQ4WenAP R7hU3z0GtjbGstlgg0zGNfndx0kj8Tgu3XJvuok9yCBOanSFnx5GO42nYfyY+uNUlUKe93g G5GexKxBfZjdvP+b+I/Sw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177470 Archived-At: Stefan Monnier writes: >> Maybe I'm missing something, but what's wrong with let-binding >> process-environment? > > Nothing wrong with it. The problem is that Tramp ignores those > let-bindings because it fails to propagate this environment to its > remote sub-processed. The problem is, that not all settings of process-environment might be desired on remote hosts. process-environment keeps *local* variables. Furthermore, some remote settings might be requested which are not in process-environment by default. A user shall not be responsible for those settings; that's why there is tramp-remote-process-environment. But this is also not satisfactory, because there might be even different settings required for different hosts. > `tramp-sh-handle-process-file' really needs to compare > process-environment with (default-toplevel-value 'process-environment) > to infer the env-vars that have been added via let-binding and then > propagate those to the remote sub-process. tramp-sh-handle-process-file does not start a new process, it reuses the existing one. The propagation to the remote sub-process must ensure, that those settings are not permanent. Via a subshell, or alike. It's not that easy as it looks at first glance. That's why I would like a kind of design, before starting to implement. > Stefan Best regards, Michael.