summaryrefslogtreecommitdiff
path: root/ibuffer.el
diff options
context:
space:
mode:
Diffstat (limited to 'ibuffer.el')
-rw-r--r--ibuffer.el28
1 files changed, 24 insertions, 4 deletions
diff --git a/ibuffer.el b/ibuffer.el
index f270a69..4944c3a 100644
--- a/ibuffer.el
+++ b/ibuffer.el
@@ -97,10 +97,30 @@ automatically.")
(setq durand-clear-passlist durand-default-clear-passlist)
;;;###autoload
-(defun durand-reset-clearlist ()
- "Reset `durand-clear-passlist' to `durand-default-clear-passlist'."
- (interactive)
- (setq durand-clear-passlist durand-default-clear-passlist))
+(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'."
+ (interactive "P")
+ (setq
+ durand-clear-passlist
+ (cond
+ ((null arg)
+ (delq nil
+ (mapcar
+ (lambda (buf)
+ (cond ((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")