From 7e67f66bdafcedebeeed45bc0403354d15d2b6fd Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 22 May 2026 12:55:19 +0800 Subject: ibuffer: add a new display option * ibuffer.el (durand-reset-clearlist): Now an arg of '(64) triggers the display of the clear list in a temporary window showing all the buffers in the list along with their live status. Maybe we can add more status to show in the future. As a note, an arg of (list 64) usually means triggering the universal argument function thrice. --- ibuffer.el | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/ibuffer.el b/ibuffer.el index 5f7f614..f09aa7b 100644 --- a/ibuffer.el +++ b/ibuffer.el @@ -99,11 +99,14 @@ automatically.") ;;;###autoload (defun durand-reset-clearlist (&optional arg) "Remove killed buffers from `durand-clear-passlist'. -If ARG is non-nil and not '(16), reset `durand-clear-passlist' to -`durand-default-clear-passlist'. +If ARG is non-nil, not '(64), and not '(16), reset +`durand-clear-passlist' to `durand-default-clear-passlist'. If ARG is '(16), show the current contents of -`durand-clear-passlist'." +`durand-clear-passlist'. + +If ARG is '(64), for each buffer in `durand-clear-passlist', show +whether it is a live buffer and its name as a list of cons cells." (interactive "P") (cond ((equal arg (cons 16 nil)) @@ -115,7 +118,33 @@ If ARG is '(16), show the current contents of (e))) durand-clear-passlist ", "))) - + ((equal arg (cons 64 nil)) + (let ((result (string))) + (mapc + (lambda (b) + (cond + ((bufferp b) + (setq + result + (format + "%s\n%s: %s" + result + (buffer-name b) + (cond ((buffer-live-p b) "live") ("not live"))))) + ((stringp b) + (setq + result + (format + "%s\n%s: %s" + result b + (cond ((buffer-live-p (get-buffer b)) "live") + ("not live"))))) + ((setq + result + (format "%s\n%S: %s" result b "unknown"))))) + durand-clear-passlist) + (with-temp-buffer-window "*durand clear list*" nil nil + (princ result)))) ((setq durand-clear-passlist (cond -- cgit v1.2.3-18-g5258