From: Olivier Certner Date: Thu, 14 Jan 2021 17:36:08 +0000 (+0100) Subject: ERC: Track: Fix a perceived minor bug in mode line face selection X-Git-Tag: emacs-28.0.90~1053 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=291bcb5973230c36f9cec6f9fa91b553d944ccd2;p=emacs.git 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 overridden with an older one (in FACES' rest), as if it had happened after. --- diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 7b9a2e9cd5b..2582a5039a6 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -818,18 +818,15 @@ is in `erc-mode'." (cons (cons (current-buffer) (cons 1 (erc-track-select-mode-line-face - (car faces) (cdr faces)))) + 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-mode-line-face + old-face faces))) (setcdr cell (cons (1+ (cadr cell)) new-face))))) ;; And display it (erc-modified-channels-display)))