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: Manuel Giraud
Subject: Re: Adding with-editor to Emacs?
Date: Mon, 04 Sep 2023 14:44:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Cc: jonas@bernoul.li,  stefankangas@gmail.com,  emacs-devel@gnu.org,
>>   rms@gnu.org
>> Date: Mon, 04 Sep 2023 10:21:15 +0200
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> [...]
>> 
>> >> Not really I guess.  I don't know how to set EDITOR correctly to do the
>> >> following:
>> >> 
>> >>    - M-x shell
>> >>    - ssh remote-server
>> >>    - su -l
>> >>    - vipw  --> open a new buffer in *this* Emacs
>> >> 
>> >> But, I could do this with with-editor and eshell (maybe it could work
>> >> for M-x shell also, I don't know) as follow:
>> >> 
>> >>    - C-x C-f /ssh:remote-server|su::
>> >>    - M-x eshell
>> >>    - vipw  --> and here it works, opening an Emacs buffer through
>> >>                emacsclient so I could edit and C-c C-c when done
>> >
>> > You've lost me here.  You assume I know what with-editor does?
>> 
>> Ok, I might be lost also (as I said I'm not an expert of everything
>> with-editor does).  I'll try to rephrase.  with-editor is able to
>> correctly set EDITOR to have any shell command that need editing appear
>> into an Emacs buffer locally.  Such command might be over a ssh session
>> or into a sudo for instance.
>
> And it provides a separate value for EDITOR to each one of these
> cases?

This I'm not sure.  I have tested on two different machines and on a
local "doas" and echo $EDITOR always returns this:

sh -c 'printf "\nWITH-EDITOR: $$ OPEN $0\037$1\037 IN $(pwd)\n"; sleep 604800 & 
sleep=$!; trap "kill $sleep; exit 0" USR1; trap "kill $sleep; exit 1" USR2; 
wait $sleep'

So it seems there is some shell hackery going on.
-- 
Manuel Giraud



reply via email to

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