[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nano-devel
Subject:    Re: [Nano-devel] [PATCH] new feature: option -e, for specifying commands to execute at startup
From:       Brand Huntsman <alpha () qzx ! com>
Date:       2018-08-30 23:02:04
Message-ID: 20180830170204.59600280 () borg
[Download RAW message or body]

On Thu, 30 Aug 2018 12:18:17 -0300
Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com> wrote:

> > Why do you want another stream editor?  Is sed not good enough as
> > a stream editor?
> 
> Nano could have a more intuitive command language than sed.

You mean more verbose and interactive?

sed -i 's:foo:bar:g' file
vs
nano -e '${replace}foo${enter}bar${enter}' file
# and then manually pressing YN for each instance

It would be great if you want an interactive search&replace, but that could be an \
extension of the cli search feature. If cli search is adopted, it should support \
replace. But -s is already used by speller and -w used by nowrap, so perhaps -f for \
find. It should also support something similar to sed, and have the first character \
be a non-alpha separator, or an alpha toggle such as 'r' or 'c' for regex and \
case-sensitive.

nano -f ':foo:' file
nano -f 'c:foo:' file
nano -f ':foo:bar:' file
nano -f 'rc:^foo:bar:' file

Oh and -e is listed as "Ignored, for compatibility with Pico.".


_______________________________________________
Nano-devel mailing list
Nano-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/nano-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic