aboutsummaryrefslogtreecommitdiff
path: root/modules/undead-buffers.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/undead-buffers.el')
-rw-r--r--modules/undead-buffers.el36
1 files changed, 30 insertions, 6 deletions
diff --git a/modules/undead-buffers.el b/modules/undead-buffers.el
index 21a04de9..e6574a0e 100644
--- a/modules/undead-buffers.el
+++ b/modules/undead-buffers.el
@@ -31,7 +31,25 @@
(defvar cj/undead-buffer-list
'("*scratch*" "*EMMS-Playlist*" "*Messages*" "*ert*"
- "*AI-Assistant*")
+ "*AI-Assistant*"
+ ;; *Warnings* stays alive because Emacs 31's warnings.el defers daemon
+ ;; startup warnings into an `after-make-frame-functions' closure that
+ ;; holds this buffer object until the first client frame. The startup
+ ;; sweep in `cj/dashboard-only' used to kill it; the closure then failed
+ ;; inside `make-frame', server.el reported the window system as
+ ;; unsupported, and emacsclient silently retried on $DISPLAY, so the first
+ ;; frame of every 31.1 session opened on XWayland. I bury it instead, the
+ ;; same choice desktop.el makes in `desktop-clear-preserve-buffers'.
+ "*Warnings*"
+ ;; The async native-compile log stays alive for the same reason, one
+ ;; buffer over. comp-run parks every compile worker on this buffer and
+ ;; the worker's sentinel reads it back before starting the next job.
+ ;; The startup sweep killed it, which SIGHUPs every :noquery worker under
+ ;; it; each sentinel then died in `with-current-buffer' on the dead
+ ;; buffer and `comp--run-async-workers' never ran again, so the queue
+ ;; sat stranded for the life of the daemon, nothing was ever cached, and
+ ;; every boot re-ran the same compile storm at the first frame.
+ "*Async-native-compile-log*")
"Buffer names to bury instead of killing (exact match).")
(defvar cj/undead-buffer-regexps nil
@@ -96,7 +114,10 @@ Undead-buffers are buffers in `cj/undead-buffer-list'."
(let ((buf (current-buffer)))
(unless (one-window-p)
(delete-window))
- (cj/kill-buffer-or-bury-alive buf)))
+ ;; The delegate reads current-prefix-arg; a C-u meant for this wrapper
+ ;; must not flip it into add-to-undead-list mode.
+ (let ((current-prefix-arg nil))
+ (cj/kill-buffer-or-bury-alive buf))))
;; Keybinding moved to custom-buffer-file.el (C-; b k)
(defun cj/kill-other-window ()
@@ -109,7 +130,8 @@ window and acting would kill the buffer being viewed."
(other-window 1)
(let ((buf (current-buffer)))
(delete-window)
- (cj/kill-buffer-or-bury-alive buf)))
+ (let ((current-prefix-arg nil))
+ (cj/kill-buffer-or-bury-alive buf))))
(keymap-global-set "M-S-o" #'cj/kill-other-window)
(defun cj/kill-other-window-buffer ()
@@ -123,7 +145,8 @@ split is preserved. Buffers in `cj/undead-buffer-list' are buried."
(if (one-window-p)
(user-error "No other window")
(with-selected-window (next-window)
- (cj/kill-buffer-or-bury-alive (current-buffer)))))
+ (let ((current-prefix-arg nil))
+ (cj/kill-buffer-or-bury-alive (current-buffer))))))
;; Keybinding in custom-buffer-file.el (C-; b K)
(defun cj/kill-all-other-buffers-and-windows ()
@@ -131,8 +154,9 @@ split is preserved. Buffers in `cj/undead-buffer-list' are buried."
(interactive)
(save-some-buffers nil #'cj/undead-buffer-p)
(delete-other-windows)
- (mapc #'cj/kill-buffer-or-bury-alive
- (delq (current-buffer) (buffer-list))))
+ (let ((current-prefix-arg nil))
+ (mapc #'cj/kill-buffer-or-bury-alive
+ (delq (current-buffer) (buffer-list)))))
(keymap-global-set "M-S-m" #'cj/kill-all-other-buffers-and-windows) ;; was M-M
(provide 'undead-buffers)