I think is better to not use the buffer and always read the file. This way we always mark all the files containing the regexp, regardless of the user customization.