all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to search all open buffers?
@ 2007-08-27 20:33 kj
  2007-08-27 22:36 ` Eric Hanchrow
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: kj @ 2007-08-27 20:33 UTC (permalink / raw)
  To: help-gnu-emacs




Hi.  What's the Emacs command to search for a string in all the
open buffers?  (I've searched the docs for a long time without
success, but I imagine it has to be in there somewhere...)

TIA!

kj
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  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
       [not found] ` <fb1e0l$jm0$1@reader1.panix.com>
  2 siblings, 1 reply; 20+ messages in thread
From: Eric Hanchrow @ 2007-08-27 22:36 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "kj" == kj  <socyl@987jk.com.invalid> writes:

    kj> Hi.  What's the Emacs command to search for a string in all
    kj> the open buffers?  

As far as I know, the only way to do it is

        M-x multi-occur-in-matching-buffers RET . RET your-search-string RET

which is not only awkward, but I swear sometimes it's failed to find
hits that I know where present.

A more reliable, but even more awkward way, is

        M-x ibuffer RET * * RET t O your-search-string RET

-- 
... at a contemporary beefsteak it is unusual for a man to do
away with more than six pounds of meat and thirty glasses of
beer.
        -- Joseph Mitchell

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-27 22:36 ` Eric Hanchrow
@ 2007-08-27 22:57   ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 20+ messages in thread
From: Lennart Borgman (gmail) @ 2007-08-27 22:57 UTC (permalink / raw)
  To: Eric Hanchrow; +Cc: help-gnu-emacs

Eric Hanchrow wrote:
>>>>>> "kj" == kj  <socyl@987jk.com.invalid> writes:
> 
>     kj> Hi.  What's the Emacs command to search for a string in all
>     kj> the open buffers?  
> 
> As far as I know, the only way to do it is
> 
>         M-x multi-occur-in-matching-buffers RET . RET your-search-string RET
> 
> which is not only awkward, but I swear sometimes it's failed to find
> hits that I know where present.
> 
> A more reliable, but even more awkward way, is
> 
>         M-x ibuffer RET * * RET t O your-search-string RET

There is a page here about similar things:

   http://www.emacswiki.org/cgi-bin/wiki/CategorySearchAndReplace

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: How to search all open buffers?
  2007-08-27 20:33 How to search all open buffers? kj
  2007-08-27 22:36 ` Eric Hanchrow
@ 2007-08-27 23:32 ` Drew Adams
  2007-08-29 15:52   ` Eric Hanchrow
       [not found] ` <fb1e0l$jm0$1@reader1.panix.com>
  2 siblings, 1 reply; 20+ messages in thread
From: Drew Adams @ 2007-08-27 23:32 UTC (permalink / raw)
  To: kj, help-gnu-emacs

> Hi.  What's the Emacs command to search for a string in all the
> open buffers?  (I've searched the docs for a long time without
> success, but I imagine it has to be in there somewhere...)

In Icicles, you do C-u 1 C-c ` and then either pick the buffers you want
(using C-mouse-2) or hit C-! to search them all.

