From e25238bafc9134d95d8343180511555b3a553ffc Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 21 Jan 2022 18:21:15 +0800 Subject: ibuffer: add option to show the clear pass list * ibuffer.el (durand-reset-clearlist): Add option to show the clear pass list. --- ibuffer.el | 58 ++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/ibuffer.el b/ibuffer.el index 150d248..42c1480 100644 --- a/ibuffer.el +++ b/ibuffer.el @@ -99,29 +99,43 @@ automatically.") ;;;###autoload (defun durand-reset-clearlist (&optional arg) "Remove killed buffers from `durand-clear-passlist'. -If ARG is non-nil, reset `durand-clear-passlist' to -`durand-default-clear-passlist'." +If ARG is non-nil and not '(16), reset `durand-clear-passlist' to +`durand-default-clear-passlist'. + +If ARG is '(16), show the current contents of +`durand-clear-passlist'." (interactive "P") - (setq - durand-clear-passlist - (cond - ((null arg) - (delq nil - (mapcar - (lambda (buf) - (cond ((car (member buf durand-default-clear-passlist))) - ((and (stringp buf) - (get-buffer buf) - (buffer-live-p (get-buffer buf))) - buf) - ((and (bufferp buf) (buffer-live-p buf)) - buf))) - durand-clear-passlist))) - (durand-default-clear-passlist))) - (message "%s the clear list!" - (cond - ((null arg) "Removed killed buffers from") - ("Reset")))) + (cond + ((equal arg (cons 16 nil)) + (message "clear list: %s" + (mapconcat + (lambda (e) + (cond + ((bufferp e) (buffer-name e)) + (e))) + durand-clear-passlist + ", "))) + + ((setq + durand-clear-passlist + (cond + ((null arg) + (delq nil + (mapcar + (lambda (buf) + (cond ((car (member buf durand-default-clear-passlist))) + ((and (stringp buf) + (get-buffer buf) + (buffer-live-p (get-buffer buf))) + buf) + ((and (bufferp buf) (buffer-live-p buf)) + buf))) + durand-clear-passlist))) + (durand-default-clear-passlist))) + (message "%s the clear list!" + (cond + ((null arg) "Removed killed buffers from") + ("Reset")))))) (autoload #'durand-member "common.el") -- cgit v1.2.3-18-g5258