Here\'s my problem: I use Emacs and get lots of buffers that are pretty useless all the time, like *Messages* or *Completions*.
I want to bind \\C-y to close all buf
An alternate approach:
(require 'cl)
(defun is-useless-buffer (buffer)
(let ((name (buffer-name buffer)))
(and (= ?* (aref name 0))
(not (string-match "^\\*shell\\*" name)))))
(defun kill-useless-buffers ()
(interactive)
(loop for buffer being the buffers
do (and (is-useless-buffer buffer) (kill-buffer buffer))))