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: Sun, 03 May 2020 18:08:34 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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.



reply via email to

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