From 1d4abfa935b1a5f5eb0c6ff7b3c82ebb46747653 Mon Sep 17 00:00:00 2001 From: Olivier Certner Date: Thu, 14 Jan 2021 18:36:08 +0100 Subject: [PATCH 4/4] ERC: Track: Fix a perceived minor bug in mode line face selection * lisp/erc/erc-track.el (erc-track-modified-channels): Fix what is a probable bug when a new insert event happens for a buffer that was not tracked or for which no mode line face was selected: In this case, stop treating the latest buffer's face (first in list) as the previous one, which could be overriden with an older one (in FACES' rest), as if it had happened after. --- lisp/erc/erc-track.el | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index d63028cfeb..e9bc77dea0 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -811,21 +811,14 @@ erc-track-modified-channels ;; Add buffer, faces and counts (setq erc-modified-channels-alist (cons (cons (current-buffer) - (cons 1 (erc-track-select-mode-line-face - (car faces) - (cdr faces)))) + (cons 1 (erc-track-select-face nil faces))) erc-modified-channels-alist)) ;; Else modify the face for the buffer, if necessary. (when faces (let* ((cell (assq (current-buffer) erc-modified-channels-alist)) (old-face (cddr cell)) - (new-face (if old-face - (erc-track-select-mode-line-face old-face - faces) - (erc-track-select-mode-line-face - (car faces) - (cdr faces))))) + (new-face (erc-track-select-face old-face faces))) (setcdr cell (cons (1+ (cadr cell)) new-face))))) ;; And display it (erc-modified-channels-display))) -- 2.30.0