Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2021-Sep-06, Laurenz Albe wrote:
>> I agree with Greg that the current behavior is annoying and would
>> welcome the change. This has bothered me before.
> It has bothered me too.
I'm not here to claim that the current behavior is perfect. However,
AFAICT the patch as-presented breaks the principle that text goes into
the history at the moment it's sent to the server. In particular, we
might make an entry for text that *never* got to the server because you
cleared the buffer instead. I don't find that to be an improvement.
It breaks one of the primary use-cases for history, ie keeping a record
of what you did.
We could perhaps finesse that point by deciding that comment lines
that are handled this way will never be sent to the server --- but
I'm sure people will complain about that, too. I've definitely heard
people complain because "--" comments are stripped from what's sent
(so I'd look favorably on a patch to undo that).
I think the questions around empty-line handling are largely
orthogonal to this, and we'll just confuse ourselves if we
discuss that at the same time. Likewise for M-#.
regards, tom lane