-If `erc-track-faces-priority-list' is set, the one from FACES who is
-first in that list will be used."
- (let ((candidates erc-track-faces-priority-list)
- candidate face)
- (while (and candidates (not face))
- (setq candidate (car candidates)
- candidates (cdr candidates))
- (when (memq candidate faces)
- (setq face candidate)))
- face))
+If `erc-track-faces-priority-list' is set, the one from FACES who
+is first in that list will be used. If nothing matches or if
+`erc-track-faces-priority-list' is not set, the default mode-line
+faces will be used.
+
+If `erc-track-faces-normal-list' is non-nil, use it to produce a
+blinking effect that indicates channel activity when the first
+element in FACES and the highest-ranking face among the rest of
+FACES are both members of `erc-track-faces-normal-list'.
+
+If one of the faces is a list, then it will be ranked according
+to its highest-tanking face member. A list of faces including
+that member will take priority over just the single member
+element."
+ (let ((choice (catch 'face
+ (dolist (candidate erc-track-faces-priority-list)
+ (when (member candidate faces)
+ (throw 'face candidate)))))
+ (no-first (and erc-track-faces-normal-list
+ (catch 'face
+ (dolist (candidate erc-track-faces-priority-list)
+ (when (member candidate (cdr faces))
+ (throw 'face candidate)))))))
+ (cond ((null choice)
+ nil)
+ ((and (member choice erc-track-faces-normal-list)
+ (member no-first erc-track-faces-normal-list))
+ no-first)
+ (t
+ choice))))