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, searching.
5 Comments Add your own
Leave a reply to George Cancel reply
Trackback this post | Subscribe to the comments via RSS Feed
1. Interesting Emacs Links - 2009 Week 11 « A Curious Programmer | March 15, 2009 at 5:48 pm
[…] are posts on searching multiple buffers, emacs version control and emacs buttons within the same […]
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.
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.
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
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!