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

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

Re: kill buffers according to regex


From: Matthew Huggett
Subject: Re: kill buffers according to regex
Date: Tue, 18 Jan 2005 13:54:57 +0900 (JST)

>    From: Henrik Enberg <henrik.enberg@telia.com>
>    Newsgroups: gnu.emacs.help
>    Date: Mon, 17 Jan 2005 20:45:04 +0100
>    Organization: Le Petomane Appreciation Society
>    Content-Type: text/plain; charset=us-ascii
>    X-Now-Playing: Raphael Saadiq - People (feat. Randy Wiggins)
>    Cancel-Lock: sha1:YUenTuCzvhgTBBft1K7Cymf+e6k=
>    Xref: shelby.stanford.edu gnu.emacs.help:127947
>    Sender: help-gnu-emacs-bounces+mhuggett=zam.att.ne.jp@gnu.org
> 
>    Matthew Huggett <mhuggett@zam.att.ne.jp> writes:
> 
>    > Hello all,
>    >
>    > Is there any built-in command to kill all buffers that match a
>    > regex?
> 
>    (defun kill-buffers-matching (regexp)
>      (interactive "sKill buffers matching: ") (dolist (i
>      (buffer-list))
>        (when (string-match regexp (buffer-name i))
>          (kill-buffer i))))

Thank you very much for this Henrik.  I figured I'd have to use
buffer-list but wasn't sure of how to go about it.

Anyway, while I'm writing, as an Emacs/Elisp novice, I find this list
to be quite a friendly, helpful place, so thanks to all you more
experienced users for sharing your knowledge.


Regards,

Matthew





reply via email to

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