diff options
| author | JSDurand <mmemmew@gmail.com> | 2026-05-22 12:55:19 +0800 |
|---|---|---|
| committer | JSDurand <mmemmew@gmail.com> | 2026-05-22 12:55:19 +0800 |
| commit | 7e67f66bdafcedebeeed45bc0403354d15d2b6fd (patch) | |
| tree | 68f5e9a358762b46d35e041ba73fd25709e1db2e /ibuffer.el | |
| parent | e01a186e9292373a774eb4708d6a2fcd404333ba (diff) | |
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.
Diffstat (limited to 'ibuffer.el')
| -rw-r--r-- | ibuffer.el | 37 |
1 files changed, 33 insertions, 4 deletions
@@ -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 |
