bug-ed
[Top][All Lists]
Advanced

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

Re: While we're talking about new features


From: Antonio Diaz Diaz
Subject: Re: While we're talking about new features
Date: Sat, 19 Nov 2022 19:05:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14

Shawn Wagner wrote:
Two more I have in mind:

Supporting a GNU sed extension of taking both a starting offset and g
with s///Ng - replace all matches starting with the Nth one. I have
this mostly done; I'm not sure how it should interact with the current
toggling behavior of sN and sg, though.

I'm about to start implementing this one a little differently:

  'gN' replace the first N matches.
  'Ng' replace from the Nth match to the last. (like GNU sed)

I was also thinking about removing the toggling behavior of sN and sg, and just make the alternative syntax form of the 's' command interpret 'N' and 'g' just as the standard 's' command does. This seems to me more useful than "toggling" the proposed new behavior.

Adding an ex-like range to ! that sends the addressed lines to an
external command and replaces them with its output. I don't think
there's any good way to do this now that doesn't involve multiple
steps and a temporary file.

For the time being I have documented in the manual the "multiple steps" approach while I can decide how to implement it (with fork like zutils, or old style with a temporary file).

What do you think?

Antonio.



reply via email to

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