Hi,

mazoc...@disroot.org wrote on Wed, Jul 03, 2019 at 07:21:53AM +0300:

> I am not good at explaining something shortly and clearly to fit into
> proper documentation, so I'll just describe my experience here.

Well, sending patches - even such patches as may not be perfect yet
but require some tweaking - is often better than a bare bug report
because a patch *plus* an explanation often explains a problem more
clearly than the report alone, but when you feel unable to write a
patch, a bare report is OK as well.

> Terminating regular expressions with / or ? is necessary only if they
> are followed by commands, otherwise the following are legal in both
> OpenBSD ed, Plan 9 ed and GNU ed:
> /something
> /
> ?
> g/ing

The cases of addresses and the 's' command have already been fixed
earlier.  The v and V commands need no change, and i just committed
the following fix for the g and G commands.

We are still considering more improvements in the vicinity, but i
believe the particular issue you reported is now fully repaired.
If you think it is not, please simply speak up again!

Thanks,
  Ingo



CVSROOT:        /cvs
Module name:    src
Changes by:     schwa...@cvs.openbsd.org        2019/07/15 11:57:48

Modified files:
        bin/ed         : ed.1 

Log message:
Explain in which circumstances trailing slashes can be omitted after
the g and G commands, and polish the wording a bit explaining empty
command lists.
Closing a gap in the manual reported by <mazocomp at disroot dot org>.
OK jmc@ martijn@


Index: ed.1
===================================================================
RCS file: /cvs/src/bin/ed/ed.1,v
retrieving revision 1.72
diff -u -r1.72 ed.1
--- ed.1        12 Jul 2019 19:28:48 -0000      1.72
+++ ed.1        15 Jul 2019 17:56:37 -0000
@@ -392,14 +392,20 @@
 .Ic v ,
 and
 .Ic V .
-A newline alone in command-list is equivalent to a
+An empty
+.Ar command-list
+is equivalent to a
 .Ic p
 command.
+In this case, the trailing slash can be omitted.
 .Sm off
 .It (1,$) Ic G No / Ar re No /
 .Sm on
 Interactively edits the addressed lines matching a regular expression
 .Ar re .
+The trailing slash after
+.Ar re
+can be omitted.
 For each matching line, the line is printed, the current address is set,
 and the user is prompted to enter a
 .Ar command-list .
@@ -415,11 +421,10 @@
 .Ar command-list
 is the same as that of the
 .Ic g
-command.
-A newline alone acts as a null command list.
+command, but an empty command list does nothing.
 A single
 .Sq &
-repeats the last non-null command list.
+repeats the last non-empty command list.
 .It Ic H
 Toggles the printing of error explanations.
 By default, explanations are not printed.

Reply via email to