LoginSignup
4
5

More than 5 years have passed since last update.

変更されてないバッファーを全部閉じる el

Last updated at Posted at 2014-03-31

変更されてないバッファーを全部閉じる。ただし、*...* 名(scratch など)は除く。

(defun my-close-all-unmodified-buffer ()
  (interactive)
  (let ((buffers (buffer-list)))
    (mapcar
     #'(lambda (buf)
         (if (and (not (buffer-modified-p buf))
                  (not (string-match "^\\*.+\\*$" (buffer-name buf))))
             (kill-buffer buf)))
     buffers)
    ))
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5