1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00

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.
This commit is contained in:
Olivier Certner 2021-01-14 18:36:08 +01:00 committed by Amin Bandali
parent 3df279aae2
commit 291bcb5973
No known key found for this signature in database
GPG Key ID: 8B44A0CDC7B956F2

View File

@ -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)))