Skip to content

Instantly share code, notes, and snippets.

@kobapan
Last active October 11, 2017 08:30
Show Gist options
  • Save kobapan/d9c78f636a1bb75001a1 to your computer and use it in GitHub Desktop.
Save kobapan/d9c78f636a1bb75001a1 to your computer and use it in GitHub Desktop.
elisp カレントバッファ以外の全てのバッファを閉じる
(defun kill-other-buffers ()
"Kill all other buffers."
(interactive)
(let ((exclude '("*scratch*" "*Messages*")))
(mapc (lambda (b)
(let ((buf (buffer-name b)))
(unless (member buf exclude)
(kill-buffer buf))))
(delq (current-buffer) (buffer-list)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment