GNU bug report logs - #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)

Previous Next

Package: emacs;

Reported by: Alcor <alcor <at> tilde.club>

Date: Sun, 17 Mar 2024 16:35:01 UTC

Severity: normal

Found in version 29.2

Done: "J.P." <jp <at> neverwas.me>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 69860 <at> debbugs.gnu.org (full text, mbox):

From: Alcor <alcor <at> tilde.club>
To: "J.P." <jp <at> neverwas.me>
Cc: 69860 <at> debbugs.gnu.org,
 Alcor via General discussion about ERC <emacs-erc <at> gnu.org>
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)
Date: Sun, 17 Mar 2024 18:23:58 +0100
[Message part 1 (text/plain, inline)]
"J.P." <jp <at> neverwas.me> writes:

> Oof. Looks like `erc-get-fg-color-face' sets `erc-control-default-bg' in
> its catch-all `cond' case. As you say, this produces:
>
>   #("THIS TEXT IS FORMATTED"
>     0 22 (font-lock-face (erc-control-default-bg bg:erc-color-face4)))
>
> And `erc-get-bg-color-face' sets `erc-control-default-fg'. Clearly,
> whoever's responsible for this outrage should be banished. (Thanks.)

Yes, that's part of the issue. However, `erc-controls-propertize' should
also avoid adding the default fg/bg to the font lock face if n=99 to
avoid overriding an existing fg,bg setting if fg=99,bg=x or bg=99,fg=x.

This is trivially fixable and it's possible you already have a fix, but
I'm attaching a patchset that works for me FWIW, just to illustrate what
I had to change in order to make it work.

Cheers,
-A

[0001-Fix-typo-in-erc-get-fg-bg-color-face.patch (text/x-diff, attachment)]
[0002-Fix-wrong-color-rendering-when-bg-99-or-fg-99.patch (text/x-diff, attachment)]

This bug report was last modified 1 year and 50 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.