unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: John Paul Wallington <jpw@gnu.org>
Subject: Re: How to search through all buffers?
Date: Sat, 05 Apr 2003 05:11:47 +0100	[thread overview]
Message-ID: <87adf5wpks.fsf@indigo.shootybangbang.com> (raw)
In-Reply-To: 87r88hy8mr.fsf@blarg.net

Eric Hanchrow <offby1@blarg.net> 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))

  reply	other threads:[~2003-04-05  4:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-05  2:34 How to search through all buffers? Eric Hanchrow
2003-04-05  4:11 ` John Paul Wallington [this message]
2003-04-05  4:44   ` John Paul Wallington
2003-04-05  6:11     ` John Russell
2003-04-07 18:23 ` Kevin Rodgers

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=87adf5wpks.fsf@indigo.shootybangbang.com \
    --to=jpw@gnu.org \
    /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).