all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* kill buffers according to regex
@ 2005-01-17  7:15 Matthew Huggett
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Huggett @ 2005-01-17  7:15 UTC (permalink / raw)


Hello all,

Is there any built-in command to kill all buffers that match a regex?

thanks,

Matthew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
       [not found] <mailman.13610.1105947021.27204.help-gnu-emacs@gnu.org>
@ 2005-01-17 19:13 ` drkm
  2005-01-18  4:07   ` Matthew Huggett
       [not found]   ` <mailman.13806.1106023018.27204.help-gnu-emacs@gnu.org>
  2005-01-17 19:45 ` Henrik Enberg
  2005-01-18 18:16 ` Enila Nero
  2 siblings, 2 replies; 9+ messages in thread
From: drkm @ 2005-01-17 19:13 UTC (permalink / raw)


Matthew Huggett <mhuggett@zam.att.ne.jp> writes:

> Is there any built-in command to kill all buffers that match a regex?

  I don't know.  IMHO, I think `C-x C-b', `d' on buffers you want to
delete, `x' to execute and `C-x 4 0' are a very easy way to kill
multiple buffers.

--drkm

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
       [not found] <mailman.13610.1105947021.27204.help-gnu-emacs@gnu.org>
  2005-01-17 19:13 ` kill buffers according to regex drkm
@ 2005-01-17 19:45 ` Henrik Enberg
  2005-01-18  4:54   ` Matthew Huggett
  2005-01-18 18:16 ` Enila Nero
  2 siblings, 1 reply; 9+ messages in thread
From: Henrik Enberg @ 2005-01-17 19:45 UTC (permalink / raw)


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))))

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
  2005-01-17 19:13 ` kill buffers according to regex drkm
@ 2005-01-18  4:07   ` Matthew Huggett
       [not found]   ` <mailman.13806.1106023018.27204.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Matthew Huggett @ 2005-01-18  4:07 UTC (permalink / raw)
  Cc: help-gnu-emacs

>   From: drkm <usenet@fgeorges.org>
>   Date: Mon, 17 Jan 2005 20:13:55 +0100>
>
>   Matthew Huggett <mhuggett@zam.att.ne.jp> writes:
>
>>  Is there any built-in command to kill all buffers that match a regex?
>
>     I don't know.  IMHO, I think `C-x C-b', `d' on buffers you want to
>   delete, `x' to execute and `C-x 4 0' are a very easy way to kill
>   multiple buffers.
>
>   --drkm

Thanks, I'll give those a try.

Matthew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
  2005-01-17 19:45 ` Henrik Enberg
@ 2005-01-18  4:54   ` Matthew Huggett
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Huggett @ 2005-01-18  4:54 UTC (permalink / raw)
  Cc: help-gnu-emacs

>    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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
       [not found]   ` <mailman.13806.1106023018.27204.help-gnu-emacs@gnu.org>
@ 2005-01-18 16:06     ` Kevin Rodgers
  2005-01-18 16:32       ` Drew Adams
  2005-01-18 17:41       ` drkm
  0 siblings, 2 replies; 9+ messages in thread
From: Kevin Rodgers @ 2005-01-18 16:06 UTC (permalink / raw)


Matthew Huggett wrote:
>>  From: drkm <usenet@fgeorges.org>
>>  Date: Mon, 17 Jan 2005 20:13:55 +0100>
>>
>>  Matthew Huggett <mhuggett@zam.att.ne.jp> writes:
>>
>>
>>> Is there any built-in command to kill all buffers that match a regex?
>>
>>    I don't know.  IMHO, I think `C-x C-b', `d' on buffers you want to
>>  delete, `x' to execute and `C-x 4 0' are a very easy way to kill
>>  multiple buffers.
> 
> 
> Thanks, I'll give those a try.

By default `C-x C-b' runs the command list-buffers.  drkm must use the
same customization I do:

(global-set-key "\C-x\C-b" 'electric-buffer-list)

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: kill buffers according to regex
  2005-01-18 16:06     ` Kevin Rodgers
@ 2005-01-18 16:32       ` Drew Adams
  2005-01-18 17:41       ` drkm
  1 sibling, 0 replies; 9+ messages in thread
From: Drew Adams @ 2005-01-18 16:32 UTC (permalink / raw)


    By default `C-x C-b' runs the command list-buffers.  drkm must use the
    same customization I do:
    
    (global-set-key "\C-x\C-b" 'electric-buffer-list)


Or, if you prefer `buffer-menu', as I do:

    (substitute-key-definition 'list-buffers 'buffer-menu global-map)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
  2005-01-18 16:06     ` Kevin Rodgers
  2005-01-18 16:32       ` Drew Adams
@ 2005-01-18 17:41       ` drkm
  1 sibling, 0 replies; 9+ messages in thread
From: drkm @ 2005-01-18 17:41 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> By default `C-x C-b' runs the command list-buffers.  drkm must use the
> same customization I do:

> (global-set-key "\C-x\C-b" 'electric-buffer-list)

  Hum...  No.  I didn't know this command.  I just forgot the `C-x o'.
It's interresting.  Thanks for the link and the correction.

--drkm

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: kill buffers according to regex
       [not found] <mailman.13610.1105947021.27204.help-gnu-emacs@gnu.org>
  2005-01-17 19:13 ` kill buffers according to regex drkm
  2005-01-17 19:45 ` Henrik Enberg
@ 2005-01-18 18:16 ` Enila Nero
  2 siblings, 0 replies; 9+ messages in thread
From: Enila Nero @ 2005-01-18 18:16 UTC (permalink / raw)


Matthew Huggett <mhuggett@zam.att.ne.jp> writes:

> Hello all,
>
> Is there any built-in command to kill all buffers that match a regex?

This might be helpful in constructing such a function:

In midnight.el you find the function clean-buffer-list which is
controlled by several variables one of which is

clean-buffer-list-kill-regexps

EN

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-01-18 18:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.13610.1105947021.27204.help-gnu-emacs@gnu.org>
2005-01-17 19:13 ` kill buffers according to regex drkm
2005-01-18  4:07   ` Matthew Huggett
     [not found]   ` <mailman.13806.1106023018.27204.help-gnu-emacs@gnu.org>
2005-01-18 16:06     ` Kevin Rodgers
2005-01-18 16:32       ` Drew Adams
2005-01-18 17:41       ` drkm
2005-01-17 19:45 ` Henrik Enberg
2005-01-18  4:54   ` Matthew Huggett
2005-01-18 18:16 ` Enila Nero
2005-01-17  7:15 Matthew Huggett

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.