Text Replacement In Several Files With Emacs

Just a quickie. I was browsing around in Aaron Hawley’s Giant Emacs Reference Sheet when I came across this little ditty:

C-x d *.c RET Q int RET long    

It was described as “replace ‘long’ for ‘int’ in .c files.” I thought, “Boy, that’s really handy” and then I realized that it’s just

  1. Enter dired and list all the .c files
  2. Do a query replace substituting long for int

something that I’ve probably blogged about in the past.

Still, it does seem to gain power when you think of it as one command. And, if for only a moment, I thought I’d found something new and wonderful.

This entry was posted in General and tagged . Bookmark the permalink.