Subject: bug#79253: Add timestamps to *Messages*

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Aug 2025 12:19:54 +0300

> Date: Fri, 15 Aug 2025 21:40:39 +0200
> From:  "R. Diez" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Hi all:
> 
> I am trying to debug a Tramp problem, and I need associate Tramp debug log entries with entries in the *Messages* buffer.
> 
> This is hard to do, because the *Messages* buffer has no timestamps.
> 
> Some other people have had this problem before:
> 
> https://emacs.stackexchange.com/questions/32150/how-to-add-a-timestamp-to-each-entry-in-emacs-messages-buffer
> 
> The trouble is, there is not one solution, but a few of them, with different activation procedures. I gets complicated because minibuffer vs *Messages*, and because of the "[3 times]" markers upon repetition.
> 
> I am not very proficient at Lisp, and I couldn't make it out. The "advice" method is a kludge anyway.
> 
> Could you implement an easy way to add timestamps to the *Messages* buffer?

Did you try using set-message-function to install your function as the
one that adds a time stamp to the text of the message to be shown?  If
you tried, and it didn't work, please tell what didn't work.  If you
didn't try, please do.