summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2024-08-27 01:00:04 -0700
committerF. Jason Park <jp@neverwas.me>2024-09-29 16:43:38 -0700
commit51d5419fdc3805a95190f8913e8ea349f243f11d (patch)
tree21fde3184ac49c7f2cb7154f06e8e4e902ac09c5 /lisp/emacs-lisp/regexp-opt.el
parent08f662da1123f50f3f62d0af747bff88d2c73938 (diff)
downloademacs-51d5419fdc3805a95190f8913e8ea349f243f11d.tar.gz
emacs-51d5419fdc3805a95190f8913e8ea349f243f11d.tar.bz2
emacs-51d5419fdc3805a95190f8913e8ea349f243f11d.zip
Redo ERC truncation and /CLEAR hook mechanism
* etc/ERC-NEWS: Mention option `erc-truncate-padding-size'. * lisp/erc/erc-fill.el (erc-fill-wrap-mode, erc-fill-wrap-enable) (erc-fill-wrap-disable): Manage membership in the `erc--clear-function' advice stack for own function that massages a buffer's oldest inserted message, post truncation. (erc-fill--wrap-massage-initial-message-post-clear): New function. * lisp/erc/erc-log.el (erc-log-mode, erc-log-enable): Don't add `erc-save-buffer-in-logs' to `erc--pre-clear-functions'. Use local advice around common interface variable instead, as noted below. (erc-log-disable): Likewise, don't remove `erc-save-buffer-in-logs' from `erc--pre-clear-functions'. (erc-log-setup-logging): Add `erc-log--save-on-clear' to `erc--clear-function'. (erc-log-disable-logging): Remove `erc-log--save-on-clear' to `erc-clear-function'. (erc-save-buffer-in-logs): Abort when `erc--insert-marker' is non-nil. (erc-log--save-on-clear): New function, a thin wrapper around `erc-save-buffer-in-logs', adapting it to the `erc--clear-function' advice interface. * lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Don't add `erc-stamp--reset-on-clear' to `erc--pre-clear-functions'. (erc-stamp-disable): Don't remove `erc-stamp--reset-on-clear' from `erc--pre-clear-functions'. (erc-stamp--find-insertion-point): Account for initial position being `bobp'. (erc-stamp--defer-date-insertion-on-post-modify): Accommodate the rare non-list `erc-insert-post-hook' when shadowing. (erc-stamp--setup): Add and remove `erc-stamp--reset-on-clear' to and from `erc--clear-function' advice stack. (erc-stamp--redo-right-stamp-post-clear): New function. (erc-stamp--update-saved-position): Remove unused function. This was originally added along with `erc-stamp--reset-on-clear' as part of bug#60936. (erc-stamp--reset-on-clear): Expect end of truncation boundary to be at `erc-insert-marker'. Rework to use new `erc--clear-function' interface and run on `erc-timer-hook' instead of `erc-insert-done-hook'. * lisp/erc/erc-truncate.el (erc-truncate-padding-size): New option to help tamp down on disruptions when reading scroll back caused by overly frequent truncation. (erc-truncate-enable, erc-truncate-disable): Add and remove `erc-truncate--setup' to and from `erc-mode-hook', and run it when needed. (erc-truncate--buffer-size): New variable. (erc-truncate--setup): New function. (erc-truncate-buffer-to-size): Guard execution with `erc-truncate--padding-size' and `erc--inhibit-clear-p'. Reflow for readability, removing obsolete comments. Call hooks with marker instead of buffer position, as per the new `erc--clear-function' interface. (erc-truncate-buffer): Defer execution to `erc-timer-hook' when running post-insertion via a response handler. (erc-truncate--inhibit-when-local-and-interactive): New function. * lisp/erc/erc.el (erc-mode): Add `erc--skip-past-headroom-on-clear' to `erc--clear-function' in all ERC buffers. (erc--with-spliced-insertion): Account for marker being `bobp'. (erc--insert-before-markers-transplanting-hidden): Make more robust by accommodating initial `point' possibly being `bobp'. (erc--clear-function): New variable, a function-valued local-advice interface to replace `erc--pre-clear-functions'. (erc--pre-clear-functions): Remove unused variable. (erc--skip-past-headroom-on-clear): New function. (erc--inhibit-clear-p): New variable. (erc-cmd-CLEAR): Call hooks with markers instead of position. Signal `user-error' when `erc--inhbiit-clear-p' is non-nil. * test/lisp/erc/erc-scenarios-log.el (erc-scenarios-log--clear-stamp) (erc-scenarios-log--cmd-clear/date-stamps): Rename former to latter, update assertions, and use common helper. (erc-scenarios-log--cmd-clear/left-stamps): New test. (erc-scenarios-log--truncate): Move body to function of the same name, and update assertions. (erc-scenarios-log--truncate/left-stamps): New test. (Bug#72736)
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
0 files changed, 0 insertions, 0 deletions