nano-devel
[Top][All Lists]
Advanced

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

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


From: Brand Huntsman
Subject: Re: [Nano-devel] how should piping through an external command work?
Date: Sun, 18 Feb 2018 18:56:14 -0700

On Sun, 18 Feb 2018 13:35:08 +0100
Benno Schulenberg <address@hidden> wrote:

> 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"

That would be nice. But such binds should only exist in nanorc until function 
interpolation is supported. They could be added to a syntax as a comment but 
having them on by default could cause issues for anyone with non-standard 
bindings.


Marco Diego Aurélio Mesquita <address@hidden> wrote:
> I have an Idea: if the first character of a command is a '|' (and
> there is no text selected), nano should pipe the whole buffer to the
> command. This is not very discoverable but would allow us to have both
> possibilities without the need of  new toggle.

Good idea! The '|' should _ALWAYS_ be required to pipe selection or entire 
buffer(if no selection) to the command. It would even stay with the command in 
history and is easier to specify in a bind.

The current ^R^X doesn't replace the selection, and someone who doesn't know 
about the new piping might have a selection active and not notice it was 
overwritten by their command that only dumps something into the buffer. The 
terrible selection saving in writeout (who voted to do that?) has already 
forced me to rebind ^O to savefile and retrain myself to not press enter. Lets 
not repeat that bad idea.

Maybe the prompt could also detect if the first character of command is a '|' 
and display "[Selection]" or "[Buffer]".




reply via email to

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