From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: undo-kill-buffer Date: Wed, 25 Oct 2006 09:05:08 -0700 Message-ID: References: <33359.128.165.123.18.1161787034.squirrel@webmail.lanl.gov> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1161792745 3165 80.91.229.2 (25 Oct 2006 16:12:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Oct 2006 16:12:25 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 25 18:12:21 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GclMA-0005X7-Ok for ged-emacs-devel@m.gmane.org; Wed, 25 Oct 2006 18:11:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GclMA-0005fv-4o for ged-emacs-devel@m.gmane.org; Wed, 25 Oct 2006 12:11:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GclFo-0007rZ-U2 for emacs-devel@gnu.org; Wed, 25 Oct 2006 12:05:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GclFj-0007md-96 for emacs-devel@gnu.org; Wed, 25 Oct 2006 12:05:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GclFi-0007mF-RP for emacs-devel@gnu.org; Wed, 25 Oct 2006 12:05:15 -0400 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GclFh-0001cf-Hg for emacs-devel@gnu.org; Wed, 25 Oct 2006 12:05:14 -0400 Original-Received: from rgmsgw02.us.oracle.com (rgmsgw02.us.oracle.com [138.1.186.52]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id k9PG590E008902 for ; Wed, 25 Oct 2006 11:05:10 -0500 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw02.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with SMTP id k9PG5896029206 for ; Wed, 25 Oct 2006 10:05:09 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <33359.128.165.123.18.1161787034.squirrel@webmail.lanl.gov> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:61160 Archived-At: I use this when I'm "done with a project": (defun kill-buffers-by-regexp (REG &optional AUTO) "Offer to kill each buffer whose name matches REG. If AUTO is non-nil, kill all such buffers, prompting only if a buffer needs saving." ...) Along similar lines, with Icicles you can do that easily: 1. Type a regexp to the `C-x k' prompt for a buffer name. 2. Hit `S-TAB' to show all buffers that match, in *Completions*. 3. Pick matching buffers to kill - several ways: a. `C-!' to kill all matching buffers. b. `C-mouse-2' in *Completions* to kill buffers by clicking - kill any number of them. c. Cycle among the matching buffers with `next' and `prior', and use `C-RET' to kill selected candidates during cycling - kill any number of them. d. Use `C-next' and `C-prior' to kill selected buffer and cycle to the next - kill any number of them. IOW, `C-x k' is a multi-command: you can kill multiple matching buffers in the same invocation of `C-x k'. You can change the regexp on the fly to continue killing buffers with names that match a different pattern. *Completions* is updated as you type in the minibuffer, so it tracks your input with the names that match. The exact same thing applies to files and directories, using command `icicle-delete-file' instead of `C-x k' (`icicle-kill-buffer'). And the same thing applies to windows showing a buffer, using `C-x 0' (`icicle-delete-window'). With no prefix arg, it just deletes the current window. With `C-u', it prompts for a buffer name, to delete all windows showing the buffer. You treat the buffer name using completion, just like `C-x k', so you can delete all windows showing any selection of buffers, or all buffers, that match a regexp. It is easy to define multi-commands like these, BTW. Here is the definition of `icicle-delete-file': (icicle-define-file-command icicle-delete-file ; Command name "Delete a file or directory." ; Doc string icicle-delete-file-or-directory ; Function to perform action "Delete file or directory: " ; `read-file-name' args default-directory nil t) (defun icicle-delete-file-or-directory (file) "Delete file (or directory) FILE." (if (eq t (car (file-attributes file))) (delete-directory file) (delete-file file))) http://www.emacswiki.org/cgi-bin/wiki/Icicles