From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: How to search all open buffers?
Date: Fri, 31 Aug 2007 00:18:24 +0300 [thread overview]
Message-ID: <uir6wbu1r.fsf@gnu.org> (raw)
In-Reply-To: <fb6s92$plu$1@reader1.panix.com> (message from kj on Thu, 30 Aug 2007 16:46:27 +0000 (UTC))
> From: kj <socyl@987jk.com.invalid>
> Date: Thu, 30 Aug 2007 16:46:27 +0000 (UTC)
>
> I run into this *all* the time: I've been coding for several days,
> working on 20-30 files simultaneously, and I need to get back to
> the one among these many buffers that contains a particular string
> or regex.
Then just search the files for that regex, e.g. with the Dired's `A'
command. Emacs will notice when a particular file is already in a
buffer and will search that buffer instead.
> The nature of this string or regex varies: most commonly
> it's the name of a variable or function
If you are looking for a symbol, use the Tags commands (see the node
"Tags" in the manual for more details), they are much more efficient
than searching all buffers.
> but it could be the regex
> 'sub [a-z_]+foo[a-z_]+' in a Perl file, or a the string 'cf.' that
> I remember using in a comment, or some nifty idiom that matches
> 'select (.*\]', etc.
For these, I highly recommend to install GNU Id-utils (if you don't
have them already on your system), and use the "M-x gid" interface
command. The search using Id-utils is lightning-fast, much faster
than searching all the buffers with Emacs built-in search commands,
and supports regular expressions and substrings in a
language-sensitive way (i.e. it knows about the syntax of C/C++, for
example).
Bottom line: if you need to search files, use commands that search
files, they are highly optimized and much better suited for the task
> (I remember using etags years ago, but found it extremely cumbersome,
> and useful only in a fraction of the situations for which I needed
> this type of global search.)
What was cumbersome? perhaps you didn't know about some useful command
or feature related to tags. How about if you try again and see if
there are any problems that bother you?
next prev parent reply other threads:[~2007-08-30 21:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-27 20:33 How to search all open buffers? kj
2007-08-27 22:36 ` Eric Hanchrow
2007-08-27 22:57 ` Lennart Borgman (gmail)
2007-08-27 23:32 ` Drew Adams
2007-08-29 15:52 ` Eric Hanchrow
[not found] ` <fb1e0l$jm0$1@reader1.panix.com>
[not found] ` <mailman.5468.1188330586.32220.help-gnu-emacs@gnu.org>
2007-08-29 9:51 ` Richard G Riley
2007-08-30 16:46 ` kj
2007-08-30 21:18 ` Eli Zaretskii [this message]
2007-08-30 22:12 ` Dieter Wilhelm
2007-08-31 3:18 ` Eric Hanchrow
2007-08-31 6:08 ` Dieter Wilhelm
2007-08-31 13:07 ` Eric Hanchrow
2007-08-31 8:40 ` Eli Zaretskii
[not found] ` <mailman.76.1188508709.18990.help-gnu-emacs@gnu.org>
2007-09-04 13:30 ` kj
2007-09-04 15:51 ` Tom Tromey
2007-09-04 16:45 ` Lennart Borgman (gmail)
2007-09-04 19:03 ` J. David Boyd
2007-09-04 20:38 ` Eli Zaretskii
[not found] ` <mailman.323.1188938333.18990.help-gnu-emacs@gnu.org>
2007-09-07 19:16 ` kj
[not found] <defy23tpt1.fsf@freenet.de>
2007-09-01 1:22 ` Drew Adams
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=uir6wbu1r.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@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).