From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: INSIDE_EMACS and Tramp Date: Sun, 03 May 2020 18:08:34 +0200 Message-ID: <874ksxf1bx.fsf@gmx.de> 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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="23977"; 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: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 03 18:11:37 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 1jVHDL-00067N-6o for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 18:11:35 +0200 Original-Received: from localhost ([::1]:35480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVHDK-0004XU-23 for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 12:11:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVHAX-0002Ty-VV for emacs-devel@gnu.org; Sun, 03 May 2020 12:08:41 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:43911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVHAW-0006uJ-Ku for emacs-devel@gnu.org; Sun, 03 May 2020 12:08:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1588522115; bh=1+TboIpXJ6o5nvFwTGp6L/C1meIUPVu0JuAhpFZ+YuQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=AG+tRpz7R2W4PWUy1TW8Et5Z1tR/fKy7s18dxesHsLWtWvJmm/bt550VLQxUVNmCD Ud3CKYu1I6HSQwk7dIF4dy7UI56s7Tr0LHcfkmx9NlVVIPNfjqafDdJnrc2t+MjcvW ydEsUAhbu2qtUyU/OA0T/JS6dW1sxhoqEswHfxTI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.86.51.88]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MjS5A-1ikLm52nrW-00kyfz; Sun, 03 May 2020 18:08:35 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 03 May 2020 10:51:16 -0400") X-Provags-ID: V03:K1:81+YIlwOtTa4qo0c6PDIBZjv3P7X7r9rz+mwYcnbnTLpKwzMIlB 95ahr0VTKJ+kUN9m/1YGWkeaKl+ams28XRQycz5jvfEuCnFgNeLdroRTdVLnsXi/z4um/GP 0C6d6pSnUABvwe5JVdYILW2obdjyftDOVfrNHOxddWvc32KA6khfX+B+BCO6SVqqhl9Bf66 8ozGgIAEZSS5/sVFZSxXQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:M02J3iOwT7Y=:zAkjAlySNr+L1vbbT0M+ji zglF1w7HIYk867A2K+7yKmlYoV5PmBa/R9wrpbvHhRaN6fIrehBsQ5EBnw1F8hS4vCJc5FBCG qOi+K6NY3iSo/Lk1VH7cuxgeARaSMSwJxKm+/c8h1Hm1CElctpY/CvqD8skcyyotvRhD0axhV S1UzGS87M6fmoJKX2d6aUs1Jp9i+3w16XuKf2s1TsEus2/KEkP/ZUdB24gZXOkFQJzBYxr3St WV6AhGgF0BioSFE+HYHtKGaILhLapUxxXf6f/afs0E/QJt0OCzyjZ6LVyvdDv65hihHXTT6Vj iNoS1/FJqISe071GDgBKYg2hK+RtvzIkr1c52kp/ZkK5HPq/3x9jf4R6/LnbUZTYrB1QNaJG+ zXlyoHmvx4UbSUROUkRIqFkjlXQ/54aSmP7bvpCoj5tLUbxEADANri5Eck+oTTztq2z3bmLjG CrNaOzj3X43SIwUJSRUHYbyN8YhcNUxeZ2sQAOJ5iOLYKFm+LQ8vgiSGb932kFNCOth/jue1G OtWmRxry5QX/ahWhIqFmdzqMAq8gkR4Pzy2VM2aEO6rw3gUacf63hJHxYTKnmIaj5ENptEow3 RU9qP6EUnf+1Cw1xjErJFmh19KhjFpI7qeZiqiDHYMDgg16oxEredBYW/6IENSNMPAGJpwvYn 2dvfL1VaHhsUQkQCGu3s4xpUWwMa9DxMG6wzDIjxKHbWXoVSDJ2uM2rQH2s4O3ViWNAYfI2NB D9CTGjQVD4RBDIytS/67FgUNNrIpl24WiwEqNUamb0hqUEejZDfXAhFRdiVQEFtFfWk+k+BP Received-SPF: pass client-ip=212.227.15.19; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/03 12:08:38 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:248708 Archived-At: Stefan Monnier writes: Hi Stefan, > I don't understand this example: why should `inside-emacs` return > something related to Tramp just because default-directory happens to > currently point to a Tramp directory? > > `inside-emacs` is only of interest when creating a subprocess, and if > that subprocess is created on a remote machine, Tramp will get a change > to add ",tramp" to it when it gets called by the > file-name-handler mechanism. This is a shortened example for discussion; in reality we're speaking about processes of course. > 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: - 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). Whatever Tramp does, it is overwritten. This is the reason I have proposed this mechanism. Calling '(inside-emacs "foo")' returns in the remote case "28.0.50,foo,tramp:2.5.0-pre", as requested. > Stefan Best regards, Michael.