A bunch of creating and killing buffers in my setup and I can't track down what is it. Here is my debug code:
(add-hook 'kill-buffer-hook
(lambda() (message "Killed: %s / %s" major-mode (buffer-name))))
which results in something like this:
Killed: fundamental-mode / *temp* [170 times]
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp* [234 times]
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp*
Killed: fundamental-mode / *string-output*
Killed: fundamental-mode / *temp* [220 times]
Sometimes it peaks a dozen a second. I swapped my .emacs.d
with a Doom setup (my current is a Spacemacs heavily tuned) and those killings still happen, but seldom. Especially when idle, nothing is observed, while with my setup it's this very frequent and comes in batches. It's causing lots of slow downs, cursor movements are the main culprit, generating more than a bunch per move.
(backtrace)
or(backtrace-frames)
to discover the call stack at any given point.M-x debug-on-entry RET kill-buffer
, and look at the backtrace. Thendebug-on-entry
a function that seems to be initiating thekill-buffer
calls, instead ofkill-buffer
itself.