emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding with-editor to Emacs?


From: Michael Albinus
Subject: Re: Adding with-editor to Emacs?
Date: Tue, 17 Oct 2023 12:23:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Jonas Bernoulli <jonas@bernoul.li> writes:

Hi Jonas,

>>> - It implements a "sleeping editor".  This is a shell script, which
>>>   outputs a request on stdout and then waits to be told to return.
>>>   With-editor use a process filter too look for that output and when
>>>   it sees it, it responds in a similar fashion to server.el.  This
>>>   is useful because makes it possible to do this over Tramp.  (I
>>>   believe this could also be done using regular emacsclient+server.el,
>>>   but that is difficult to setup and a security risk if not done
>>>   correctly.
>>
>> If we want a better/safer client-server connections for remote hosts,
>> it should be handled in Tramp, I think.
>
> Probably and it would be great if Tramp did handle that, but I don't
> even use Tramp except when users report that there is an issue when
> using Tramp with one of my packages.  So I am not the right person to
> implement it there, but if Michael were to tackle this, then maybe I
> would have some insights that could be useful.  Or not.

Finally, I've found a free time slot to check with-editor. In fact,
emacsclient can also be called on a remote machine in order to reach the
local Emacs server instance. What is needed is, that emacsclient must
tell the Emacs server where it is located.

Since Emacs 26, emacsclient is prepared for this. If you call
"emacsclient --tramp=<PREFIX>", all file names on the server side,
emacsclient sends as "/path/to/file", are "<PREFIX>/path/to/file".

If you detect a remote directory in with-editor, you can add the option
(concat "--tramp=" (file-remote-p default-directory)) to the emacsclient
call, because file-remote-p returns exactly the needed prefix.

Best regards, Michael.



reply via email to

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