Reputation: 24771
What's the easiest way to close a buffer in emacs? This would be synonymous with closing an actual file, right? It would probably prompt you to save, if necessary.
I found this in the Emacs help:
s-^ kill-some-buffers
But I don't know how to invoke that or what it means.
Upvotes: 2
Views: 254
Reputation: 18008
kill-buffer
, which is usually bound to C-x k
:
C-x k
runs the commandkill-buffer
, which is an interactive built-in function in `C source code'.It is bound to
C-x k
.
(kill-buffer &optional BUFFER-OR-NAME)
Kill the buffer specified by
BUFFER-OR-NAME
. The argument may be a buffer or the name of an existing buffer. Argumentnil
or omitted means kill the current buffer. Returnt
if the buffer is actually killed,nil
otherwise.The functions in
kill-buffer-query-functions
are called with the buffer to be killed as the current buffer. If any of them returns nil, the buffer is not killed. The hookkill-buffer-hook
is run before the buffer is actually killed. The buffer being killed will be current while the hook is running. Functions called by any of these hooks are supposed to not change the current buffer.Any processes that have this buffer as the
process-buffer
are killed withSIGHUP
. This function callsreplace-buffer-in-windows
for cleaning up all windows currently displaying the buffer to be killed.
Upvotes: 2