C-c ` is `icicle-search'.  A positive numeric prefix arg tells it to search
multiple buffers. C-! acts on all buffers whose names match your input. If
you type nothing, then it acts on all open buffers.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Search_Commands%2c_Overview#
SearchMultipleBuffersFilesAndRegions

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
       [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
  1 sibling, 0 replies; 20+ messages in thread
From: Richard G Riley @ 2007-08-29  9:51 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> On top of that, how can a human possibly remember all their buffers in
> a session that runs for a long time?  If I don't remember what I have
> in my buffers, how in the world would I know that I have a good chance
> finding something in those buffers?

Bingo. The very reason someone might want the feature :-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-27 23:32 ` Drew Adams
@ 2007-08-29 15:52   ` Eric Hanchrow
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Hanchrow @ 2007-08-29 15:52 UTC (permalink / raw)
  To: help-gnu-emacs

I've created a little hacklet that seems to work for me:

    (defun search-all-buffers (regexp)
      (interactive "sRegexp: ")
      (multi-occur-in-matching-buffers "." regexp t))

    (global-set-key [f7] 'search-all-buffers)

-- 
As economics is known as "The Miserable Science", software
engineering should be known as "The Doomed Discipline"
        -- Edsger Dijkstra

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
       [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
       [not found]       ` <mailman.76.1188508709.18990.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 20+ messages in thread
From: kj @ 2007-08-30 16:46 UTC (permalink / raw)
  To: help-gnu-emacs

In <mailman.5468.1188330586.32220.help-gnu-emacs@gnu.org> Eli Zaretskii <eliz@gnu.org> writes:

>Can you explain why you would need such a command?  Perhaps there's a
>more convenient solution for the problem you tried to solve with the
>missing search-all-buffers command.

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.  The nature of this string or regex varies: most commonly
it's the name of a variable or function, 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.

I agree that it would be annoying to have the search waste any time
on *info*, *scratch*, etc.  But if the search is restricted to
file-visiting buffers, I think it would be extremely useful.

(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.)

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-30 16:46     ` kj
@ 2007-08-30 21:18       ` Eli Zaretskii
  2007-08-30 22:12         ` Dieter Wilhelm
       [not found]       ` <mailman.76.1188508709.18990.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2007-08-30 21:18 UTC (permalink / raw)
  To: help-gnu-emacs

> 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?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-30 21:18       ` Eli Zaretskii
@ 2007-08-30 22:12         ` Dieter Wilhelm
  2007-08-31  3:18           ` Eric Hanchrow
  2007-08-31  8:40           ` Eli Zaretskii
  0 siblings, 2 replies; 20+ messages in thread
From: Dieter Wilhelm @ 2007-08-30 22:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> 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.

But the A (dired-do-search) key seems to work only for the files which
are present in the current Dired buffer not necessarily for all opened
buffers.

Wouldn't be--in this context--dired-do-search in the buffer *Buffer
List* a better idea (if it only were available there)?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-30 22:12         ` Dieter Wilhelm
@ 2007-08-31  3:18           ` Eric Hanchrow
  2007-08-31  6:08             ` Dieter Wilhelm
  2007-08-31  8:40           ` Eli Zaretskii
  1 sibling, 1 reply; 20+ messages in thread
From: Eric Hanchrow @ 2007-08-31  3:18 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "Dieter" == Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

    Dieter> Wouldn't be--in this context--dired-do-search in the
    Dieter> buffer *Buffer List* a better idea (if it only were
    Dieter> available there)?

Actually, "ibuffer" has "ibuffer-do-multi-occur", which is pretty much
what you want.

-- 
A bad analogy is like a leaky screwdriver.
        -- Richard Braakman

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-31  3:18           ` Eric Hanchrow
@ 2007-08-31  6:08             ` Dieter Wilhelm
  2007-08-31 13:07               ` Eric Hanchrow
  0 siblings, 1 reply; 20+ messages in thread
From: Dieter Wilhelm @ 2007-08-31  6:08 UTC (permalink / raw)
  To: Eric Hanchrow; +Cc: help-gnu-emacs

Eric Hanchrow <offby1@blarg.net> writes:

>>>>>> "Dieter" == Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:
>
>     Dieter> Wouldn't be--in this context--dired-do-search in the
>     Dieter> buffer *Buffer List* a better idea (if it only were
>     Dieter> available there)?
>
> Actually, "ibuffer" has "ibuffer-do-multi-occur", which is pretty much
> what you want.

My answer is:
(global-set-key (kbd "C-x C-b") 'ibuffer)
(autoload 'ibuffer "ibuffer" "List buffers." t)

I'm doomed, why can't I live in peace and constantly have to master
yet another Emacs mode?  Thanks, anyway ;-)


-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-30 22:12         ` Dieter Wilhelm
  2007-08-31  3:18           ` Eric Hanchrow
@ 2007-08-31  8:40           ` Eli Zaretskii
  1 sibling, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2007-08-31  8:40 UTC (permalink / raw)
  To: help-gnu-emacs

> Cc: help-gnu-emacs@gnu.org
> From: Dieter Wilhelm <dieter@duenenhof-wilhelm.de>
> Date: Fri, 31 Aug 2007 00:12:48 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> 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.
> 
> But the A (dired-do-search) key seems to work only for the files which
> are present in the current Dired buffer not necessarily for all opened
> buffers.

I'm assuming that the OP is working on some project, since he said
that he wanted to find some function or variable in one of the
buffers.  Presumably, those buffers all visit files that belong to
some project, and if so, they all live in a single directory, or in a
single tree under the same parent directory.  Thus `A' is appropriate.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-08-31  6:08             ` Dieter Wilhelm
@ 2007-08-31 13:07               ` Eric Hanchrow
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Hanchrow @ 2007-08-31 13:07 UTC (permalink / raw)
  To: Dieter Wilhelm; +Cc: help-gnu-emacs

>>>>> "Dieter" == Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

    Dieter> My answer is: (global-set-key (kbd "C-x C-b") 'ibuffer)
    Dieter> (autoload 'ibuffer "ibuffer" "List buffers."  t)

    Dieter> I'm doomed, why can't I live in peace and constantly have
    Dieter> to master yet another Emacs mode?  Thanks, anyway ;-)

Perhaps you are doomed.  But I _much_ prefer ibuffer to the default;
you may too.

-- 
... at a contemporary beefsteak it is unusual for a man to do
away with more than six pounds of meat and thirty glasses of
beer.
        -- Joseph Mitchell

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: How to search all open buffers?
       [not found] <defy23tpt1.fsf@freenet.de>
@ 2007-09-01  1:22 ` Drew Adams
  0 siblings, 0 replies; 20+ messages in thread
From: Drew Adams @ 2007-09-01  1:22 UTC (permalink / raw)
  To: help-gnu-emacs

Wrt searching multiple buffers, in some cases only those visiting files, in
other cases including those not visiting files:

In Icicles, you can use C-c ' (`icicle-occur') to do either. A numeric
prefix arg tells C-c ' to search multiple buffers, not just the current one.
If the arg is 99, then only buffers visiting files are candidates: C-99 C-c
'.

Your minibuffer input filters the candidates when choosing the buffers to
search. You can type a regexp that matches a particular file suffix, to
limit the candidates to file buffers in a given mode.

You can use C-! to select all buffers that match your input, or you can
choose individual buffers that match.

If you often want to search the same set of buffers or files (e.g. for a
project), then you can define the set once, save it, and reuse it later. You
can save it persistently or not.

After you have chosen the buffers to search, you type a pattern (regexp)
that you want to search for. You can change the pattern on the fly - the
search hits are updated incrementally as you type.

C-c ` (`icicle-search') is more general than C-c '. Using it you can search
multiple buffers, multiple files, or multiple regions in different buffers.
You can save such sets of regions for later reuse.

With C-c `, you first parse the target buffers, files, or regions into
search segments using a preliminary regexp, instead of just searching within
all lines as for `occur'. You then search within the segments by typing a
pattern (regexp) to match dynamically (just as for C-c ').

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
       [not found]       ` <mailman.76.1188508709.18990.help-gnu-emacs@gnu.org>
@ 2007-09-04 13:30         ` kj
  2007-09-04 15:51           ` Tom Tromey
                             ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: kj @ 2007-09-04 13:30 UTC (permalink / raw)
  To: help-gnu-emacs

In <mailman.76.1188508709.18990.help-gnu-emacs@gnu.org> Eli Zaretskii <eliz@gnu.org> writes:

>> 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.

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.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-09-04 13:30         ` kj
@ 2007-09-04 15:51           ` Tom Tromey
  2007-09-04 16:45             ` Lennart Borgman (gmail)
  2007-09-04 20:38           ` Eli Zaretskii
       [not found]           ` <mailman.323.1188938333.18990.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 20+ messages in thread
From: Tom Tromey @ 2007-09-04 15:51 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> "kj" == kj  <socyl@987jk.com.invalid> writes:

kj> In all honesty, reading your reply made me only *more* puzzled at
kj> this resistance to a built-in command to search all file-visiting
kj> buffers.

I think it is a fine idea.  I'm a little surprised it doesn't exist
yet somewhere.  It shouldn't be too hard to write... :-)

That said, I doubt I'd use it.  I rarely even use occur -- and when
I'm doing multi-file things I almost always also want to search the
files in my project that I'm not visiting.

Tom

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-09-04 15:51           ` Tom Tromey
@ 2007-09-04 16:45             ` Lennart Borgman (gmail)
  2007-09-04 19:03               ` J. David Boyd
  0 siblings, 1 reply; 20+ messages in thread
From: Lennart Borgman (gmail) @ 2007-09-04 16:45 UTC (permalink / raw)
  To: tromey; +Cc: help-gnu-emacs

Tom Tromey wrote:
>>>>>> "kj" == kj  <socyl@987jk.com.invalid> writes:
> 
> kj> In all honesty, reading your reply made me only *more* puzzled at
> kj> this resistance to a built-in command to search all file-visiting
> kj> buffers.
> 
> I think it is a fine idea.  I'm a little surprised it doesn't exist
> yet somewhere.  It shouldn't be too hard to write... :-)

http://www.emacswiki.org/cgi-bin/wiki?action=browse;oldid=SearchAndReplace;id=CategorySearchAndReplace

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-09-04 16:45             ` Lennart Borgman (gmail)
@ 2007-09-04 19:03               ` J. David Boyd
  0 siblings, 0 replies; 20+ messages in thread
From: J. David Boyd @ 2007-09-04 19:03 UTC (permalink / raw)
  To: help-gnu-emacs

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

> Tom Tromey wrote:
>>>>>>> "kj" == kj  <socyl@987jk.com.invalid> writes:
>>
>> kj> In all honesty, reading your reply made me only *more* puzzled at
>> kj> this resistance to a built-in command to search all file-visiting
>> kj> buffers.
>>
>> I think it is a fine idea.  I'm a little surprised it doesn't exist
>> yet somewhere.  It shouldn't be too hard to write... :-)
>
> http://www.emacswiki.org/cgi-bin/wiki?action=browse;oldid=SearchAndReplace;id=CategorySearchAndReplace

There is something called multi-occur that does this.

Dave

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
  2007-09-04 13:30         ` kj
  2007-09-04 15:51           ` Tom Tromey
@ 2007-09-04 20:38           ` Eli Zaretskii
       [not found]           ` <mailman.323.1188938333.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2007-09-04 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

> From: kj <socyl@987jk.com.invalid>
> Date: Tue, 4 Sep 2007 13:30:24 +0000 (UTC)
> 
> >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.

I didn't mean to suggest that you mark the files that you are
visiting; that's just silly.  I meant to suggest searching through all
the files in your project's directory.  (There are Dired commands to
mark only files whose names match a regexp, if you need to be more
selective.)

I explained elsewhere in this thread why I think that in an Emacs
session that runs for long enough, the user can never be sure whether
the file she needs to search is visited by some of the buffers.  Thus
the suggestion to look on disk, and let Emacs optimize by searching
buffers where appropriate.

> Just imagine, for a second, having to go through the equivalent
> rigmarole of creating a tags file just to search within a *single*
> buffer

What rigmarole?  All it takes is a single command:

     find . -name "*.c" | etags -

A well organized project should have a TAGS target in its Makefiles
anyway, and for an actively developed project that target should run
automatically every day or so, to keep the database up to date.

> 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.

There's no resistance at all.  As others told you, there are at least
two packages that offer this functionality, so any resistance would be
simply foolish on my part.

No, what I was trying to say was that if you are in dire need of such
a command during program development, you should probably explore ways
to organize your work and your projects in more efficient ways.  It's
analogous to the "goto-line" command: some people claim it's very
important to them for finding lines announced by compiler error
messages because they don't use the "M-x compile" facilities that are
designed to do that job much better.

Of course, you are free to ignore my views, if they don't seem helpful
to you.

> Now I find it downright bizarre and mysterious.  Something
> resembling a phobia or a religious taboo, and that simply cannot be
> understood by outsiders...

No need to get offensive or rude.  I was describing the way I work on
my projects; while it may seem strange to you (as much as yours seems
strange to me), it serves me well for many years, and I was trying to
help you make your developer life easier.

You are welcome.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: How to search all open buffers?
       [not found]           ` <mailman.323.1188938333.18990.help-gnu-emacs@gnu.org>
@ 2007-09-07 19:16             ` kj
  0 siblings, 0 replies; 20+ messages in thread
From: kj @ 2007-09-07 19:16 UTC (permalink / raw)
  To: help-gnu-emacs

n <mailman.323.1188938333.18990.help-gnu-emacs@gnu.org> Eli Zaretskii <eliz@gnu.org> writes:

>> From: kj <socyl@987jk.com.invalid>
>> Now I find it downright bizarre and mysterious.  Something
>> resembling a phobia or a religious taboo, and that simply cannot be
>> understood by outsiders...

>No need to get offensive or rude.

On this point we agree.  I should have been thanking you for your
replies instead of being a spoiled jerk.  I apologize.

kj
-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-09-07 19:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.