Fix overlapping logs from erc-truncate-buffer-on-save
* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Currently, internal "error notices" do not have timestamps. However,
this causes alignment issues for non-`fill-wrap' users of left-sided
stamps. The heuristic used by this change for detecting such stamps
is weak and prone to false negatives.
* lisp/erc/erc-log.el (erc-log-mode, erc-log-enable): Set explicit
depth for `erc--pre-clear-functions' to 50.
(erc-save-buffer-in-logs): Fix partial regression in which redundant
text would appear in logs that have undergone truncation via an
interactive call to this command when the deprecated option
`erc-truncate-on-save' is non-nil.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Set
depth for `erc--pre-clear-functions' to 40.
(erc-stamp--reset-on-clear): Only add `erc-stamp--insert-date-hook'
when `erc-stamp--date-mode' is active.
* lisp/erc/erc.el (erc-cmd-CLEAR): Rework to honor but improve upon
the old behavior when called from lisp. Do this by attempting to find
the beginning of the current message and excluding it from the
truncated portion of the buffer. A NEWS entry describing this
behavior already exists for 5.6.
* test/lisp/erc/erc-scenarios-log.el
(erc-scenarios-log--save-buffer-in-logs/truncate-on-save): New test.
These changes originate from bug#60936.