]> git.eshelyaron.com Git - emacs.git/commit
Discourage ill-defined use of buffer targets in ERC
authorF. Jason Park <jp@neverwas.me>
Wed, 20 Oct 2021 10:52:18 +0000 (03:52 -0700)
committerF. Jason Park <jp@neverwas.me>
Thu, 30 Jun 2022 22:03:26 +0000 (15:03 -0700)
commite958a2b726fdcb5a4f58169e6f4f384f5786f86a
treefa3e5b3971ea799432080b3a4eaf51905a3d0e00
parent529e46f1287ddb6fc16779a3f14016d0c305037c
Discourage ill-defined use of buffer targets in ERC

* lisp/erc/erc.el (erc-default-recipients, erc-default-target):
Explain that the variable has fallen out of favor and that the
function may have been used historically by third-party code for
detecting channel subscription status, even though that's never been
the case internally since at least the adoption of version control.
Recommend newer alternatives.

(erc--current-buffer-joined-p): Add possibly temporary predicate for
detecting whether a buffer's target is a joined channel.  The existing
means are inconsistent, as discussed in bug#48598.  The mere fact that
they are disparate is unfriendly to new contributors.  For example, in
the function `erc-autojoin-channels', the `process-status' of the
`erc-server-process' is used to detect whether a buffer needs joining.
That's fine in that specific situation, but it won't work elsewhere.
And neither will checking whether `erc-default-target' is nil, so
long as `erc-delete-default-channel' and friends remain in play.

(erc-add-default-channel, erc-delete-default-channel, erc-add-query,
erc-delete-query): Deprecate these helpers, which rely on an unused
usage variant of `erc-default-recipients'.

* lisp/erc/erc-services.el: remove stray `erc-default-recipients'
declaration.

* lisp/erc/erc-backend.el (erc-server-NICK, erc-server-JOIN,
erc-server-KICK, erc-server-PART): wrap deprecated helpers to suppress
warnings.

* lisp/erc/erc-join.el (erc-autojoin-channels): Use helper to detect
whether a buffer needs joining.  Prefer this to server liveliness, as
explained above.
lisp/erc/erc-backend.el
lisp/erc/erc-join.el
lisp/erc/erc-track.el
lisp/erc/erc.el