unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Trevor Arjeski <tmarjeski@gmail.com>
To: 73580@debbugs.gnu.org
Subject: bug#73580: 29.4; ERC 5.6.1-git: erc-nicks does not respect pal and fool faces
Date: Tue, 01 Oct 2024 20:56:17 +0300	[thread overview]
Message-ID: <8734lfogfy.fsf@gmail.com> (raw)
In-Reply-To: <87y13796p1.fsf@trevarch.mail-host-address-is-not-set> (Trevor Arjeski's message of "Tue, 01 Oct 2024 18:35:54 +0300")

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]


I did a bit more testing and realized that the problem is also occuring for erc-current-nick.

Here is an updated patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch fix v2 --]
[-- Type: text/x-patch, Size: 1486 bytes --]

From 88b01b15219d86aac2c8670f86d6001368bb04d1 Mon Sep 17 00:00:00 2001
From: Trevor Arjeski <tmarjeski@gmail.com>
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


  reply	other threads:[~2024-10-01 17:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-01 15:35 bug#73580: 29.4; ERC 5.6.1-git: erc-nicks does not respect pal and fool faces Trevor Arjeski
2024-10-01 17:56 ` Trevor Arjeski [this message]
2024-10-02  3:39 ` J.P.
     [not found] ` <87y137i36d.fsf@neverwas.me>
2024-10-02  7:40   ` Trevor Arjeski
     [not found]   ` <871q0zgdg6.fsf@gmail.com>
2024-10-02 22:47     ` J.P.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734lfogfy.fsf@gmail.com \
    --to=tmarjeski@gmail.com \
    --cc=73580@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).