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

From: "R. Diez" <[email-masked]>
Date: Sat, 16 Aug 2025 23:01:50 +0200

>> 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.

First of all, thanks for the hint. The 'message' function does not mention 'set-message-function' or the like, so I missed it.

I could find very little information about 'set-message-function', and no examples whatsoever, so I came up with this:

(defun my-message-function (msg)
   "" ; No docstring yet.
   (concat "Test: " msg))

(setq set-message-function #'my-message-function)

The effect is that messages in the minibuffer do get the "Test:" prefix, but messages in the *Messages* buffer do not.

But that is exactly the opposite of what I am trying to achieve!