Subject: bug#73150: [PATCH] Human readable last display time of killed buffer

From: Manuel Giraud <[email-masked]>
Date: Mon, 09 Sep 2024 17:23:57 +0200

Tags: patch

Hi,

This patch display a human readable version of `buffer-display-time'
when said buffer is selected to be killed.

In GNU Emacs 31.0.50 (build 23, x86_64-unknown-openbsd7.6) of 2024-09-07
 built on computer
Repository revision: 6dcd3d24045113fb0afec0d7f43e322c9baa06ab
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: OpenBSD computer 7.6 GENERIC.MP#311 amd64

Configured using:
 'configure CC=egcc CPPFLAGS=-I/usr/local/include
 LDFLAGS=-L/usr/local/lib MAKEINFO=gmakeinfo --prefix=/home/manuel/emacs
 --bindir=/home/manuel/bin --with-x-toolkit=no --without-cairo
 --without-compress-install'

>From 8f3f61105817a05218e0fde05e1dd0748579b17a Mon Sep 17 00:00:00 2001
From: Manuel Giraud <[email-masked]>
Date: Mon, 9 Sep 2024 17:16:32 +0200
Subject: [PATCH] Human readable last display time of killed buffer

* lisp/midnight.el (clean-buffer-list): Upon killing a buffer,
add a human readable last displayed information.
---
 lisp/midnight.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/midnight.el b/lisp/midnight.el
index bfa99d6a7a8..fc1e08f2189 100644
--- a/lisp/midnight.el
+++ b/lisp/midnight.el
@@ -179,7 +179,8 @@ clean-buffer-list
                     (and (buffer-file-name buf) (buffer-modified-p buf))
                     (get-buffer-window buf 'visible)
                     (< delay cbld))
-          (message "[%s] killing `%s'" ts bn)
+          (message "[%s] killing `%s' (last displayed %s ago)" ts bn
+                   (format-seconds "%Y, %D, %H, %M, %z%S" delay))
           (kill-buffer buf))))))
 
 ;;; midnight hook
-- 
2.46.0

-- 
Manuel Giraud