Subject: bug#45912: 28.0.50; RMAIL-summary changes colors after 99,999th message

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Jan 2021 11:02:00 +0200

> From: "Andrea G. Monaco" <[email-masked]>
> Date: Fri, 15 Jan 2021 23:12:03 +0100
> 
> my RMAIL-summary buffer uses different colors after the 99,999th
> message.
> Before, it uses green for unread messages and black for read ones, as
> usual. From the 100,000th onwards, it uses normal black for unread; read
> ones are displayed in usual black, except for the first 5 characters of
> the second field (date) which are blue.

It's clear that Rmail didn't expect to see more than 99999 messages in
any mail folder.

Does the patch below fix the issue?

diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 60b67ed..d29115a 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -51,10 +51,10 @@ rmail-summary-line-count-flag
   :group 'rmail-summary)
 
 (defvar rmail-summary-font-lock-keywords
-  '(("^.....D.*" . font-lock-string-face)			; Deleted.
-    ("^.....-.*" . font-lock-type-face)				; Unread.
+  '(("^ *[0-9]+D.*" . font-lock-string-face)			; Deleted.
+    ("^ *[0-9]+-.*" . font-lock-type-face)			; Unread.
     ;; Neither of the below will be highlighted if either of the above are:
-    ("^.....[^D-] \\(......\\)" 1 font-lock-keyword-face)	; Date.
+    ("^ *[0-9]+[^D-] \\(......\\)" 1 font-lock-keyword-face)	; Date.
     ("{ \\([^\n}]+\\) }" 1 font-lock-comment-face))		; Labels.
   "Additional expressions to highlight in Rmail Summary mode.")