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: Marc Tfardy
Subject: Re: how can i kill all the buffers
Date: Tue, 30 Jan 2007 18:06:17 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

step schrieb:
>  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?

Maybe something like this:?


(defun kill-major-mode-buffer (mode)
  "Kills current buffer when major mode is MODE."
  (if (eq (cdr (assoc 'major-mode (buffer-local-variables))) mode)
      (kill-buffer (current-buffer))))

(defun kill-all-major-mode-buffer (mode)
  "Kills all buffer when major mode is MODE."
  (interactive "SMode: ")
  (mapc (lambda (buffer)
            (progn
              (set-buffer buffer)
              (kill-major-mode-buffer mode))) (buffer-list)))

HTH

regards

Marc



reply via email to

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