summaryrefslogtreecommitdiff
path: root/ibuffer.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-21 18:21:15 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-21 18:21:15 +0800
commite25238bafc9134d95d8343180511555b3a553ffc (patch)
tree4b627018ec219435d7558f7fba85660b5a25b47b /ibuffer.el
parentcb3eef4d198a5b38481f1b114e227539240e291c (diff)
ibuffer: add option to show the clear pass list
* ibuffer.el (durand-reset-clearlist): Add option to show the clear pass list.
Diffstat (limited to 'ibuffer.el')
-rw-r--r--ibuffer.el58
1 files 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")