From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: INSIDE_EMACS and Tramp Date: Sun, 03 May 2020 16:54:48 -0400 Message-ID: References: <20200402230535.10490.95720@vcs0.savannah.gnu.org> <20200402230536.E0A3F20CDD@vcs0.savannah.gnu.org> <87lfndarwh.fsf_-_@gmx.de> <87blo78exg.fsf@gmx.de> <871rp357s1.fsf@gmail.com> <87lfmzg3ds.fsf@gmx.de> <87a7397tqz.fsf@gmail.com> <87o8r6wfni.fsf@gmx.de> <87k11txkox.fsf@gmx.de> <874ksxf1bx.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="30949"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Federico Tedin To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 03 22:55:22 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jVLdy-0007xB-Su for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 22:55:22 +0200 Original-Received: from localhost ([::1]:41348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVLdx-0007Bx-VM for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 16:55:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVLdV-0006k1-DG for emacs-devel@gnu.org; Sun, 03 May 2020 16:54:53 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:18825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVLdT-0000TU-Q1 for emacs-devel@gnu.org; Sun, 03 May 2020 16:54:52 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C075180EC0; Sun, 3 May 2020 16:54:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6D602809E9; Sun, 3 May 2020 16:54:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1588539289; bh=8In5cvj907UEBGTs77+k1YT2ZfOMs73nmyIoU4jJ8WA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WtmSa/xmyQ3Xy2EddwXuuK6Av30sxfwadQMkNi/6qhxE/F+5tHc16Xnax7Iq054rJ Vm2lwgh5xkMmsq2xQdAVKGkk88tIQDxNVP7qWKcV/LwoMRFLO+ybrAfNrdJYR4u+q/ eaHvgkLkHbl9RdvnVGuE84wCiCz8uLni45WuZQaqNqFmlm2GQZU7rAJ0kzAcrF3X1S FRisi6/1Kwc1zNDRdc4HmtKhKrgrbUQ1j0PM9OyHYQOaXdHt05B4enXvUs5UHh1LHu YyMUs+6w3/zhFmOH3JvqloZWZczQwBsDaVRR0jPr4E1c1sjNCWr8WR8Ux0H718eRxc HAwya0/Ptnrvg== Original-Received: from alfajor (unknown [216.154.3.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E24C31205E1; Sun, 3 May 2020 16:54:48 -0400 (EDT) In-Reply-To: <874ksxf1bx.fsf@gmx.de> (Michael Albinus's message of "Sun, 03 May 2020 18:08:34 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/03 16:39:48 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248742 Archived-At: >> In the original situation, IIUC what happens that Eshell sets up >> INSIDE_EMACS with ",eshell" then creates the process, which gets >> delegated to Tramp, at which point Tramp would add ",tramp" to >> INSIDE_EMACS so we'd get what we need. > This is the scenario indeed. But what happens now, w/o the patch: w/o which patch? > - start-file-process (for example) is called. > > - Tramp is invoked. It starts a remote shell, passing " > "INSIDE=EMACS=28.0.50,tramp:2.5.0-pre". > > - The command given by start-file-process is executed, including > "INSIDE_EMACS=28.0.50,foo" (for example). I'm not sure I understand. Do you mean to say that the code which calls `start-file-process` runs a command of the form /usr/bin/env "INSIDE_EMACS=28.0.50,foo" CMD [ or something morally equivalent ] ? If so indeed my approach won't work, but is there a good reason why the caller would want to do that instead of binding process-environment around the call to `start-file-process` (IOW, could we simply say that if the caller does that, they get what they deserve?). The problem with your approach is that it means calling `start-process` from within a Tramp directory could launch a process with INSIDE_EMACS that contains ",tramp" even tho the process is running locally. Stefan