I was wondering if it is possible to have a column in Ibuffer that shows the last viewing time.

In the default view I can see these columns:

MR Name                    Size Mode             Filename/Process
-- ----                    ---- ----             ----------------

And with s v the buffers are sorted by last viewing time.
I would be interested in having a column with the value of last viewing/editing time, for example: 20secs, 14min, 1h 23min, 1day 2h 34min, etc...

  • How are you defining "viewing time"? Since it was last in a window? For that I suspect you'd need to use window-configuration-change-hook to track the visible buffers at each change, compare the current set with the previously-visible set, and set a timestamp for any buffer which has just disappeared from view. You could look at (or build directly on top of) winner.el (which provides some tangentially-related functionality). – phils Mar 30 '17 at 2:14
  • The ibuffer-formats user option controls what you see in ibuffer, so whichever values you wish to display, you would utilise that to display them. – phils Mar 30 '17 at 2:20
  • 1
    Combine define-ibuffer-column with get-buffer-window and buffer-display-time. – politza Mar 30 '17 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.