From: Eli Zaretskii Date: Sat, 1 Jul 2023 08:34:43 +0000 (+0300) Subject: Fix total count of messages in Rmail summary buffers X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c7f92f25c39137b5ddc2872597434fd5a3b38e9;p=emacs.git Fix total count of messages in Rmail summary buffers * lisp/mail/rmailsum.el (rmail-new-summary-1): Actually count the messages in the summary buffer instead of relying on 'rmail-total-messages'. Reported by Andrea Monaco . --- diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 21dec2bbeb7..e3a6c16933b 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -742,13 +742,14 @@ message." (setq rmail-summary-buffer nil))) (save-excursion (let ((rbuf (current-buffer)) - (total rmail-total-messages)) + (total 0)) (set-buffer sumbuf) ;; Set up the summary buffer's contents. (let ((buffer-read-only nil)) (erase-buffer) (while summary-msgs (princ (cdr (car summary-msgs)) sumbuf) + (setq total (1+ total)) (setq summary-msgs (cdr summary-msgs))) (goto-char (point-min))) ;; Set up the rest of its state and local variables.