[Top][All Lists]

[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 20:54:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Cc: Jonas Bernoulli <jonas@bernoul.li>,  stefankangas@gmail.com,
>>   emacs-devel@gnu.org,  rms@gnu.org
>> Date: Sun, 03 Sep 2023 16:36:17 +0200
>> >> - 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).
> So we are talking about EDITOR settings missing from the shell init
> files?
> (I believe "M-x shell" does read the shell's init file, doesn't it?)

Not really I guess.  I don't know how to set EDITOR correctly to do the

   - 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

I am not an expert of with-editor but it is one that it does well.
Manuel Giraud

reply via email to

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