From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: kj Newsgroups: gmane.emacs.help Subject: Re: How to search all open buffers? Date: Tue, 4 Sep 2007 13:30:24 +0000 (UTC) Organization: none Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1188913302 18935 80.91.229.12 (4 Sep 2007 13:41:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2007 13:41:42 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Sep 04 15:41:41 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 1ISYeR-0000YA-4a for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Sep 2007 15:41:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ISYeP-0004gy-GL for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Sep 2007 09:41:05 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!panix!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 74 Original-NNTP-Posting-Host: panix3.panix.com Original-X-Trace: reader1.panix.com 1188912624 16454 166.84.1.3 (4 Sep 2007 13:30:24 GMT) Original-X-Complaints-To: abuse@panix.com Original-NNTP-Posting-Date: Tue, 4 Sep 2007 13:30:24 +0000 (UTC) X-No-Confirm: yes User-Agent: nn/6.7.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:151671 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:47196 Archived-At: In Eli Zaretskii writes: >> 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. This is quite impractical. As far as I can tell, 'A' searches all the "specified files", so solving my problem with 'A' entails first going back and forth between *Buffer List* and various Dired buffers, and marking those files that are being visited. (Marking the enclosing directories is inadequate because, first, 'A' emits an error when it is asked to search a directory, and second, the directories contain many more files than those that are being visited, which would not only slow down the search, but more importantly, would generate many spurious hits contained in files of no interest to me at the moment.) >> 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. I have used Tags before and I find it *extremely* inconvenient. >> 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... Yes, but it has the same problems as Tags: it requires the intermediate step of creating an ids database. What I'm missing is not search speed, but rather the convenience of being able to search all the file-visiting buffers *right now*, not after I fashion a suitable intermediate file... Even a recursive M-x grep is better than that, but it suffers from the same problem of spurious hits mentioned earlier. >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? Just imagine, for a second, having to go through the equivalent rigmarole of creating a tags file just to search within a *single* buffer; if such prospect seems supremely annoying to you then you'll understand how I feel about making a tags file for searching multiple buffers. In all honesty, reading your reply made me only *more* puzzled at this resistance to a built-in command to search all file-visiting buffers. Now I find it downright bizarre and mysterious. Something resembling a phobia or a religious taboo, and that simply cannot be understood by outsiders... kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded.