Next: , Previous: , Up: Creating and Killing Buffers   [Index]


7.4.8.5 kill-buffer

Function: kill-buffer &optional buffer-or-name
BUFFER-OR-NAME

The buffer (or current buffer if the name is omitted) is killed, freeing all its memory.

Any processes that have this buffer as the process-buffer are sent the ‘SIGHUP’ (hangup) signal, which normally causes them to terminate.

If the buffer to be killed has unsaved changes, the user is asked to confirm. To prevent the request, clear the ‘modified’ flag before calling this function. See Modifying Buffers.

This function calls replace-buffer-in-windows for cleaning up all windows currently displaying the buffer to be killed.

RETURN VALUE

t is returned if the buffer is actually killed. ’nil’ is returned if the user refuses to confirm or if the buffer is already dead.