Subject: Re: bug#69860: 29.2; ERC 5.6-git: erc: Incorrect face formatting applied for fg=99 bg=x (irccontrols module with erc-interpret-mirc-color=t)

From: Alcor <[email-masked]>
Date: Wed, 20 Mar 2024 18:23:02 +0100

"J.P." <[email-masked]> writes:

> Alcor <[email-masked]> writes:
> Here's my current understanding of what you're saying. When there's an
> existing fg/bg combo in effect for a given span, and the parsing logic
> encounters a ^Cx,99 (or a ^C99,x), the 99 shouldn't induce a clobbering
> of the corresponding "incumbent" fg (or bg) face with a dedicated (and
> superfluous) default face but instead trigger the _removal_ of said
> incumbent face. This has the effect of falling through to honor the
> relevant attributes of the underlying `erc-default-face', which ships as
> a no-op. For example, given
>
>   ^C03,08 hello ^C99,07 world
>
> the "hello " portion should be green on yellow and " world" should be
> ${default-foreground} (likely black or white) on orange. Likewise, if
> "^C99,07" were instead "^C04", then " world" should be red on yellow.
> This behavior aligns with that exhibited by Weechat and (I'm hoping)
> other popular clients. The revised patch set (attached) attempts to
> mimic this in ERC. Corrections or alternatives welcome. Thanks.

Yes, thanks for putting this in more precise words. "Clobbering" was the
term I was looking for. That was what was happening, with the 99 fg/bg
element introducing a face that clobbers the non-99 fg/bg element.

Just tried the revised patchset out on Emacs 29.2 with the latest Erc,
and things work as expected now (screenshots* attached).

Hopefully the formatting issues should be sorted out now. As usual,
thanks for the great effort & for the time invested into fixing the
"not-so-commonly-used" formatting functionality :)

+1

Cheers,
-A.

*) Checked that on both sender/receiver sides just to be sure it applies
 `erc-input-face' (for the sender) and `erc-default-face' (for the
 recipient side) correctly.