Emacs: kill-buffer Induces Buffer Accumulation

By Xah Lee. Date:

This page discusses emacs user interface issue of the command kill-buffer.

In my usage pattern, i find that one problem of emacs default UI is that it makes it difficult to close a buffer.

To close a file, user calls kill-bufferCtrl+x k】 then Enter, and if it's not saved, one has to type full yes or no. Too many keystrokes. Also, when it's 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 At http://irreal.org/blog/?p=765

Emacs Modernization

  1. Simple Changes Emacs Should Adopt
  2. Why Emacs Keys are Painful
  3. Problems of the Scratch Buffer
  4. M-key Notation vs Alt+key Notation
  5. Menu Problem
  6. Mode Line Problem
  7. cua-mode Problems
  8. kill-buffer Induces Buffer Accumulation
  9. Emacs Form Feed ^L
  10. Inconsistency of Search Features
  11. Single Key to Delete Whole Line
  12. Emacs HTML Mode Sucks
  13. Emacs Does Not Support Viewing Images Files In Windows
  14. Emacs Spell Checker Problems
  15. Adopt HTML as Texinfo Replacement
  16. Support HTML Mail
  17. Problems of “man” Command
  18. Emacs Lisp Mode Syntax Coloring Problem
  19. Emacs Ahk Mode Problems
  20. Problems of Emacs's Manual
  21. Problems of Emacs's Manual; Examples
  22. Emacs: Have You Read Emacs Manual?
  23. Elisp: Ban Syntax Table
  24. Emacs: Make elisp-index-search use Current Symbol
  25. Emacs: Usability Problems of Mode Documentation
  26. Problems of Emacswiki
  27. Emacs GNU Texinfo Problems; Invalid HTML
  28. A Record of Frustration in IT Industry; Disappearing FSF URLs, 2006
  29. Emacs Manual Node Persistency Issues
  30. Emacs: dired-do-query-replace-regex Replace ALL (fixed)
  31. Problems of Emacs Supporting Obsolete Systems
  32. Elisp: Function to Copy/Delete a Dir Recursively (fixed)
  33. Thoughts on Common Lisp Scheme Lisp Based Emacs
  34. Text Editors Popularity and Market Research
  35. Text Editor's Cursor Movement Behavior (emacs, vi, Notepad++)
  36. GNU Emacs Development Inefficiency
  37. Emacs Dev Inefficiency and Emacs Web 2.0?
  38. Letter-Case Commands Usability Problems
  39. Emacs: Select Line, between Quotes, Extend Selection
  40. Emacs: isearch Current Word
  41. Suggestions on Line Wrap Commands
  42. Emacs: Single Key to Delete Whole Line
  43. Emacs Cult Problem: Emacs vs Windows Notepad
  44. Emacs Undo and Emacs Cult Problem

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs

Emacs

Emacs Lisp

Misc