]> git.eshelyaron.com Git - emacs.git/commit
Reuse old query buffers for reassumed nicks in ERC
authorF. Jason Park <jp@neverwas.me>
Thu, 9 May 2024 02:04:13 +0000 (19:04 -0700)
committerEshel Yaron <me@eshelyaron.com>
Wed, 29 May 2024 10:11:50 +0000 (12:11 +0200)
commitaec891f728e9dde366fe52e823ea06aa6fad2257
treee6195beee23b5cdbb135feeb13962d04948f7c3c
parentade3478d4d97659bfd0b55561c2513765dacb39f
Reuse old query buffers for reassumed nicks in ERC

* lisp/erc/erc-backend.el
(erc--wrangle-query-buffers-on-nick-change): New function for handling
buffer renaming and message routing triggered by a nick change.  Such
twiddling used to reside in `erc-server-NICK' but has been separated
out for use by built-in modules overriding `erc-server-NICK'.  The
behavior has also changed to favor always reusing an existing query
buffer whenever possible instead of creating a new, <N>-suffixed
buffer.  This addresses some arguably unfinished business from
bug#48598.
(erc-server-NICK): Fix erroneous call to `erc-update-user-nick' that
passed the sender's login as the function's INFO argument.  Move
buffer renaming logic to `erc--wrangle-query-buffers-on-nick-change'
for use by "NICK" handlers managed by modules.  Also, print the notice
in all query buffers when the client changes its own nick.
(erc-server-QUIT): Show messages in all query buffers when the client
itself quits, but prevent `track' from updating the mode line with
redundant noise.
* lisp/erc/erc.el (erc-generate-new-buffer-name): Fix typo in doc.
(erc--query-list): New function.
* test/lisp/erc/erc-scenarios-base-query-participants.el: New file.
* test/lisp/erc/erc-scenarios-base-renick.el
(erc-scenarios-base-renick-queries-solo): Revise slightly to use
modern helper API.
(erc-scenarios-base-renick-queries/reassume): New test.
(erc-scenarios-base-renick-self/merge-query): New test.
* test/lisp/erc/resources/base/query-participants/legacy.eld: New file.
* test/lisp/erc/resources/base/reconnect/options-again.eld: Adjust
timeout.
* test/lisp/erc/resources/base/renick/queries/reassume.eld: New file.
* test/lisp/erc/resources/base/renick/self/manual.eld: Update timeouts.
* test/lisp/erc/resources/base/renick/self/merge-query-a.eld: New file.
* test/lisp/erc/resources/base/renick/self/merge-query-b.eld: New file.
(Bug#70928)

(cherry picked from commit 75aefe6514854bfdbe2a398cf1b7265012c9a88b)
lisp/erc/erc-backend.el
lisp/erc/erc.el
test/lisp/erc/erc-scenarios-base-query-participants.el [new file with mode: 0644]
test/lisp/erc/erc-scenarios-base-renick.el
test/lisp/erc/resources/base/query-participants/legacy.eld [new file with mode: 0644]
test/lisp/erc/resources/base/reconnect/options-again.eld
test/lisp/erc/resources/base/renick/queries/reassume.eld [new file with mode: 0644]
test/lisp/erc/resources/base/renick/self/manual.eld
test/lisp/erc/resources/base/renick/self/merge-query-a.eld [new file with mode: 0644]
test/lisp/erc/resources/base/renick/self/merge-query-b.eld [new file with mode: 0644]