all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 73047@debbugs.gnu.org
Subject: bug#73047: 30.0.90; feature request - add recency column to ibuffer
Date: Thu, 05 Sep 2024 17:28:09 +0200	[thread overview]
Message-ID: <87tteuglx2.fsf@daniel-mendler.de> (raw)

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!





             reply	other threads:[~2024-09-05 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 15:28 Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-09-05 16:36 ` bug#73047: 30.0.90; feature request - add recency column to ibuffer JD Smith
2024-09-05 17:00   ` Daniel Mendler via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tteuglx2.fsf@daniel-mendler.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73047@debbugs.gnu.org \
    --cc=mail@daniel-mendler.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.