]> git.eshelyaron.com Git - emacs.git/commit
Make erc-input's refoldp slot conditionally available
authorF. Jason Park <jp@neverwas.me>
Fri, 1 Dec 2023 21:54:12 +0000 (13:54 -0800)
committerEshel Yaron <me@eshelyaron.com>
Thu, 21 Dec 2023 20:53:53 +0000 (21:53 +0100)
commit840bb1053cb132e479946c377bbaba4e9e1ac5ef
tree0992aac5ed5bc3342a629fe8833bf63c921489a2
parent83da7f84ac49e7fc92ee63b4afc142fe754a3b3f
Make erc-input's refoldp slot conditionally available

* etc/ERC-NEWS: Fix entry regarding `erc-input-refoldp'.
* lisp/erc/erc-common.el (erc-input): Remove `refoldp' slot, which was
to be new in 5.6, in order to reduce churn in the extremely unlikely
event that third-party code uses the read-syntax of these objects or
ones subclassed from it for some other purpose, outside of
`erc-pre-send-functions'.
(erc--input-split) Add `refoldp' slot here instead.
* lisp/erc/erc.el (erc-pre-send-functions): Amend doc string to stress
that `refoldp' is not a real slot.
(erc--input-ensure-hook-context, erc-input-refoldp): New function, an
impostor accessor for the nonexistent `refoldp' slot of `erc-input',
and a helper function for asserting a valid context at runtime.
(erc--run-send-hooks): Don't copy over `refoldp' from the
`erc--input-lines' object to the working `erc-insert' object.  Check
the insertion context's `erc--input-split' object instead of the
hook's `erc-insert' object when deciding whether to resplit.
* test/lisp/erc/erc-tests.el: Adjust test environment to satisfy
assertion.  (Bug#62947)

(cherry picked from commit 951b115c2ac9b60007eef6a13a25c618a69c7e0f)
etc/ERC-NEWS
lisp/erc/erc-common.el
lisp/erc/erc.el
test/lisp/erc/erc-tests.el