It is not super clear whether ['e', 'q'] or ['q', 'e'] counts as
"repeating". I think it is inferred from the first paragraph that it is
the destroying of the editor buffer that is more important than the
command that causes that destruction. GNU ed follows this
interpretation, and I agree with it.
$ ed --version | head -n1
GNU ed 1.20.1
$ ed preexistingfile
H
P
*a
hello
.
*e
Warning: buffer modified
*q
$ ed preexistingfile
H
P
*a
hello
.
*q
Warning: buffer modified
*e
419
*q
$
Besides, removing that line of code I think isn't correct. You'd have to
implement `Session.warned_edit` and `Session.warned_quit`.