unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: david@adboyd.com (J. David Boyd)
Subject: Re: If exists, Kill buffer
Date: Fri, 07 Oct 2005 12:32:08 -0400	[thread overview]
Message-ID: <m3zmplwanr.fsf@jdb.homelinux.org> (raw)
In-Reply-To: 20051007162552.GD1784@johnsons-web.com

Tim Johnson <tim@johnsons-web.com> writes:

> I need a function that will kill a (named) buffer if it exists.
> 1)Is there one?
>   a)If not, I will need a function that checks for the existance
>     of a buffer by name.
>   b)Is there one?
> Pointers to docs, resources welcomed.
> tim
>
> --
> Tim Johnson <tim@johnsons-web.com>
>       http://www.alaska-internet-solutions.com



I don't recall where I came by this, on this group probably...


(defun kill-buffers-matching (regexp)
  (interactive "sKill buffers matching: ")
  (dolist (i
	   (buffer-list))
    (when (string-match regexp (buffer-name i))
      (kill-buffer i))))



Dave in Largo, FL

  reply	other threads:[~2005-10-07 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-07 16:25 If exists, Kill buffer Tim Johnson
2005-10-07 16:32 ` J. David Boyd [this message]
2005-10-07 16:34 ` Lennart Borgman
2005-10-07 16:37 ` Slawomir Nowaczyk
2005-10-07 16:53   ` Tim Johnson
2005-10-07 20:15     ` Slawomir Nowaczyk
2005-10-07 20:23       ` Edward O'Connor
2005-10-07 22:16         ` Slawomir Nowaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3zmplwanr.fsf@jdb.homelinux.org \
    --to=david@adboyd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).