GNU bug report logs -
#60933
30.0.50; ERC >5.5: Make buttonizing more extensible
Previous Next
Reported by: "J.P." <jp <at> neverwas.me>
Date: Wed, 18 Jan 2023 14:40:01 UTC
Severity: normal
Tags: patch
Found in version 30.0.50
Fixed in version 30.1
Done: "J.P." <jp <at> neverwas.me>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 60933 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
"J.P." <jp <at> 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 (text/x-patch, attachment)]
[0001-5.6-Revise-FORM-as-function-interface-in-erc-button-.patch (text/x-patch, attachment)]
[0002-5.6-Improve-erc-button-modify-nick-function-interfac.patch (text/x-patch, attachment)]
[0003-5.6-Use-getter-for-finding-users-in-erc-server-PRIVM.patch (text/x-patch, attachment)]
This bug report was last modified 1 year and 245 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.