Subject: Re: bug#60795: 28.2; `diary-list-entries' hides the interesting message done in `diary-display-no-entries'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Jan 2023 15:13:04 +0200

> Date: Fri, 13 Jan 2023 22:54:17 +0100
> From:  "Farblos" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> `diary-list-entries' hides the interesting status message done in
> `diary-display-no-entries' ("No diary entries for %s") with a less
> important progress message ("Preparing diary...done").
> 
> To reproduce:
> 
>   # ensure you do not clobber anything important ...
>   $ test -f ~/.emacs/diary && mv ~/.emacs/diary ~/.emacs/diary.bak
>   $ cp /dev/null ~/.emacs/diary
>   $ emacs -Q
>   M-x diary RET
> 
> Observe the minibuffer showing "Preparing diary...done" and check the
> message buffer to find the really relevant message "No diary entries for
> Friday, January 13, 2023" issued just before that.
> 
> This used to work at least in Emacs, well, 23.4.1.

Thank you for your report.

Does the patch below give good results?

diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index b90ed71..80fc66f 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -880,7 +880,10 @@ diary-list-entries
                                    (original-date original-date))
                     (run-hooks 'diary-hook))))))
         (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff)))
-      (or d-incp (message "Preparing diary...done"))
+      (or d-incp
+          ;; Don't clobber messages displayed by preparing the diary.
+          (not (equal (current-message) "Preparing diary..."))
+          (message "Preparing diary...done"))
       diary-entries-list)))
 
 (defun diary-unhide-everything ()