help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how can i kill all the buffers


From: RealityMonster
Subject: Re: how can i kill all the buffers
Date: 31 Jan 2007 17:02:09 -0800
User-agent: G2/1.0

On Jan 30, 8:19 am, "step" <fxl...@gmail.com> 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))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]