From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to search all open buffers? Date: Fri, 31 Aug 2007 00:18:24 +0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1188508727 1299 80.91.229.12 (30 Aug 2007 21:18:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2007 21:18:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 30 23:18:45 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IQrPY-0000VY-FW for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Aug 2007 23:18:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IQrPY-0004mS-0X for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Aug 2007 17:18:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IQrPI-0004mM-Ba for help-gnu-emacs@gnu.org; Thu, 30 Aug 2007 17:18:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IQrPG-0004mA-CZ for help-gnu-emacs@gnu.org; Thu, 30 Aug 2007 17:18:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IQrPG-0004m7-8u for help-gnu-emacs@gnu.org; Thu, 30 Aug 2007 17:18:26 -0400 Original-Received: from nitzan.inter.net.il ([213.8.233.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IQrPF-0004tk-UD for help-gnu-emacs@gnu.org; Thu, 30 Aug 2007 17:18:26 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-254-135.inter.net.il [84.229.254.135]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id HRE96464 (AUTH halo1); Fri, 31 Aug 2007 00:15:39 +0300 (IDT) In-reply-to: (message from kj on Thu, 30 Aug 2007 16:46:27 +0000 (UTC)) X-Detected-Kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:46993 Archived-At: > From: kj > 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?