From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: John Paul Wallington Newsgroups: gmane.emacs.help Subject: Re: How to search through all buffers? Date: Sat, 05 Apr 2003 05:11:47 +0100 Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <87adf5wpks.fsf@indigo.shootybangbang.com> References: <87r88hy8mr.fsf@blarg.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049516172 25107 80.91.224.249 (5 Apr 2003 04:16:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2003 04:16:12 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 05 06:16:11 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 191f6B-0006Wo-00 for ; Sat, 05 Apr 2003 06:16:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191f5d-00047B-08 for gnu-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2003 23:15:37 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed.stueberl.de!fu-berlin.de!uni-berlin.de!host217-44-221-152.range217-44.btcentralplus.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-NNTP-Posting-Host: host217-44-221-152.range217-44.btcentralplus.com (217.44.221.152) Original-X-Trace: fu-berlin.de 1049516040 6816361 217.44.221.152 (16 [170119]) X-Orig-Path: indigo.shootybangbang.com!news X-Attribution: jpw User-Agent: Gnus/5.090017 (Oort Gnus v0.17) Emacs/21.3.50 (powerpc-unknown-linux-gnu) Cancel-Lock: sha1:g9AyEe3fZl4sA0Kf9liZ8TP68KQ= Original-Xref: shelby.stanford.edu gnu.emacs.help:111680 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8182 Eric Hanchrow wrote: > I'd like to find all the occurrences of a particular word in all my > Emacs buffers, but cannot think of a way to do it short of writing my > own Elisp. Is there in fact a way? With Emacs CVS HEAD (which you appear to be using) you can mark your buffers in Ibuffer then press O. Or use the `multi-occur' or `multi-occur-by-filename-regexp' commands. If the interactivity is tiresome, how about something like this (lightly tested): (defun hanchrow-all-encompassing-occur (regexp &optional hidden-bufs-too) "Show all lines in all visible buffers containing a match for REGEXP. With prefix arg HIDDEN-BUFS-TOO, show lines matching in all buffers." (interactive (occur-read-primary-args)) (if (interactive-p) (setq hidden-bufs-too current-prefix-arg)) (multi-occur (if hidden-bufs-too (buffer-list) (delq nil (mapcar (lambda (buf) (unless (string-match "^ " (buffer-name buf)) buf)) (buffer-list)))) regexp))