(emacs)Kill Buffer

Next: Several Buffers Prev: Misc Buffer Up: Buffers

Killing Buffers

   If you continue an Emacs session for a while, you may accumulate a
large number of buffers.  You may then find it convenient to "kill" the
buffers you no longer need.  On most operating systems, killing a
buffer releases its space back to the operating system so that other
programs can use it.  There are several commands for killing buffers:

     Kill buffer BUFNAME (`kill-buffer').

`M-x kill-some-buffers'
     Offer to kill each buffer, one by one.

   `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.  If you kill the current
buffer, another buffer is selected; one that has been selected recently
but does not appear in any window now.  If you ask to kill a buffer
that is modified (has unsaved editing), then you must confirm with
`yes' before the buffer is killed.

   The command `M-x kill-some-buffers' asks about each buffer, one by
one.  An answer of `y' means to kill the buffer.  Killing the current
buffer or a buffer containing unsaved changes selects a new buffer or
asks for confirmation just like `kill-buffer'.

   If you want to do something special every time a buffer is killed,
you can add hook functions to the hook `kill-buffer-hook' (*note

automatically generated by info2www