gnu.emacs.help
[Top] [All Lists]

Re: how can i kill all the buffers

Subject: Re: how can i kill all the buffers
From: "RealityMonster"
Date: 31 Jan 2007 17:02:09 -0800
Newsgroups: gnu.emacs.help
On Jan 30, 8:19 am, "step" <fxl...@xxxxxxxxx> wrote:
>  1. this is any command to kill all buffers ,not close the emacs
>
>  2. if only i  want to close the buffers of some mode (ep: c
> files),can i do it?
>
>  3x

I took kill-some-buffers and modified it a bit.

(defun kill-all-buffers (&optional list)
  "For each buffer in LIST, kill it. If it's been modified don't do
anything.
LIST defaults to all existing live buffers."
  (interactive)
  (if (null list)
      (setq list (buffer-list)))
  (while list
    (let* ((buffer (car list))
           (name (buffer-name buffer)))
      (and (not (string-equal name ""))
           (/= (aref name 0) ? )
           (if (not (buffer-modified-p buffer)) t )
           (kill-buffer buffer)))
    (setq list (cdr list))))

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@xxxxxxx
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

<Prev in Thread] Current Thread [Next in Thread>
  • Re: how can i kill all the buffers, RealityMonster <=