Others have told you how to code this: (mapc 'kill-buffer (buffer-list)) It doesn't get any easier than that. But here's a twist, FYI -
If you happen to use Icicles, there are multi-command versions of many common commands. For instance, `icicle-kill-buffer' is a multi-command version of `kill-buffer'. A multi-command acts just like a regular command (so it makes a good replacement), but you can also use it with completion to act on any number of things at once, selectively or indiscriminately - in this case, you can kill one or more buffers with a single invocation. You can use `C-mouse-2' to selectively pick them off in buffer *Completions*, or `C-next' to mow them down one by one, or simply `C-!' to kill them all. The buffers you can do this to are those that match your current input; if your input is empty, then all buffers match. You can use your input to first filter the list of buffers you want to act on - use a regexp if you like. If you first use `C-^' then you can include internal buffers (whose names start with a space). The same behavior holds for other multi-commands - visit buffers, files, or bookmarks; delete files; toggle user options;... whatever. Virtually any function you can define to act on one foobar you can easily turn into a multi-command to act on one or more foobars. Even if you never use the multi-command aspect and always act on just a single foobar, it's good to have around, it doesn't get in the way, and it's free. http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Multi-Commands
