[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to search all open buffers?

From: Eli Zaretskii
Subject: Re: How to search all open buffers?
Date: Tue, 04 Sep 2007 23:38:53 +0300

> From: kj <address@hidden>
> 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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]