Subject: Re: bug#68401: 30.0.50; ERC 5.6-git: `erc-cmd-GMSG', `erc-cmd-AMSG', `erc-cmd-GME', `erc-cmd-AME'. 2nd attempt

From: "J.P." <[email-masked]>
Date: Tue, 23 Jan 2024 17:38:07 -0800

Emanuel Berg <[email-masked]> writes:

> J.P. wrote:
>
>> I don't understand the point of adding your purpose-built
>> predicate `erc--connected-and-joined-p' if you're not going
>> to use it to replace
>>
>>   (lambda () (erc-channel-p (erc-default-target)))
>>
>> completely. IOW, having both is redundant
>

Redundant from the POV of `erc--connected-and-joined-p' because it calls
`erc--current-buffer-joined-p' (which see). Please compare that
function's definition to the lambda. There are overlapping concerns
there. That is, one "subsumes" the other, thus obviating the need for
it.

> ??
>
> (lambda () (erc-channel-p (erc-default-target)))
>
> has been there all along, you then told me to add the
> "logical" connectivity test.
>
> If we can just use the lambda, I'll be happy to drop the test.

You can't just use the lambda, but you can lose it entirely in favor of
your predicate.

>
>> If you're not already doing so, please try expanding your
>> macro use sites to verify correctness.
>
> ???
>
> My "macro use sites" is what?

If you expand one of your `erc-with-all-buffers-of-server' forms with
both the lambda and `erc--connected-and-joined-p' present, it should
become clear why only the latter is needed.