Modify my/kill-some-buffers

This commit is contained in:
Alexander Rosenberg 2024-11-07 22:06:44 -08:00
parent a0249716b6
commit e7392c6c09
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -269,6 +269,7 @@ PRED is nil, the value of `my/kill-some-buffers-default-pred' is used."
;; we already ask, no need to do it again ;; we already ask, no need to do it again
(let ((kill-buffer-query-functions nil) (let ((kill-buffer-query-functions nil)
(all-action (when auto-unmod 'unmod)) (all-action (when auto-unmod 'unmod))
(had-valid-buffer)
(ask-again-buffers) (ask-again-buffers)
(to-kill)) (to-kill))
(cl-flet ((ask-about (buffer allow-unmod) (cl-flet ((ask-about (buffer allow-unmod)
@ -312,7 +313,10 @@ PRED is nil, the value of `my/kill-some-buffers-default-pred' is used."
(dolist (buffer (buffer-list)) (dolist (buffer (buffer-list))
(when (and (not (my/kill-some-buffers-excluded-buffer-p buffer)) (when (and (not (my/kill-some-buffers-excluded-buffer-p buffer))
(funcall (or pred my/kill-some-buffers-default-pred) buffer)) (funcall (or pred my/kill-some-buffers-default-pred) buffer))
(setq had-valid-buffer t)
(act-on (ask-about buffer t) buffer t))) (act-on (ask-about buffer t) buffer t)))
(unless had-valid-buffer
(message "Nothing to do..."))
(setq all-action nil) (setq all-action nil)
(dolist (buffer ask-again-buffers) (dolist (buffer ask-again-buffers)
(act-on (ask-about buffer nil) buffer nil)) (act-on (ask-about buffer nil) buffer nil))