Discussion:
GNU sed maintainers, please document GNU sed's "-E" option (which is now in POSIX)
(too old to reply)
Bruce Korb
2013-10-14 17:26:13 UTC
Permalink
Dear GNU sed maintainers, please accept the attached patch.
It modifies the sed documentation to note the sed "-E" option,
"fewer backslashes" not "less backslashes", as long as you're fixing it.
David A. Wheeler
2013-10-14 18:53:54 UTC
Permalink
Post by Bruce Korb
"fewer backslashes" not "less backslashes", as long as you're fixing it.
Fine by me.

Do you want me to resubmit the patch?

--- David A. Wheeler
Bruce Korb
2013-10-14 19:10:13 UTC
Permalink
Post by David A. Wheeler
Post by Bruce Korb
"fewer backslashes" not "less backslashes", as long as you're fixing it.
Fine by me.
Do you want me to resubmit the patch?
*I* would, but I'm not a sed maintainer.

Just for non-native English speakers:

If you put several fewer gallons of water into a tub,
then you have less water in the tub. "fewer" is for
stuff you can count, "less" for stuff you don't count.
"backslashes" and "gallons" are countable.
David A. Wheeler
2013-10-14 21:10:56 UTC
Permalink
Post by Bruce Korb
"fewer backslashes" not "less backslashes", as long as you're fixing it.
That's fine by me. Would you like me to resubmit the proposed patch, or just edit it as you go?

--- David A. Wheeler
John Cowan
2013-10-14 21:24:28 UTC
Permalink
Post by Bruce Korb
If you put several fewer gallons of water into a tub,
then you have less water in the tub. "fewer" is for
stuff you can count, "less" for stuff you don't count.
"backslashes" and "gallons" are countable.
OT, but this is not the whole truth but an oversimplification. Quantities
and amounts such as time, distance, and money take "less", and have for
a thousand years, but less than (not "fewer than") two thousand years.
Thus "10 items or less" in the checkout line is correct, because it's the
total amount that's relevant, not the individual items. In addition,
the number 1 is a special case; "one fewer backslash" is unidiomatic,
and has to be "one less backslash" or "one backslash fewer".
--
That you can cover for the plentiful John Cowan
and often gaping errors, misconstruals, http://www.ccil.org/~cowan
and disinformation in your posts ***@ccil.org
through sheer volume -- that is another misconception. --Mike to Peter
Bruce Korb
2013-10-14 22:51:07 UTC
Permalink
Post by John Cowan
Post by Bruce Korb
If you put several fewer gallons of water into a tub,
then you have less water in the tub. "fewer" is for
stuff you can count, "less" for stuff you don't count.
"backslashes" and "gallons" are countable.
OT, but this is not the whole truth but an oversimplification.
With a simplified rule, you can wind up with fewer mistakes
and less overall grating on one's nerves. ;) But, yes,
I ought to have added a "more or less" caveat.
Jose E. Marchesi
2013-10-15 19:17:42 UTC
Permalink
Hi David.

Thank you for submitting the patch. Given that -E has been added to
POSIX I see nothing wrong on documenting -E along with -r.

Could you please provide a ChangeLog entry documenting the changes?

Also,

+usually have less backslashes.

Please replace `less backslashes' with `fewer backslashes' as Bruce
suggested.

- /* Undocumented, for compatibility with BSD sed. */
+ /* "-E" is in POSIX, http://austingroupbugs.net/view.php?id=528 */
case 'E':
case 'r':
if (extended_regexp_flags)

That comment about -E being in POSIX is unnecessary. Just remove the
comment claiming that -E is not documented.

Would you like to update your patch and resend it using git
format-patch?

Thanks :)
Jose E. Marchesi
2013-10-16 10:43:38 UTC
Permalink
Sure. Here's the updated patch, with all changes requested, using
git format-patch.

[...]

+2013-10-15 David A. Wheeler <***@dwheeler.com>
+ * doc/sed-in.texi: Document "-E" option to use EREs. GNU sed already
+ supported "-E" as an undocumented synonym for "-r", but "-E" is now
+ in POSIX. See: http://austingroupbugs.net/view.php?id=528.
+ * doc/sed.1: Likewise.
+ * doc/sed.texi: Likewise.
+ * doc/sed.x: Likewise.
+ * sed/sed.c: Likewise.
+

Could you please add an empty line between the header and the first
entry in the ChangeLog record? Thanks.
Jose E. Marchesi
2013-10-17 10:47:41 UTC
Permalink
Post by Jose E. Marchesi
Could you please add an empty line between the header and the first
entry in the ChangeLog record? Thanks.
Done. Attached.

Applied, thanks.

Loading...