From: Manuel Giraud via "Emacs development discussions." <emacs-devel@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Jonas Bernoulli <jonas@bernoul.li>,
stefankangas@gmail.com, emacs-devel@gnu.org, rms@gnu.org
Subject: Re: Adding with-editor to Emacs?
Date: Sun, 03 Sep 2023 16:36:17 +0200 [thread overview]
Message-ID: <87zg23tjby.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <837cp9bur7.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 01 Sep 2023 21:42:20 +0300")
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
next prev parent reply other threads:[~2023-09-03 14:36 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <85msy98sni.fsf@elpa.gnu.org>
[not found] ` <E1qbslO-0006oK-RA@fencepost.gnu.org>
2023-09-01 14:38 ` Adding with-editor to Emacs? Jonas Bernoulli
2023-09-01 16:12 ` Eli Zaretskii
2023-09-01 17:25 ` Jim Porter
2023-09-01 17:44 ` Jonas Bernoulli
2023-09-01 18:42 ` Eli Zaretskii
2023-09-01 20:23 ` Jonas Bernoulli
2023-09-02 6:19 ` Eli Zaretskii
2023-09-02 18:12 ` Jonas Bernoulli
2023-09-02 18:57 ` Eli Zaretskii
2023-09-02 21:04 ` Jonas Bernoulli
2023-09-03 17:02 ` Lynn Winebarger
2023-09-03 17:21 ` Eli Zaretskii
2023-09-03 18:21 ` Lynn Winebarger
2023-09-03 18:37 ` Eli Zaretskii
2023-09-02 19:56 ` Stefan Kangas
2023-09-02 21:26 ` Jonas Bernoulli
2023-09-02 23:07 ` Stefan Kangas
2023-09-03 5:00 ` Eli Zaretskii
2023-09-02 11:39 ` Michael Albinus
2023-09-02 16:52 ` Jonas Bernoulli
2023-10-17 10:23 ` Michael Albinus
2023-10-17 17:18 ` Manuel Giraud via Emacs development discussions.
2023-10-17 18:09 ` Michael Albinus
2023-10-17 19:26 ` Manuel Giraud via Emacs development discussions.
2023-09-03 14:36 ` Manuel Giraud via Emacs development discussions. [this message]
2023-09-03 15:34 ` Eli Zaretskii
2023-09-03 18:54 ` Manuel Giraud via Emacs development discussions.
2023-09-03 19:26 ` Eli Zaretskii
2023-09-04 8:21 ` Manuel Giraud via Emacs development discussions.
2023-09-04 12:18 ` Eli Zaretskii
2023-09-04 12:44 ` Manuel Giraud via Emacs development discussions.
2023-09-04 13:18 ` Manuel Giraud via Emacs development discussions.
2023-09-06 0:59 ` Richard Stallman
2023-09-05 0:27 ` Richard Stallman
2023-09-15 21:59 ` Björn Bidar
2023-09-17 23:03 ` Richard Stallman
2023-09-18 8:59 ` Philip Kaludercic
2023-09-20 18:35 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg23tjby.fsf@ledu-giraud.fr \
--to=emacs-devel@gnu.org \
--cc=eliz@gnu.org \
--cc=jonas@bernoul.li \
--cc=manuel@ledu-giraud.fr \
--cc=rms@gnu.org \
--cc=stefankangas@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).