Emacs Flaw: kill-buffer Command Induces Buffer Accumulation
kill-buffer Command Induces Buffer Accumulation
This page discusses emacs user interface issue of the command kill-buffer.
In my usage pattern, i find that one problem of emacs default User interface is that it makes it difficult to close a buffer.
To close a file, user calls kill-buffer 【Ctrl+x k】 then Enter, and if it's not saved, one has to type full yes or no. Too many keystrokes. Also, when it is the “*scratch*” or buffer not associated with file, it doesn't ask for save.
These issues induce people not want to close buffer.
So, buffer accumulates.
Instead of closing files we don't need, people use {bury-buffer, switch-to-buffer}, even though we just want to close it.
Tens or hundreds of buffers became a problem, then, {kill-some-buffers, clean-buffer-list, ido-mode}, are invented to solve this new problem.
By habit, i always close buffers that i'm done working with.
I did that for the past decade, even if it means painfully using kill-buffer.
So, usually i have no more than 20 buffers open.
In past years, with ErgoEmacs Keybinding and my own AutoHotkey setup, i have single key to close buffer, and with just y/n if unsaved.
This also makes switching to next/prev buffer much more useful (both are single key), much like switching tabs in a web browser.
This post is inspired by jcs's blog The Emacs clean-buffer-list Command @ http://irreal.org/blog/?p=765
Xah Talk Show
- Emacs. do you kill buffer you don't use anymore. (17:27)
- https://youtu.be/9Q4lb01i0Sw?t=1047
- Xah Talk Show 2025-11-23 Ep716 Emacs Lisp Call Python Markdown to HTML