emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: INSIDE_EMACS and Tramp


From: Michael Albinus
Subject: Re: INSIDE_EMACS and Tramp
Date: Mon, 04 May 2020 09:08:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

Hi Stefan,

>> This is the scenario indeed. But what happens now, w/o the patch:
>
> w/o which patch?

The patch I have shown two days ago and you have commented (Message-ID
<address@hidden>).

>> - 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?).

I'm mistaken. The packages use indeed process-environment for this setting.

> 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.

No, Tramp adds the following code snippet to inside-emacs-functions:

  (when (file-remote-p default-directory) "tramp:2.5.0-pre"))

The substring about Tramp appears only when it is needed.

>         Stefan

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]