On Tue, 14 Aug 2018 15:16:47 +0200, Martijn van Duren wrote:

> So gnu is somewhat contradictory here. On the one hand it treats
> every file as a new script, based on the hold-space, but the 'q'
> command exits the editor all together.

The 'q' command should quit the editor, not just the current file.
Resetting the hold space for each file seems reasonable.

> So the question is how close do we want to follow gnu sed and
> how consistent do we want to be in our definitions.
> - Do we treat "-i" as a single script passing, then I'd expect
> sed to quit, similar to what gnu sed does and keep our hold space
> over multiple files (unlike what gnu sed does, but we currently do)
> - Do we treat "-i" as multiple executions of the same script
> (similar to "for file in *; do sed -i ...; done"), then I'd expect
> sed to reset the hold space, similar to what gnu sed does and
> not quit the editor itself, but merely the execution on the
> current file.
> - Do we treat "-i" as quirk by quirk compatible with gnu sed, then
> the diff also fixes the hold space case.

We should try for quirk by quirk compatible with gnu sed with respect
to the -i flag since that's where the feature comes from.

Your updated diff looks good to me.

 - todd

Reply via email to