(lemacs.info)Tags Search

Next: Tags Stepping Prev: Find Tag Up: Tags

Searching and Replacing with Tag Tables

   The commands in this section visit and search all the files listed
in the selected tag table, one by one.  For these commands, the tag
table serves only to specify a sequence of files to search.  A related
command is `M-x grep' (Note: Compilation.).

`M-x tags-search'
     Search for the specified regexp through the files in the selected
     tag table.

`M-x tags-query-replace'
     Perform a `query-replace' on each file in the selected tag table.

     Restart one of the commands above, from the current location of
     point (`tags-loop-continue').

   `M-x tags-search' reads a regexp using the minibuffer, then visits
the files of the selected tag table one by one, and searches through
each file for that regexp.  It displays the name of the file being
searched so you can follow its progress.  As soon as an occurrence is
found, `tags-search' returns.

   After you have found one match, you probably want to find all the
rest.  To find one more match, type `M-,' (`tags-loop-continue') to
resume the `tags-search'.  This searches the rest of the current
buffer, followed by the remaining files of the tag table.

   `M-x tags-query-replace' performs a single `query-replace' through
all the files in the tag table.  It reads a string to search for and a
string to replace with, just like ordinary `M-x query-replace'.  It
searches much like `M-x tags-search' but repeatedly, processing matches
according to your input.  Note: Replace, for more information on

   It is possible to get through all the files in the tag table with a
single invocation of `M-x tags-query-replace'.  But since any
unrecognized character causes the command to exit, you may need to
continue from where you left off.  You can use `M-,' to do this.  It
resumes the last tags search or replace command that you did.

   It may have struck you that `tags-search' is a lot like `grep'.  You
can also run `grep' itself as an inferior of Emacs and have Emacs show
you the matching lines one by one.  This works mostly the same as
running a compilation and having Emacs show you where the errors were.
Note: Compilation.

automatically generated by info2www