1

Suppose you have multiple files which has common lines of code or common matches of a regexp pattern. Is there an "emacs way" to comment/uncomment such specific common lines at once in all files?

I know how to do it with sed or awk, but maybe there is a clever way to do this type of job directly from emacs.

Julia
  • 141
  • 3

1 Answers1

2

I think functionality that comes closest to what you ask for, is provided via the wgrep package, optionally combined with some other package like iedit or multiple-cursors.el. You can search the web for more info about how to use (the combination of) them, or otherwise the answer here might be clear enough already. Personally, I am using Spacemacs, for which I found this video by Jack of Some very useful.

Alternatively, the noccur package as mentioned in the answer here looks useful too.

dalanicolai
  • 6,108
  • 7
  • 23