Re: 29.4; ERC 5.6.1-git: erc-nicks does not respect pal and fool faces

Trevor Arjeski <[email protected]> Tue, 01 Oct 2024 20:56:17 +0300
Newsgroups gmane.emacs.erc.general
Message-ID <[email protected]>
I did a bit more testing and realized that the problem is also occuring for erc-current-nick.

Here is an updated patch:
0001-Make-erc-nicks-respect-priority-faces.patch (text/x-patch, 1.5 KB)
From 88b01b15219d86aac2c8670f86d6001368bb04d1 Mon Sep 17 00:00:00 2001
From: Trevor Arjeski <[email protected]>
Date: Tue, 1 Oct 2024 20:48:04 +0300
Subject: [PATCH] Make erc-nicks respect priority faces

The erc-nicks colors should not highlight over a nick that is a pal, fool or
current nick.

This change, when preparing a nick face, checks if a nick is a pal, fool or
current nick and uses the respective face in erc-nicks--face-table from there on
out.
---
 erc-nicks.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/erc-nicks.el b/erc-nicks.el
index a0d6d17..360b7fa 100644
--- a/erc-nicks.el
+++ b/erc-nicks.el
@@ -67,6 +67,7 @@
 ;;; Code:
 
 (require 'erc-button)
+(require 'erc-match)
 (require 'color)
 
 (defgroup erc-nicks nil
@@ -464,6 +465,10 @@ Favor a custom erc-nicks-NICK@NETWORK-face when defined."
                                               (erc-network-name) "-face")))
                    ((or (and (facep face) face)
                         (erc-nicks--revive face face nick (erc-network))))))
+        (let ((face (cond ((erc-match-pal-p nick t) 'erc-pal-face)
+                          ((erc-match-fool-p nick t) 'erc-fool-face)
+                          ((equal nick (erc-current-nick)) 'erc-my-nick-face))))
+          (puthash nick face table))
         (let ((color (erc-nicks--determine-color key))
               (new-face (make-symbol (concat "erc-nicks-" nick "-face"))))
           (put new-face 'erc-nicks--nick nick)
-- 
2.46.2