|
From: | J.P. |
Subject: | Re: bug#60933: 30.0.50; ERC >5.5: Make buttonizing more extensible |
Date: | Sat, 29 Apr 2023 08:56:06 -0700 |
User-agent: | Gnus/5.13 (Gnus v5.13) |
"J.P." <jp@neverwas.me> writes: > The same general thinking applies to the nicks-specific buttonizer as > well, though it being intrinsically special and, for now, internal means > we can take more liberties in inconveniencing its consumers (which are > all built-in modules). Thus, I'm proposing we replace the slightly > unwieldy set of positional params with a single passed-around struct, > which members of the interface's "advice stack" can modify at will. See > implementation for details. Previously, consumers of the new nick-buttonizer interface were given a look at every single word in a message. But they should only really care about those with an associated `erc-server-user' object, meaning known nicks. And while it's true that some might want to create these associations on the fly, I think they're better off doing so earlier on, both to help separate concerns and to skip the hassle of determining whether a candidate is a speaker or a mention. To that end, I've carved out a couple more access points to influence how nick buttonizing happens. Both use the same pattern of "local advice around a function-interface variable," which I've come to regard as the most predictable and flexible for building new internal APIs. The first lives in `erc-server-PRIVMSG' and integrates with the old `erc-format-nick-function', which takes the user object it spits out. The second runs right before the nick buttonizer but only as a fallback when the usual means of finding an `erc-server-user' object from a candidate fails. It's set to `ignore' by default.
0000-v1-v2.diff
Description: Text Data
0001-5.6-Revise-FORM-as-function-interface-in-erc-button-.patch
Description: Text Data
0002-5.6-Improve-erc-button-modify-nick-function-interfac.patch
Description: Text Data
0003-5.6-Use-getter-for-finding-users-in-erc-server-PRIVM.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |