[hackers] [sbase] ed: Update man page and TODO || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 31 Dec 2025 13:10:07 +0100 (CET)

commit dae48911d223022deb96408a65ed910f82a2ef30
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
AuthorDate: Wed Dec 31 13:08:52 2025 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.net>
CommitDate: Wed Dec 31 13:08:52 2025 +0100

    ed: Update man page and TODO

diff --git a/TODO b/TODO
index 4092917..e428d84 100644
--- a/TODO
+++ b/TODO
_AT_@ -30,6 +30,8 @@ ed
 --
 
 * Editing huge files doesn't work well.
+* Using % in shell escapes of r, e, E, w, W, x and X commands.
+* Using !! in shell escapes of r, e, E, w, W, x and X commands.
 
 
 printf
diff --git a/ed.1 b/ed.1
index b6dbf6b..ef826e6 100644
--- a/ed.1
+++ b/ed.1
_AT_@ -176,9 +176,23 @@ As above, but without warning if the current buffer has unsaved changes.
 .It ($)r Ar file
 Read in
 .Ar file
-and append it to the current buffer, printing the bytes read to standard output.
+and append it to the current buffer at the addressed line,
+printing the bytes read to standard output.
 The currently remembered filename isn't changed unless it's empty.
-An address of 0 reads the file into the start of the buffer.
+An address of 0 reads the
+.Ar file
+into the start of the buffer.
+.It ($)r Ar !command
+Execute the
+.Ar command
+and append its output in the current buffer at the addressed line.
+When
+.Ar command
+returns a '!' is printed.
+The currently remembered filename isn't changed.
+An address of 0 reads the output of
+.Ar command
+into the start of the buffer.
 .It (.,.)s/re/replacement/flags
 Substitute re for replacement in lines matching re.
 An & within replacement is replaced with the whole string matched by re.
_AT_@ -213,17 +227,26 @@ As above, but instead of overwriting the contents of
 the addressed lines are appended to
 .Ar file
 instead.
+.It (1,$)w Ar !command
+Write the addressed lines to the standard input of
+.Ar command .
+When
+.Ar command
+returns a '!' is printed.
+The dot is unchanged.
 .It (.+1)
 An address without a command prints the addressed line.
 Sets the dot to that line.
-.It (1,$)x file
+.It (1,$)x Ar file
 Like the w command
-but after saving the file
+but after saving the
+.Ar file
 it exits with an exit status of 0
 independently of previous errors.
-.It (1,$)X file
+.It (1,$)X Ar file
 Like the W command
-but after saving the file
+but after saving the
+.Ar file
 it exits with an exit status of 0
 independently of previous errors.
 .It (+) Ns Ic z Ns Ar n
_AT_@ -256,6 +279,28 @@ When
 returns a '!' is printed.
 The dot is unchanged.
 .El
+.Sh ASYNCHRONOUS EVENTS
+.Bl -tag -width "SIGQUIT"
+.It Dv SIGHUP
+If the current buffer has changed since it was last written,
+.Nm
+attempts to write the buffer to the file
+.Pa ed.hup .
+Nothing is written to the currently remembered file, and
+.Nm
+exits.
+.It Dv SIGINT
+When an interrupt occurs,
+.Nm
+prints
+.Sq ?\en
+and returns to command mode.
+If interrupted during text input,
+the text already input is written to the current buffer,
+as if text input had been normally terminated.
+.It Dv SIGQUIT
+This signal is ignored.
+.El
 .Sh SEE ALSO
 .Xr sed 1 ,
 .Xr regexp 3
_AT_@ -285,7 +330,6 @@ The dot is unchanged.
 .Sh STANDARDS
 POSIX.1-2013.
 Except where noted here:
-g and v operate on single commands rather than lists delimited with '\e'.
 The command,
 .Cm z ,
 .Cm x ,
Received on Wed Dec 31 2025 - 13:10:07 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 31 2025 - 13:12:34 CET