Searching multiple buffers emacs

July 27, 2008 at 6:43 pm 5 comments

FSF has two magic functions for searching multiple buffers:

multi-occur: – Search specified buffers to a string

multi-occur-in-matching-buffers: Allows one to search a subset of one’s open buffers or files specified as a regexp:

Given .* as its first argument, this allows one to search all currently open files for a given regular expression.

Given a prefix argument and .* as its first argument, this allows one to search all currently open buffers for a regular expression.

Also (occur-1 regexp nil buffer-list) can be usefully adapted to search for other things.

Entry filed under: Uncategorized. Tags: , .

Emacs buttons – an introduction for the somewhat impatient Emacs version control

5 Comments Add your own

  • […] are posts on searching multiple buffers, emacs version control and emacs buttons within the same […]

    Reply
  • 2. vedang  |  March 17, 2009 at 6:52 am

    Thanks dude, this is a big help… may post about this on my own blog (if/when i get time) will surely leave a trackback.

    Reply
  • 3. George  |  December 4, 2009 at 3:11 am

    An equivalent command over on the Xemacs side is “list-matches-in-buffers”. It’s present in version 21.4, and probably earlier ones.

    Reply
  • 4. tripleee  |  March 2, 2012 at 7:43 am

    The text is misleading, FSF Emacs *does* have this built-in. M-x multi-occur RET

    See also http://stackoverflow.com/questions/2641211/emacs-interactively-search-open-buffers

    Reply
    • 5. Anon  |  April 6, 2012 at 10:49 am

      Hmm… thanks for the comment. I think I wrote this too late into the night three years ago and included a stray “not” (which I’ve deleted now). The post was meant to document the inbuild functions you can use.

      Thanks again, bye!

      Reply

Leave a reply to George Cancel reply

Trackback this post  |  Subscribe to the comments via RSS Feed


July 2008
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031