Subject: bug#73047: closed (Re: bug#73047: 31; [PATCH] - add recency column to ibuffer)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 11 Jan 2025 13:07:02 +0000

Your bug report

#73047: 30.0.90; feature request - add recency column to ibuffer

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
73047: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73047
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#73047: 31; [PATCH] - add recency column to ibuffer
From: Eli Zaretskii <[email-masked]>
To: Daniel Mendler <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 11 Jan 2025 15:06:38 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Daniel Mendler <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 11 Jan 2025 13:24:05 +0100
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Cc: JD Smith <[email-masked]>
> >> Date: Sat, 28 Dec 2024 13:50:20 +0100
> >> From:  Daniel Mendler via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <[email-masked]>
> >> 
> >> Daniel Mendler <[email-masked]> writes:
> >> 
> >> > I've attached a patch to this mail which adds a recency column to
> >> > Ibuffer. It uses the `seconds-to-string' function with the READABLE
> >> > argument.
> >> 
> >> Please disregard the earlier patch, which was a wrong version.  I've
> >> attached a better patch to this mail.  Thanks.
> >
> > Thanks.  Should this be called out in NEWS?
> 
> Yes. I've added an entry to the NEWS file. See the updated patch
> attached to this mail. Thanks.

Thanks, installed on the master branch, and closing the bug.

Subject: 30.0.90; feature request - add recency column to ibuffer
From: Daniel Mendler <[email-masked]>
To: [email-masked]
Date: Thu, 05 Sep 2024 17:28:09 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear Emacs maintainers,

I want to propose the addition of an optional recency column to Ibuffer,
which shows the last buffer display time. Sorting by recency is already
supported by Ibuffer (ibuffer-do-sort-by-recency). I use the following
code in my configuration:

(defvar-keymap ibuffer-recency-header-map
  "<mouse-1>" #'ibuffer-do-sort-by-recency)
  
(define-ibuffer-column recency
  (:inline t :summarizer ignore :header-mouse-map ibuffer-recency-header-map)
  (if-let ((time (buffer-local-value 'buffer-display-time buffer)))
      (progn
        (require 'marginalia)
        (marginalia--time (buffer-local-value 'buffer-display-time buffer)))
    "never"))

The time string is formatted in a human readable form, relative to to
the current time, e.g., "2 mins ago", "30 secs ago" or "never". I use
the function from the Marginalia package from GNU ELPA for formatting
right now. As far as I know Emacs does not yet provide a relative time
formatting function? Maybe there is interest in adding marginalia--time
to Emacs, e.g., with the name format-time-relative? As far as I know,
multiple packages define a similar formatting function, such that we
could potentially get some code reuse. The function could be ported
back via Compat to make it available to ELPA packages.

Thank you!