* formatting buffer with external tool
@ 2022-04-12 11:45 Luca Ferrari
2022-04-12 11:53 ` Eli Zaretskii
2022-04-12 17:37 ` Marcin Borkowski
0 siblings, 2 replies; 4+ messages in thread
From: Luca Ferrari @ 2022-04-12 11:45 UTC (permalink / raw)
To: help-gnu-emacs
Hi all,
how can I define a command so that instead of calling indent-region I
pass the region content to an external program and get back the result
into the region?
Thanks,
Luca
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: formatting buffer with external tool
2022-04-12 11:45 formatting buffer with external tool Luca Ferrari
@ 2022-04-12 11:53 ` Eli Zaretskii
2022-04-12 12:01 ` Stephen Berman
2022-04-12 17:37 ` Marcin Borkowski
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-04-12 11:53 UTC (permalink / raw)
To: help-gnu-emacs
> From: Luca Ferrari <fluca1978@gmail.com>
> Date: Tue, 12 Apr 2022 13:45:03 +0200
>
> Hi all,
> how can I define a command so that instead of calling indent-region I
> pass the region content to an external program and get back the result
> into the region?
Use shell-command-on-region with 4th arg not a buffer and not nil.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: formatting buffer with external tool
2022-04-12 11:53 ` Eli Zaretskii
@ 2022-04-12 12:01 ` Stephen Berman
0 siblings, 0 replies; 4+ messages in thread
From: Stephen Berman @ 2022-04-12 12:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: help-gnu-emacs
On Tue, 12 Apr 2022 14:53:18 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Luca Ferrari <fluca1978@gmail.com>
>> Date: Tue, 12 Apr 2022 13:45:03 +0200
>>
>> Hi all,
>> how can I define a command so that instead of calling indent-region I
>> pass the region content to an external program and get back the result
>> into the region?
>
> Use shell-command-on-region with 4th arg not a buffer and not nil.
Another possibility is replace-region-contents.
Steve Berman
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: formatting buffer with external tool
2022-04-12 11:45 formatting buffer with external tool Luca Ferrari
2022-04-12 11:53 ` Eli Zaretskii
@ 2022-04-12 17:37 ` Marcin Borkowski
1 sibling, 0 replies; 4+ messages in thread
From: Marcin Borkowski @ 2022-04-12 17:37 UTC (permalink / raw)
To: Luca Ferrari; +Cc: help-gnu-emacs
On 2022-04-12, at 13:45, Luca Ferrari <fluca1978@gmail.com> wrote:
> Hi all,
> how can I define a command so that instead of calling indent-region I
> pass the region content to an external program and get back the result
> into the region?
C-u M-|
--
Marcin Borkowski
http://mbork.pl
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-12 17:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12 11:45 formatting buffer with external tool Luca Ferrari
2022-04-12 11:53 ` Eli Zaretskii
2022-04-12 12:01 ` Stephen Berman
2022-04-12 17:37 ` Marcin Borkowski
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).