nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] how should piping through an external command work?


From: Benno Schulenberg
Subject: [Nano-devel] how should piping through an external command work?
Date: Sun, 18 Feb 2018 13:35:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Op 17-02-18 om 02:33 schreef Brand Huntsman:
> On Fri, 16 Feb 2018 20:52:30 -0300
> Marco Diego Aurélio Mesquita <address@hidden> wrote:
>> Attached patch should resolve https://savannah.gnu.org/bugs/?53041 and
>> https://savannah.gnu.org/bugs/?28993.
> 
> Thanks! I apparently posted a duplicate request.

A near-duplicate.  The older request was about filtering the whole
buffer (or selected region) through an external program, and I've
steered that into the direction of the spell-check flow, and have
thought about changing the 'formatter' command to a 'filter'
command to achieve that.

Your request is more specific: make the execute command use a pipe
whenever something is marked.  In a way I like that, because it is
very economical.  But... if you want to pipe the whole buffer, you
first have to do M-\ M-A M-/ and then ^R ^X..., and you lose your
cursor position in the bargain.  If it were possible to toggle the
piping feature in the Execute Command menu, it would be easier to
pipe the whole buffer through an external command, and ^R ^X would
work the same way whether or not something is selected.  The dis-
advantage is that there is an extra toggle, and an extra key to hit
when wanting to filter the buffer or region.

Another advantage of having the piping toggle is that we could get
rid of the 'formatter' command.  If we allow syntaxes to contain
also 'bind' commands, a syntax could bind a keystroke to a desired
filter program:

    extendsyntax go bind M-T "^R^Xgofmt -w"

Spell-checking and replacing work on the whole buffer when nothing
is marked, and work on the marked region otherwise.  I think that
piping through an external command should operate the same way.

Opinions?

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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