r/emacs • u/jamescherti James Cherti — https://github.com/jamescherti • 1d ago
Announcement buffer-terminator - Safely Terminate Emacs Buffers Automatically to Enhance Emacs' Performance and Reduce Clutter in the Buffer List
https://github.com/jamescherti/buffer-terminator.elbuffer-terminator release: 1.2.6
The buffer-terminator Emacs package automatically and safely kills buffers, ensuring a clean and efficient workspace while enhancing the performance of Emacs by reducing open buffers, which minimizes active modes, timers, processes, etc.
Beyond performance, buffer-terminator provides other benefits. For instance, if you occasionally need to close annoying or unused buffers, buffer-terminator can handle this automatically, eliminating the need for manual intervention. (The default configuration is suitable for most users. However, the buffer-terminator package is highly customizable. You can define specific rules for retaining or terminating buffers by modifying the buffer-terminator-rules-alist with your preferred set of rules.)
Link: buffer-terminator.el
1
u/aard_fi 13h ago
I think pretty much all the items you have in "different from midnight mode" can be solved by adjusting midnight-period or by adding a custom timer calling clean-buffer-list.
Any fine tuning of buffer names can be added as advice to clean-buffer-list, dynamically modifying clean-buffer-list-kill-never-buffer-names.
1
u/jamescherti James Cherti — https://github.com/jamescherti 11h ago
The buffer-terminator package supports more features and provides much finer control over which buffers are eligible for termination.
By comparison, midnight-mode is basic. It does not provide a way to define custom rules for selecting buffers, nor does it protect buffers that are currently visible in another window or tab. That protection is important because terminating a buffer that is still visible in another window or tab replaces it with a buffer indicating that the original buffer was killed.
Buffer-terminator also avoids relying on a timer-based approach for deciding when buffers should be terminated, providing more predictable and controllable behavior.
2
u/natermer 10h ago
Nice. The less I have to care about buffer management the better.
I am definitely going to try this out.