Subject: Re: bug#44100: Patch

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 01 Nov 2020 14:09:54 +0100

Amin Bandali <[email-masked]> writes:

> However, I came up with a potentially more proper different fix: I think
> the presence of the dotted pair with a non-nil cdr is the main problem,
> since it means `erc-modified-channels-alist' does not fully adhere to
> the documented structure in its docstring.  So I addressed the issue in
> `erc-track-modified-channels' by wrapping up single faces in lists too,
> ensuring that `erc-modified-channels-alist' never ends in a non-nil cdr.
>
> Something along the lines of the following patch.  Thoughts?

[...]

>    (when erc-face
>      (put-text-property 0 (length channame) 'face erc-face channame)
> -    (when (eq erc-face 'erc-default-face)
> +    (when (eq (car erc-face) 'erc-default-face)
>        (add-face-text-property 0 (length channame) 'bold t channame)))
>    channame)

Normalising to having a list of faces here sounds like a good idea, if
I'm skimming the code correctly, but it would probably help
comprehension a bit here if you renamed the parameter from `erc-face' to
something like `face-list'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no