Several emacs extensions create "junk" buffers, and I have to manually remove them from various buffer lists.
Emacs has a concept of "hidden buffers", which is used for instance for the minibuffer.
How can I make an arbitrary buffer a hidden buffer?
C-x k ( kill-buffer ) kills one buffer, whose name you specify in the minibuffer. The default, used if you type just RET in the minibuffer, is to kill the current buffer.
Most buffers are created by visiting files, or by Emacs commands that want to display some text, but you can also create a buffer explicitly by typing C-x b bufname RET . This makes a new, empty buffer that is not visiting any file, and selects it for editing. Such buffers are used for making notes to yourself.
Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer. See Text.
Emacs does have a concept of uninteresting/hidden buffers - and designates them as such by making their names begin with a space. See the documentation for buffer names. You can make a buffer "uninteresting" by changing its name to begin with a space.
Try M-x make-buffer-uninteresting:
(defun make-buffer-uninteresting ()
"rename the current buffer to begin with a space"
(interactive)
(unless (string-match-p "^ " (buffer-name))
(rename-buffer (concat " " (buffer-name)))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With