[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding with-editor to Emacs?
From: |
Manuel Giraud |
Subject: |
Re: Adding with-editor to Emacs? |
Date: |
Sun, 03 Sep 2023 16:36:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Jonas Bernoulli <jonas@bernoul.li>
>> Cc: emacs-devel@gnu.org, rms@gnu.org
>> Date: Fri, 01 Sep 2023 19:44:53 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > I'm probably missing something because if all we want is to allow
>> > child processes to use the current Emacs session as their editor, we
>> > just need to inject some environment variables into
>> > process-environment when running those child processes, and start the
>> > server.
>>
>> That's the core of what with-editor does. Additionally
>>
>> - It tries hard to find the correct emacsclient to use.
>
> See below: I don't think I understand why this has to be "hard".
>
>> - 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.
>
>> - It provides some convenience functionality to use this from various
>> shells running inside Emacs.
>
> Can you provide details? The above is too terse for me to understand
> the functionality.
Just my one 2 cents datapoint:
I have this line in my init.el
(add-hook 'eshell-mode-hook 'with-editor-export-editor)
and now, I can do a standard Unix "crontab -e" or "vipw" to edit those
special files from a remote eshell (be it via sudo, ssh whatever).
--
Manuel Giraud
- Re: Adding with-editor to Emacs?, (continued)
- Re: Adding with-editor to Emacs?, Stefan Kangas, 2023/09/02
- Re: Adding with-editor to Emacs?, Jonas Bernoulli, 2023/09/03
- Re: Adding with-editor to Emacs?, Stefan Kangas, 2023/09/02
- Re: Adding with-editor to Emacs?, Eli Zaretskii, 2023/09/03
- Re: Adding with-editor to Emacs?, Michael Albinus, 2023/09/02
- Re: Adding with-editor to Emacs?, Jonas Bernoulli, 2023/09/02
- Re: Adding with-editor to Emacs?,
Manuel Giraud <=
- Re: Adding with-editor to Emacs?, Eli Zaretskii, 2023/09/03
- Re: Adding with-editor to Emacs?, Manuel Giraud, 2023/09/03
- Re: Adding with-editor to Emacs?, Eli Zaretskii, 2023/09/03
- Re: Adding with-editor to Emacs?, Manuel Giraud, 2023/09/04
- Re: Adding with-editor to Emacs?, Eli Zaretskii, 2023/09/04
- Re: Adding with-editor to Emacs?, Manuel Giraud, 2023/09/04
- Re: Adding with-editor to Emacs?, Manuel Giraud, 2023/09/04
- Re: Adding with-editor to Emacs?, Richard Stallman, 2023/09/05
- Re: Adding with-editor to Emacs?, Richard Stallman, 2023/09/04
- Re: Adding with-editor to Emacs?, Björn Bidar, 2023/09/15