]> git.eshelyaron.com Git - emacs.git/commit
Fix overlapping logs from erc-truncate-buffer-on-save
authorF. Jason Park <jp@neverwas.me>
Wed, 20 Dec 2023 06:33:48 +0000 (22:33 -0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 24 Dec 2023 16:07:33 +0000 (17:07 +0100)
commitba4b360b569e9eed7a75a7b837f83d7e9a33202d
treeef1c2cb43f426c0ec9ebc083626cb011f7e68e43
parent5ff111a02e4965f17bd1f3713c9679a84378e4cc
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.

(cherry picked from commit 9cd47017c705fe0efe8f42c143807a489ed69016)
lisp/erc/erc-button.el
lisp/erc/erc-log.el
lisp/erc/erc-stamp.el
lisp/erc/erc.el
test/lisp/erc/erc-scenarios-log.el