I've received a number of comments on my earlier Query Replace post. Today Kaom Te asked about query replace over multiple files.
One of my favorite shell commands is "find" and in particular, emacs supports "find" as part of its "dired" mode. (dired == directory editing)
Type "meta-x find-dired" and emacs will prompt you through the arguments to "find" multiple files in various ways. The result is a dired buffer listing all the matching files, which you can operate on as with any dired buffer, including query/replace.
The other common way to query and replace over multiple files is to use "tags". Tag files are like indexes you build over various kinds of sources. Tag files can be built for multiple source directories and files in C, Java, Lisp, Erlang, HTML, etc.
Then, of course, there is an emacs function called "tags-query-replace" which will perform a query/replace over the files in your TAGS file with fewer steps than using "find-dired". Tags have many other uses as well since they understand the definitions of the source format, e.g. "meta-." can be used to open a buffer on the definition of the name currently under the cursor ("point" in emacs).
1 comment:
Thanks for the response Patrick. I will look into the Tags approach you have suggested.
Email:
sickfaichezi
AT
gmail.com
Post a Comment