0

I have a build log file that includes information on issues reported by clang-tidy. Each of the lines in the log file that reference an issue identified by clang-tidy contain the string "warning G". The problem is that the vast majority of the issues are not in my code and most of those that are not in my code are in Boost. Each of the lines in the log file that reference an issue identified by clang-tidy in Boost also contain the string "\include\boost/". So what I need is a way to list all the lines in the buffer that contain the string "warning G" and do not contain the string "\include\boost/".

Occur gets me half way there, it allows me to list all lines that match "warning G" but I do not know how to filter out the lines that match "\include\boost/".

7
1

You can use M-x flush-lines in the occur buffer to perform the second half. You may have to toggle the read-only state first.

2
  • This worked perfectly. Thanks. – Ben Key Dec 11 '20 at 3:19
  • You're welcome. Note also that keep-lines is the inverse command (to delete everything not matching the regexp). – phils Dec 11 '20 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.